Topic: disable button on active SVmovie
Hi,
I am finishing my SV 1.9 integration in my Flash as2 website. I have embedded it in Flash, like the example given in the software I bought.
One thing. I would like to disable the button1 that loaded the active gallery1. So that it (button1) is not selectable while viewing gallery1, and reloading is not possible.
To do so I add a function to the onrelease code: button1.enabled = false, so it disables itself after the loadGallery(1) is executed. Works fine. Switching to gallery2 requires the 'disabled' button1 to be enabled and the new button2 to be disabled. Now I thought enabling any button could be done with adding the following code to every button:
Button.prototype.enabled = true;
But that does not work. I thought that maybe the code was misplaced, so I tried changing it to
Button.prototype.enabled = false;, which DOES immediately disable all buttons
Can this prototype never be "true" (and should always be false?) or am I missing something.
I use the following code, (fat code is what I have added to the standard SV code):
----------------------------------------------------------------------
Stage.align = "TL";
Stage.scaleMode = "noScale";
_global.SVStageWidth = 860;
_global.SVStageHeight = 590;
var galleryId:Number;
var mLoader_mcl = new MovieClipLoader();
mLoader_mcl.addListener(this);
bt_gallery1.onRelease = function(){
loadGallery(1);
Button.prototype.enabled = true;
bt_gallery1.enabled = false;
}
bt_gallery2.onRelease = function(){
loadGallery(2);
Button.prototype.enabled = true;
bt_gallery2.enabled = false;
}
function loadGallery(galId){
galleryId = galId
mLoader_mcl.loadClip("viewer.swf",mc_svloader);
}
function onLoadInit(){
_root.xmlDataPath = "gallery"+galleryId + ".xml";
}
loadGallery(1);
bt_gallery1.enabled = false;
----------------------------------------------------------------------
Hope someone can help me out,
Cheers, Pete