header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
sachin
Points:0
Posts:0

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>




1
Terry
Points: 0
Posts:0
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;

}


2
Flash_Guy
Points: 490
Posts:0
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.


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 5+0 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions