FORUMS: list search recent posts

enabled = false; aint working across .swfs

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Andrew Williamson
enabled = false; aint working across .swfs
on Dec 19, 2008 at 7:20:17 pm

Hi all,

Im working on a site that was originally build by someone else, who is unable to complete and so have been finishing it off and doing revisions, etc.

I am having a problem to do with buttons. The way the site currently works is there is a main.swf that loads first and other .swfs are loaded into it. This has been done (I assume) because there are a great number of large animations that are triggered by buttons and it would be too big to do within movieclips or scenes. When a button is pressed the script links to a full frame size .swf that plays over the top of the main.swf. The problem is that the buttons underneath are still clickable through this animation.

The following actionscript has been put into the linked animations:

1st keyframe:
_root.mainMenu.mBtnMc1.enabled = false;
_root.mainMenu.mBtnMc2.enabled = false;
_root.mainMenu.mBtnMc3.enabled = false;

Last keyframe:
_root.mainMenu.mBtnMc1.enabled = true;
_root.mainMenu.mBtnMc2.enabled = true;
_root.mainMenu.mBtnMc3.enabled = true;

But these do not seem to work and the menu buttons are still clickable underneath.

Can I make this code work or is there another way?

One thing I noticed that I hadnt seen before is instead of buttons this guy had just named movieclips and linked them via actionscript in the first keyframe of main.swf. Some I have made buttons for the purpose of rollover animations and kept the same name for the actionscript, but this seems to have changed nothing.

If anyone can help it would be awesome...

Many Thanks,

Andrew




Return to posts index

Pieter Helsen
Re: enabled = false; aint working across .swfs
on Dec 20, 2008 at 7:26:12 pm

Hello Andrew, try either:

_level0.mainMenu.mBtnMc1.enabled = false;
OR
_parent.mainMenu.mBtnMc1.enabled = false;

And buttons are basically movieclips with up, down, over and click states. So just placing movieclips and using them as buttons is a viable strategy :)

Kind regards,
Pieter

General notice: from now on, I would like to ask everyone to put [AS2] or [AS3] (corresponding to the version of actionscript you are using on your project) in front of their post titles when the question is actionscript related! Please help us help you faster. Thank you.


Return to posts index

Andrew Williamson
Re: enabled = false; aint working across .swfs
on Dec 29, 2008 at 3:16:54 am

Hi Pieter,

Many thanks for responding!

I had tried these and seem to get no joy - the buttons are still active underneath the playing .swf. I've tried a fair few variations on this layer addressing too, but to no avail.

Are there any other ways to de-activate the buttons in a roundabout way, e.g. putting a listener to disable buttons when something plays and re-enabling when it stops?

That makes sense re: buttons being movieclips anyway - I'd never seen that approach before, but its interesting and I like it :) I assume a much earlier encarnation of flash didn't have 'button' objects and this was the standard way of doing buttons?

Many Thanks,

Andy

p.s. I'm using AS2.0



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]