actually your issue is this line here
loader_html.load( new URLRequest( url ) );
because a Loader object can only have one child display object—the display object that it loads.
well there is a few ways to fix this
the first fix but i am not 100% sure on this but is very easy so lets try it
in the code you pasted here http://pastie.org/363997
on line 48 which is commented at the moment add a new line and put this in
loader_html = new URLLoader( );
by doing this I am hoping it will remove the child reference and allow you to reuse the var.
so try that and let me know, but i have a feeling this wont fix it
my next fix is a bit more drastic and will fix it but lets wait and see how this works
oops double post
Since you feel you are having a hard time with AS 3 i would suggest to study up on class files and try to understand them as best you can.
I started with a simple button class using dynamic text fields and the drawing api.
then took it further to dispatching events from that class
once you understand these basics the rest should fall into place.
from the looks of it i think you have a pretty good grasp of it already. don’t let a few small set backs push you away
if you ever need help or advice feel free to email me through my den. I am always willing to help someone struggling because i know how it can be.
scratch that last bit
ok i got your problem
from the help docs
The Loader class overrides the following methods that it inherits, because a Loader object can only have one child display object—the display object that it loads. Calling the following methods throws an exception: addChild(), addChildAt(), removeChild(), removeChildAt(), and setChildIndex(). To remove a loaded display object, you must remove the Loader object from its parent DisplayObjectContainer child array.
so 2 things you can do here
right before everytime you do a loader.load( ) add the line
or use the class example to load your stuff
again from the flash docs
create a new instance of this class each time you want to load something.
EX: var myLoader:LoaderExample = new LoaderExample ( )
either way you need to redesign your file to accomodate this.
also note that this class is not set up for dynamic use you need to modify it so that you can set the url dynamically
no you do not have to name any object
the flash api will dynamically name it at compile time
( EX: instance1 )
you say this works
URL _loader( “sample0.html” );
but this does not work
myselection2 = “sample” + myselection + ”.html”;
URL _loader( myselection2 );
easy to debug
bring it to basics
var testString:String = “0”
myselection2 = “sample” + testString+ ”.html”;
trace( myselection2 );
URL _loader( myselection2 );
if that still fails let me know
A lot of times the flash tween class does not work 100% as expected especially when it is used in a loop. Anyone knows solution to get out of this?
it all depends on what issues you are having
but chances are most of your tween issues will be resolved if you declare the var myTween:Tween outside of the a function
in AS3 there is a property that lets you test if it is still tweening
so a simple
if( myTween.isPlaying )
will also help you
This would be interesting to find out but I do not think its possible.
Sorry can’t help with the standalone.
keep track of your event listeners/ENTER_FRAME/timers
make sure you are not instantiating in the loop( s )
i have found a badly placed listener can have adverse effects on cpu resources.
so try to keep them to a minimium and keep an eye on the scope they are in