> do you mean that now, i can use the id upDownMC the same way i could > attach a symbol? No, your symbol has only been embedded in your flex app not attached to any container. You still need to use recommended ways(using methods of View or UIObject class) to add children to a container.
For example: ##Embed_AS_Test.mxml## <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"> <mx:Script> <![CDATA[ [Embed(source="skins/OPSkin.swf", symbol="upDownMC")] var upDownMC:String function onAppInit() { //add the child to Hbox, not first argument is linkageID or symbolName (in flex world) _hbox.createChild(upDownMC, "upDownMC"); } ]]> </mx:Script> <mx:Hbox id="_hbox" /> </mx:Application> Please note, attachMovie(..) is not recommended in Flex app. Use the methods of View or UIObject to add/attach children to containers... Hope that helps, -abdul -----Original Message----- From: Fabrice closier [mailto:[EMAIL PROTECTED] Sent: Thursday, March 17, 2005 7:58 PM To: [email protected] Subject: Re: [flexcoders] attach/createObject do you mean that now, i can use the id upDownMC the same way i could attach a symbol? fabrice On 17-mrt-05, at 15:17, Abdul Qabiz wrote: > > Hi Fabrice, > > Embed metadata works on compile time, right way of doing is: > > [Embed(source="skins/OPSkin.swf", symbol="updownMC")] > var upDownMC:String > > > updownMC symbol would be embedded in your flex app and linkageID would > be > assigned to updownMC variable declared below the metadata tag.... > > > Does that help you? > > -abdul > > > -----Original Message----- > From: Fabrice closier [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 17, 2005 7:24 PM > To: [email protected] > Subject: [flexcoders] attach/createObject > > > Hi All, > i'am new to this list and new to Flex. > i'am a Flash developer and i get a bit confused by the way Flex works. > > I would like to achieve the following. > > in Flash using the attachMovie you directly fill a movieclip container > with a linked symbol from the library. > in Flex i have a class building a container. > i would like to be able to do the following in the class > > container --> attachMovie located in an external swf > > i saw the embed tag, where you can add an external image or swf into a > container. > > in mxml this one works > <mx:Image source="@Embed('skins/OPSkin.swf#updownMC')" id="updown" /> > this displays the symbol on stage. > > this in a script tag doesn't work... acoording to documentation it > should.... > <mx:Script> > <![CDATA[ > function attach() > } > [Embed('skins/OPSkin.swf#updownMC')] > var updownMC:String; > // traces undefined > } > ]]> > </mx:Script> > i'am sure i'am missing something somewhere.... > > and how do i use this synthax from a class? using createObject()? > > Any help would be more than welcome. > Fabrice > > > > > Yahoo! Groups Links > > > > > > > > > > > Yahoo! Groups Links > > > > > > > Yahoo! Groups Links

