I have it solved, thanks to your help. loadedMC = MovieClip(background.content);
var _index:int = NumberUtilities.random (0, loadedMC.numChildren-1, 1); var _target:Object = Object(loadedMC.getChildAt(_index)); animate(_target); --- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote: > > A SWFLoader's .content property is the root of the Flash SWF assuming it > was published for player 9. What is background? > > > > ________________________________ > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of celumbra > Sent: Saturday, March 22, 2008 11:34 AM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] accessing children of flash generated swf > > > > I have a vector graphic that originated in Illustrator, which I then > imported into Flash CS3. I converted the graphic elements to symbols, > linking them to AS3 classes, and exported the swf to load into Flex 3. > > In Flex, when I load the swf into an Image or SWFLoader tag, I can > capture a mouseover event for the individual elements in the graphic, > reading the event.target value just fine and feeding the object to the > functions I want to operate on the individual elements (to apply > filters). > > Now I want to programmatically (and randomly) select the individual > graphic symbols, but can't seem to read them. > > In this sample code, which is not working, "background" holds Flash > swf. background.numChildren returns 1, and I cannot seem to read the > equivalent of background.getSelectedChild(0).numChildren. The > underlying symbols are typed as movie clips, but casting the selected > children as movie clip doesn't seem to help beca > > public function applyRandom():void > > { > var graphicCount:int = background.numChildren > var index:int = NumberUtilities.random (0, graphicCount-1, 1); > var _target:Object; > > _target = Object(background.getChildAt(index)); > applyFilter(_target); > } > > I've installed Flex Component for Flash CS3 and pulled the individual > components into Flex, but even if I re-composed the graphic by moving > the individual symbols back into place, in my initial tests, I am > running into the same problem. > > Any suggestions would be greatly appreciated. >