I actually ran into the same issue when I first used this...
Another thing to look out for is FileReference. I haven't tested anything
outside of the following case, so I don't really know the rules surrounding
the cause.
Well, if you define FileReference inside the same function body that you
call download()/upload() - it will fail. You get an I/O Error... In this
case, when the function defining FileReference is finished executing, the
reference to the FileReference instance is gone, so it should have a
reference count of 0. This leads me to believe that the issue is some how
linked to garbage collection. What is strange is that this doesn't cause any
other classes that have asynchronous methods to misbehave (Loader,
URLLoader.) Stranger yet, callbacks to IOErrorEvent.IO_ERROR are still
invoked. I've yet to run this with the Profiler to see what is going on...
H
On Thu, Aug 7, 2008 at 8:42 PM, Ed Haack <[EMAIL PROTECTED]> wrote:
> Ok, I'm a little slow to adopt all of the nifty cool features of CS3 --
> just
> now taking advantage of "Copy Motion to Actionscript 3.0" where it gens the
> Animator AS3 code for you. Nice.
>
> It works if you place the code on the timeline/frame. Fantastic.
>
> But to really put this to use, I need it to work in a class... So, I
> created
> a simple fla, with a document class (I know it's wired up correctly, with a
> trace("crack") in the constructor, which is coming back. Added the public
> var for the clip on the stage "mcTest" -- and just under the
> trace("crack"),
> added mcText.alpha = 1; (it's alpha 0 on the stage)... and that worked...
> so
> I know the doc class is wired to the stage instance. (BTW: AS3 settings,
> "Auto declare stage instances" : unchecked....) so we're all good
>
> Now the fun part: paste the same Animator code into the constructor,
> verifying the correct instance name on the stage -- (making sure to execute
> the play method... duh) and the animation *does not play*.
>
> Then I stumbled on this from :
>
> http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/motion/Animator.html
>
> "If you plan to call methods of the Animator class within a function,
> declare the Animator instance outside of the function so the scope of the
> object is not restricted to the function itself. If you declare the
> instance
> within a function, Flash Player deletes the Animator instance at the end of
> the function as part of Flash Player's routine "garbage collection" and the
> target object will not animate."
>
> So that's it! The animator instance must be a global member to the class...
> and presto! It works.
>
> Hope this helps others...
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders