Have you successfully set a getter/setter property?
 
----- Original Message -----
Sent: Wednesday, February 08, 2006 3:08 PM
Subject: Re: [flexcoders] embed a movieclip

Ok, I found something interesting about this.  You can actually access properties in the loaded swf but trying to call a function messes up.  The function is actually there, but it isn't recognized as a function.  For example, my Flash8 swf has a function named "callMe".  I load this into my Flex2 app and then trace " swf.callMe" and I actually get "[object Object]".  But if try to call it via swf.callMe(), I get a runtime error: Call attempted on an object that is not a function.

Ironically, you can actually access getter/setter functions.  Since they're considered properties, I guess they're good to go.  It's a useable workaround at this point.


On 2/8/06, Jason Y. Kwong <[EMAIL PROTECTED]> wrote:
I'm actually trying to do something similar.  What I've found so far should be able to help you.  You need to load the SWF via the Loader component and then use its content property:

<mx:Loader id="myloader" source=" SimpleSWF.swf" complete="onComplete()"/>

private function onComplete(): void
{
   var swf: MovieClip = MovieClip(myloader.content);
   swf.gotoAndPlay(...);
}

My problem is that I can't access additional methods/properties that are declared in the loaded swf.  I've seen a Flex 1.5 example where you can just go ahead and call those methods on the MovieClip instance, but that doesn't seem to work in Flex 2.  I've tried casting it to an Object to get around the compiler, but I just end up with a runtime error.



On 2/8/06, nacho < [EMAIL PROTECTED]> wrote:
what I want to do is load a .SWF file and control the timeline of this movieclip, with gotoAndPlay, etc...
but i don't know how to load it




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to