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

Accessing buttons on main stage from inside of a movie clip

New Here ,
May 14, 2011 May 14, 2011

Copy link to clipboard

Copied

Greetings...

      here is the scenario:

             - I have buttons on main stage, and a swf file which is loaded to scene using a LOADER in AS3

             - this is a website, so the problem rises when user moves its cursor around the page and now  buttons in main stage,

                are still active since they are behind the loaded swf file.

             - i would like to learn, how can i CODE inside the loaded SWF file, to either remove the buttons in main page, or remove

                the event listeners. not sure if my case has anything to do with .Parent or .roo, (I want to access those main stage

                buttons from the SWF file which is loaded)

             - The general case is, i have SWF files loading inside another SWF files, is it possible to access items on each stage from

                inside of loaded SWF files on that specific stage. Similarly i would be interested to learn about accessing main stage from inside

                of movieclips running on stage. how can i access something not in present FLA file yet, in FLA file that is loading the page as SWF.

                Thanks.

TOPICS
ActionScript

Views

601

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
Guest
May 14, 2011 May 14, 2011

Copy link to clipboard

Copied

I think this will help you

function btnMC(event:MouseEvent):void {
MovieClip(parent).main_mc.gotoAndStop(1);

or
MovieClip(parent).gotoAndStop("page1");

}

btn.addEventListener(MouseEvent.CLICK, btnMC);

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
New Here ,
May 14, 2011 May 14, 2011

Copy link to clipboard

Copied

Thanks...

i tried the code, still gives me errors, i think your suggestion will work perfectly for the movieclip scenario, i tried to explain my question in a simpler way in another post. Thanks though.

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
LEGEND ,
May 14, 2011 May 14, 2011

Copy link to clipboard

Copied

If you load an swf into another using the Loader class, then the Loader itself is the parent of the loaded swf., so MovieClip(parent.parent) might help you to target the timeline that the Loader was born from.  The more proper way to have a loaded file talk to a parent file is thru dispatching events that the parent assigns listeners for after the file has loaded.  Here's a link to a posting that might help explain how to implement this.

http://forums.adobe.com/thread/470135?tstart=120

As for the buttons that you want to disable, you could either use the removeEventListener() method to remove the listeners you have assigned, or you could set their mouseEnabled property to false, or you could set their visible property to false.

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
New Here ,
May 14, 2011 May 14, 2011

Copy link to clipboard

Copied

LATEST

Amazing....i m reading comments on the link you provided. thanks. i need to educate myself alittle bit about dispatchEvent and other commands explained in the discussion, let me try my best and i will post my codes along with errors in case i fail. Thank you

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