var swf: MovieClip = MovieClip(myloader.content);
var mc: MovieClip = MovieClip(swf.getChildByName("myMC"));
mc.myText = "xxx"; //setter
I'm really hoping there's an easier way...or this gets fixed in the next release.
On 2/8/06, JesterXL <[EMAIL PROTECTED]> wrote:
Have you successfully set a getter/setter property?----- Original Message -----From: Jason Y. KwongSent: Wednesday, February 08, 2006 3:08 PMSubject: Re: [flexcoders] embed a movieclipOk, 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
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service .
--
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
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.