5/29/2010 10:33:01 AM
Title:
Access document class from Flash to Flex
Hi,
I have created an application in Flash as3 platform. But I want to load it in Flex now, but it’s not working.
can anybody suggest me anything?
How can I access document class from flash to Flex?
Thank you,
Sachin
<mx:Script>
<![CDATA[
private var loadedSWFMainTimeline:*;
private var animhorse_mc:MovieClip;
private function init():void
{
loadedSWFMainTimeline.sendURL();
}
private function onAnimhorseSWFCompleted(event:Event):void
{
// get a reference to the main timeline
loadedSWFMainTimeline = animhorseSWF.content;
loadedSWFMainTimeline.mainObject;
}
]]>
</mx:Script>
5/29/2010 10:58:22 AM
you need to cast it to movieclip first
myLoader = new Loader();
myLoader.load(swfURLRequest);
myLoader.name = "UIContainer"
myLoader.contentLoaderInfo.addEventListener(Event .COMPLETE , swfLoaded);
function swfLoaded(evt:Event){
if(myLoader.content){
addChild(myLoader);
}
var myLoadedMovie:MovieClip = myLoader.content as MovieClip;
}
5/29/2010 11:33:51 AM
you cannot access the document class from flash to flex. Its flex framework class which cannot be recognized by flash environment. You can use local connection to communicate between the loaded and the parent file.