swf loading swfs problem RESOLVED

Software: Away3D 4.x

Bryan Rickertsen, Newbie
Posted: 06 December 2011 08:25 PM   Total Posts: 6

I am having a problem making a swf load other swfs properly.  I am
using a series of swfs as levels in a game.  The first swf loads as
expected but when subsequent swfs are loaded, only the text fields are
visible, but the Away3D content other than AwayStats is not visible.
The same logic worked using an earlier version of Away3D 4 that I
downloaded in May, 2011, and ran in the incubator version of Flash
Player 11.  However, when I updated to the current version of Away3D
and compiled the game with Flex sdk 4.5.1.21328, in order to run it in
Flash Player 11.1, I now encounter the problem.  I am attempting to
run it in Internet Explorer 9.0.3.  The swfs all load properly when
loaded directly from html.
I reported a problem with the same symptoms last May (on Away3d-dev), but in that case, we discovered that the Away3D content was displaying properly, but it was behind a solid colored stage-sized symbol.  Making the
symbols transparent solved that problem.
A folder with all of the code and a compiled example of the problem is
available at
http://www.nanolegends.com/Away3Dswfload/swfLoadProblem.zip
See SwfLoadProblemNotes.pdf in the folder for explanation.

I hope someone can see my mistake or point me to a place to find a solution.


Thanks
Bryan

   

