Skip to main content
Inspiring
May 25, 2007
Answered

Disable or remove button / movie clip

  • May 25, 2007
  • 7 replies
  • 801 views
Hi - I am hoping this is possible - I have an actionscript controlled gallery of thumbnails that scrolls across so far to reveal a group of six thumbs... easiest way to explain is to just show you...

http://www.weensyweb.com/womad/GalleryMay07/

what i need to do is disable the "forward" or "back" arrows as they become unneccesary.. they are buttons within MCs, actioning a mc containing the thumbs, using the following script:

on (press) {
if (this._parent.main.targetx<=-200) {
this._parent.main.targetx += 495;
this._parent.main.targety = 410.4;
} else {
(this._parent.main.targetx -= 0);
}
}

At the very beginning of the movie, you can see that the "back" arrow is still selectable and clickable, even though there is nowhere for the scrolling MC to go. Similarly at the end of the gallery, the "forward" arrow becomes obselete, although still retains it's rollover stat and selectability.

Thanks in advance.
This topic has been closed for replies.
Correct answer fire orchid
w00tz

http://www.weensyweb.com/womad/GalleryMay07/

check out my funky forward and back buttons too :)

thankyou!!!!


on the thumbs MC itself i put this :

onClipEvent (load) {
targetx = 3.5;
targety = 410.4;
setProperty(this._parent.backClip, _alpha, "30");
this._parent.backClip.backBUT.enabled = false;
}
onClipEvent (enterFrame) {
xdiv = ((targetx-this._x)/5);
this._x = (this._x+xdiv);
ydiv = ((targety-this._y)/5);
this._y = (this._y+ydiv);
}


then on the buttons i put this:

on (release) {
if (this._parent.main.targetx<=-200) {
this._parent.main.targetx += 495;
this._parent.main.targety = 410.4;
this._parent.forwardClip.forwardBUT.enabled = true;
setProperty(this, _alpha, "100");
setProperty(this._parent.forwardClip, _alpha, "100");
} else {
(this._parent.main.targetx == 0);
this.backBUT.enabled = false;
setProperty(this, _alpha, "30");
}
}

7 replies

fire orchidAuthorCorrect answer
Inspiring
May 25, 2007
w00tz

http://www.weensyweb.com/womad/GalleryMay07/

check out my funky forward and back buttons too :)

thankyou!!!!


on the thumbs MC itself i put this :

onClipEvent (load) {
targetx = 3.5;
targety = 410.4;
setProperty(this._parent.backClip, _alpha, "30");
this._parent.backClip.backBUT.enabled = false;
}
onClipEvent (enterFrame) {
xdiv = ((targetx-this._x)/5);
this._x = (this._x+xdiv);
ydiv = ((targety-this._y)/5);
this._y = (this._y+ydiv);
}


then on the buttons i put this:

on (release) {
if (this._parent.main.targetx<=-200) {
this._parent.main.targetx += 495;
this._parent.main.targety = 410.4;
this._parent.forwardClip.forwardBUT.enabled = true;
setProperty(this, _alpha, "100");
setProperty(this._parent.forwardClip, _alpha, "100");
} else {
(this._parent.main.targetx == 0);
this.backBUT.enabled = false;
setProperty(this, _alpha, "30");
}
}
Inspiring
May 25, 2007

re-enabeling a button should be the task of the other button.

clicking left wil eventually disable that button (can't go any further),
clicking right once after left is disabled should enable left again.

Manno

fire orchid wrote:
> this sort of works...
>
> on (release) {
> if (this._parent.main.targetx<=-200) {
> this._parent.main.targetx += 495;
> this._parent.main.targety = 410.4;
> this.backBUT.enabled = true;
> } else {
> (this._parent.main.targetx -= 0);
> this.backBUT.enabled = false;
> }
> }
>
> but it remains disabled..?
>
> what am i missing here please?
>
>


--
aloft
Hoge der A 20a
9712AD Groningen
The Netherlands
info@aloft.nl
http://www.aloft.nl
tel: 06-22360652
KVK: 02094451
Bnk: 21.23.89.408
Inspiring
May 25, 2007
quote:

Originally posted by: Newsgroup User

re-enabeling a button should be the task of the other button.



ahhh... :)

thankyou - now i will try and change the colour or alpha so taht it looks like it is not enabled as well as being not enabled - that shouldn't be too hard - thanks :)
Inspiring
May 25, 2007
this sort of works...

on (release) {
if (this._parent.main.targetx<=-200) {
this._parent.main.targetx += 495;
this._parent.main.targety = 410.4;
this.backBUT.enabled = true;
} else {
(this._parent.main.targetx -= 0);
this.backBUT.enabled = false;
}
}

but it remains disabled..?

what am i missing here please?
Inspiring
May 25, 2007
have tried it like this:

on (press) {
if (this._parent.main.targetx<=-200) {
this._parent.main.targetx += 495;
this._parent.main.targety = 410.4;
} else {
(this._parent.main.targetx -= 0);
}
if (this._parent.main.targetx>=-200) {
this.backClip.enabled = false;
}
}


but that doesn't work... :(

sorry - and thanks...
Inspiring
May 25, 2007
use the .enabled property.

maxLength = 100;
if (maxLength=100){
arrow_btn.enabled = false;
}
Inspiring
May 25, 2007
quote:

Originally posted by: cpgenius
use the .enabled property.

maxLength = 100;
if (maxLength=100){
arrow_btn.enabled = false;
}


thankyou :)

so this goes on the button itself, or on the mc containing the button?
Inspiring
May 25, 2007

Hi fire,

check the enabled property of Buttons and movieClips, they remain
visible but will lose interactivity.

HTH,
Manno



fire orchid wrote:
> Hi - I am hoping this is possible - I have an actionscript controlled gallery
> of thumbnails that scrolls across so far to reveal a group of six thumbs...
> easiest way to explain is to just show you...
>
> http://www.weensyweb.com/womad/GalleryMay07/
>
> what i need to do is disable the "forward" or "back" arrows as they become
> unneccesary.. they are buttons within MCs, actioning a mc containing the
> thumbs, using the following script:
>
> on (press) {
> if (this._parent.main.targetx<=-200) {
> this._parent.main.targetx += 495;
> this._parent.main.targety = 410.4;
> } else {
> (this._parent.main.targetx -= 0);
> }
> }
>
> At the very beginning of the movie, you can see that the "back" arrow is still
> selectable and clickable, even though there is nowhere for the scrolling MC to
> go. Similarly at the end of the gallery, the "forward" arrow becomes obselete,
> although still retains it's rollover stat and selectability.
>
> Thanks in advance.
>