attachMovie only applies to Flash Player 8 and below. Flash Player 9 has a totally different mechnism. Thus, attachMovie has nothing to do with Flex 2. Flex 1.5 & 1, it does.
attachMovie is a boilerplate operation. It takes a MovieClip and places an instance of it on a timeline. Scope in Player 8 is defined by timelines. So, _root.attachMovie will attach it to the _root, and my_mc.attachMovie will add it as a child of my_mc for example. Typically, you edit Symbols (MovieClip, Button, Graphic) in the Flash IDE, and give them "linkage names". If a MovieClip does not have a linkage name, it cannot be attached. Even if a MovieClip has a linkage name, it will not be exported in the SWF unless the compiler sees it being used somewhere, or you export it in first frame. With the advent of Flash Player 6, we had the Object.registerClass method. This allowed you to associate a MovieClip symbol's name (linkage) with a class. That way, as soon as you did an attachMovie, you were not only attaching a MovieClip, but that MovieClip also had all the methods & properties of the class. This only worked well if the class extended MovieClip (or it's super class did). We also got initclip for intialization order. Flex 1.5 & 1 handled linkage names nicely. You can write a class, extend some MovieClip or UIObject, and the Flex compiler would handle all the construction mess for you. <view:MyClass /> would auto-magically get built; it was really nice. Symbol names have a 64 character limit, and I think class names have some weird limit too. For assets, the Flex compiler would auto-generate ID's for images and other embedded assets via the __Package namespace. More info: http://www.peterjoel.com/blog/index.php?archive=2004_01_01_archive.xml#107550841406346131 http://swfoo.com/archives/000054.html All of this is meaningless in Flash Player 9, and none of the above should you care about unless you're nostalgic or an f'n geek. ----- Original Message ----- From: "G" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Sunday, July 23, 2006 3:56 PM Subject: [flexcoders] How does attachMovie work? Could someone explain to me, please, in detail, how attachMovie works? I understand loadMovie--I can actually get it to "do" something. But I have never been able to get attachMovie to do anything. Actual simple examples would be wonderful. Thank you! (It's the relationship between a mc's link library and flex/AS that I can't figure out. Any additional insights on that topic would be appreciated as well.) Thank you! __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links ------------------------ Yahoo! Groups Sponsor --------------------~--> Check out the new improvements in Yahoo! Groups email. http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/nhFolB/TM --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