Avatar
maddog, Sr. Member
Posted: 07 December 2011 02:33 AM   Total Posts: 118   [ # 1 ]

They seem to load if you hit rightclick on mouse and select rewind. then it appears. don’t know what that means.

   

tcorbet, Jr. Member
Posted: 07 December 2011 02:39 AM   Total Posts: 31   [ # 2 ]

I thought I would try to help because some aspects of the problem you are describing, I think have something in common with one concerning sub-application windows with which I have dealt—have posted on the Adobe forums, submitted bugs, and tracked the attempted ‘fix’ in the recent ‘Mega’ SDK release.  However, so far I have not been able to make much progress.

First, it would be helpful if your ‘How to Test’ notes indicated which Key you want a tester to press in order to progress from load to load.  Ok, so I can read your source code to find out that it is the A key, but perhaps others won’t be so motivated.

Second, for each test I have run, I am getting:

Error: Error #3669 Bad input size.
  at flash.display3D.Conte3xt3D/configureBackBuffer()

Now, since I have the Flash Player 11.2 debugger running on most of my test beds, and I don’t want that to be the possible cause of the error which you are not reporting, I have tried on all of these combinations with the same result:

    Snow Leopard, Safari which has the FP 11.1 release debugger.
    Snow Leopard, FF8, which may have 11.2, but probably has 11.1

    Windows XP, FF8 w/11.2
    Windows XP, IE8, w/11.2
    Windows XP Chrome, w/11.1

One or more of those would probably be comparable to your own test environment, so I guess I need help in understanding what else I might have to do to be able to replicate the problem you are wanting assistance on resolving.  So, let me know.

UPDATE:

With Windows XP running Chrome with FP 11.1 instead of 11.2, I can create the ‘empty white screen, except for non-3D content’ that you were trying to describe.  So, adding that information to what maddog was able to discover about ‘Rewind’ on the context menu, I think the odds are pretty good that your problem has nothing to do with the Away3D API.

I don’t have a Flash build/test environment, but I was able to decompile your StartTest.fla to look around.  The way a Flash programmer loads child swfs is not quite what I do in the pure Actionscript or AIR environments, so I am not sure how the goToAndStop((), or probably more importantly, the unload() methods behave.  I assume that is the world you live in and are comfortable in, so I am going to guess that, if they behave properly after a Rewind, they are OK.

What seems not OK, and what I suspect the reason is that I am able to see the error message shown above, is that you do not consistently handle the asynchronous loading of the swf files, so there is a ‘race condition’ under which the processing necessary to establish the Context3D has not completed.  I think if you enforce a consistent wait for the ADDED_TO_STAGE event for each transition from Test N to Test N+1, the race condition will ‘go away’.  I would look particularly at the if (stage == null) test, since that probably returns a different result at start up than it does for subsequent loads.

I hope this may help—it turns out yours is NOT the parent-child problem that I am trying to get Adobe resolution for.
 

   

Delfeld, Newbie
Posted: 07 December 2011 07:03 AM   Total Posts: 16   [ # 3 ]

Bryan,

  After I ignore all the error messages, if I hold down the “A” key, and release it after a few seconds, you can see the 3D objects for whatever SWF is currently active.  Sometimes.  But it seems like a layering problem, or else a race condition.  Also, the memory usage grows larger and larger.  With garbage collection, this should either stay constant after a certain point, or else fluctuate around a certain value without increasing. 

  Which points to the error #3669 that I am getting.  This is a “Bad input size” error.  This seems to be problem when setting the wid/ht to 0, or less than 0, probably.  However, this is probably not the cause of the problem, but maybe a side-effect.

  You are not removing the Event.ENTER_FRAME (or the Key events, either) when you call dispatchUnload() within onEnterFramex() method.  You can see that the FPS turns into “Infinity” at times, and this indicates that something is not done running, so is not garbaged yet, which may hide the Stage3D visibility.

So here are some suggestions:

- Add xxx.removeEventListener([xxx], Event.ENTER_FRAME), xxx.removeEventListener([xxx], KeyboardEvent.KEY_DOWN), etc. when unloading the SWF.
- Put any removeEventListener() call as the close as possible to being the very first call within an event method.  This can prevent duplicate calls at times, which may solve the issue indirectly (but it’s a lousy way to fix a bug). 
- When creating a View3D object, add a width and height parameter: view = new View3D({width: 100, height: 200});
- Try publishing the SWFs as “GPU”, rather than “direct”.
- Publish as “exact fit”, though that is an HTML option. 

  I cannot test the ideas because our specific versions don’t match.


Regards,

Neal.

   

Bryan Rickertsen, Newbie
Posted: 07 December 2011 10:40 PM   Total Posts: 6   [ # 4 ]

Thanks to maddog, tcorbet and delfeld (Hi Neal) for your thoughtful analysis and suggestions.  I should have mentioned this in the original post, but the 3D content expected for each of the three swfs is different.  Test1.swf should show one red sphere and one rotating orange cube.  Test2.swf should show one red sphere and two rotating orange cubes.  Test3.swf should show one red sphere and three rotating orange cubes.  Each of the test swfs should put its own name in the “In Program =” field. 
When I use right-click-rewind I get 3-D content that is not correctly matched with the names.  When I hold the “a” key, my logic appears to cycle through several unloads and loads, but always displays 3-D content that always corresponds to the expected name in the “In Program =” field. 
I am working on cleaning up the logic to prevent the race condition and removing listeners that are no longer wanted, but I haven’t got it working properly yet. 
Thanks again for your interest and suggestions.  I will post results as soon as I have something to show.

   

Bryan Rickertsen, Newbie
Posted: 07 December 2011 10:42 PM   Total Posts: 6   [ # 5 ]

Also, I do not see any errors when I test in the browser.

   

Delfeld, Newbie
Posted: 08 December 2011 08:15 PM   Total Posts: 16   [ # 6 ]

Hi, Bryan,

  Are you using the debugger version of Flash Player?  Also, for each FLA/SWF, in the publishing settings, you may need to check the box “Permit debugging”, and make sure to uncheck “Omit trace statements”.  Put a trace in the enterframex() method, and see if it *actually* stops when the SWF is supposed to be removed.

Regards,

   

Bryan Rickertsen, Newbie
Posted: 19 December 2011 05:55 PM   Total Posts: 6   [ # 7 ]

As pointed out in helpful comments, the example I provided with my original post contained some logic issues that made it difficult to focus on the main problem.  My subsequent investigation seems to indicate that the underlying problem is caused by unloadandstop failing to properly unload the swf content. I have created a model that separates the unloadandstop from the load to illustrate. A folder with all of the code and a compiled example is available at:
http://www.nanolegends.com/Away3Dswfload/swfUnloadProblem.zip
See SwfLoadProblemNotes.pdf in the folder for further explanation.
This leads to the question:  What is the proper technique for Flash Player 11.1 for unloading a swf with Away3D content?

   

QW, Newbie
Posted: 27 January 2012 11:03 AM   Total Posts: 3   [ # 8 ]
Bryan Rickertsen - 19 December 2011 05:55 PM

This leads to the question:  What is the proper technique for Flash Player 11.1 for unloading a swf with Away3D content?

Exactly got the same problem. Unloaded swfs with Stage3D references are not removed from the stage :(

   

Bryan Rickertsen, Newbie
Posted: 27 January 2012 02:31 PM   Total Posts: 6   [ # 9 ]

I finally got this to work by removing the view, using these statements:

this.removeChild(view)
view.stage3DProxy.dispose();

I did that inside the swf I wanted to unload.  An then in the main controll swf, I used these statements to remove the loader used to load the swf:

loader2.unloadAndStop();
this.removeChild(loader2);

   

Bryan Rickertsen, Newbie
Posted: 27 January 2012 02:40 PM   Total Posts: 6   [ # 10 ]

I learned this from Synsim’s post: Proper way to dispose Stage3D context’s content when recreating View3D many times

Thank you Synsim.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X