-
1. Re: Toggle function
bhargavi reddy Jul 24, 2012 3:33 AM (in response to lalitha subramanian)You can resize your loaded animated file to stage size as follows:
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadComplete); //Here loader is an instance of Loader to load the animated file.
function loadComplete(e:Event):void
{
loader.content.your animated content.width = 1067;
loader.content.your animated content.height = 600;
or
e.currentTarget.content.your animated content.width = 1067;
e.currentTarget.content.your animated content.height = 600;
}
//Here your animated content means, animated content should be placed on a particular movieclip which has provided by name. You can access that movieclip by
getChildByName("name") in the place of your animated content in the above code.
-
2. Re: Toggle function
lalitha subramanian Jul 24, 2012 10:38 PM (in response to bhargavi reddy)Hi,
I am not able to access the moviclip name
-
3. Re: Toggle function
bhargavi reddy Jul 24, 2012 11:37 PM (in response to lalitha subramanian)loader.content means application's main timeline. Once check you have any parent objects for that movieclip. and also check where you place the movieclip according to the main timeline.
-
4. Re: Toggle function
lalitha subramanian Jul 25, 2012 12:06 AM (in response to bhargavi reddy)my movieclip is in main timeline that i placed in the top right corner of the stage
-
5. Re: Toggle function
bhargavi reddy Jul 25, 2012 1:30 AM (in response to lalitha subramanian)use
DisplayObject(loader.content).your movieclip instance name
-
6. Re: Toggle function
lalitha subramanian Jul 25, 2012 1:59 AM (in response to bhargavi reddy)still i am getting the same error
-
7. Re: Toggle function
bhargavi reddy Jul 25, 2012 2:08 AM (in response to lalitha subramanian)what is that error?
-
8. Re: Toggle function
lalitha subramanian Jul 25, 2012 2:16 AM (in response to bhargavi reddy)Scene 1, Layer 'Layer 2', Frame 1, Line 29 1119: Access of possibly undefined property container through a reference with static type flash.display:DisplayObject. here container is the moviclip name
-
9. Re: Toggle function
bhargavi reddy Jul 25, 2012 2:42 AM (in response to lalitha subramanian)If you really place it on the stage and give it an instance name, the above code is working fine.
Once check with trace statement
trace(loader.content.movieclipname);
If it is undefined means check with your file.
I have one doubt. Here your animation file means, you are trying to load an swf file which contains animation or something else?
If my guess is right (if it is swf) the above code is apt for your program.