• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Toggle function

Participant ,
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

Hi,

I am using one interface the stage size is 1067 x 600 inside that by using one movieclip am loading the animation files the animation file size is 972.2 x 516.1.i am using one toggle button, when i click toggle button only the animation should be visible that should be in full screen.can any one tell me how to do that.

TOPICS
ActionScript

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

Hi,

I am not able to access the moviclip name

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

my movieclip is in main timeline that i placed in the top right corner of the stage

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 25, 2012 Jul 25, 2012

Copy link to clipboard

Copied

use

DisplayObject(loader.content).your movieclip instance name

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 25, 2012 Jul 25, 2012

Copy link to clipboard

Copied

still i am getting the same error

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 25, 2012 Jul 25, 2012

Copy link to clipboard

Copied

what is that error?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 25, 2012 Jul 25, 2012

Copy link to clipboard

Copied

Scene 1, Layer 'Layer 2', Frame 1, Line 291119: Access of possibly undefined property container through a reference with static type flash.display:DisplayObject.

here container is the moviclip name

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 25, 2012 Jul 25, 2012

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines