alexandre_lab
11-03-2005, 02:30 PM
hello,
Geeze, i'm having a hard time with flash today :)
More precisely, i'm having a hard time solving this:
i have an Mc "lang_rollover_mc" with 2 frames.
the Mc has the following script :
this.lang_rollover_mc.onRollOver = function(){
this.gotoAndStop(2);
}
this.lang_rollover_mc.onRollOut = function(){
this.gotoAndStop(1);
}
on Frame 2 of that mc, i generate 4 language buttons, and i'm trying to attach onRollover, onRollOut events to these buttons, but it does not work, it seems that the parent mc onRollover event is overlapping.
any idea what i should do to make this work? Animated gifs ? :-)
The buttons are generated (i can see their label) but the rollover does not do anything visible. And the "trace" action is not triggered either.
for (i=0; i<_global.lang.length; i++)
{
var my_button_mc:String = _global.lang[i][0]+"_butt";
var ypos:Number = 5;
var xpos:Number = 5+i*60;
var butt:MovieClip = this.attachMovie("lang_button", my_button_mc, this.getNextHighestDepth(), {_width:60, _x:xpos, _y:ypos});
// sets the buttons' label
butt.myLabel.text = _global.lang[i][1];
butt.myLabel.setTextFormat(_parent.labelTxt_fmt);
butt.chooseLang_txt = _global.lang[i][2];
butt.lang = _global.lang[i][0];
//sets the button"s behaviors
this.myButton.onRollOver = function()
{
trace("hi "+this.lang);
this.myLabel.setTextFormat(_parent.rollOverTxt_fmt );
bot_txt.text = butt.chooseLang_txt;
bot_txt.setTextFormat(_parent.speakbox_fmt);
//trace (this._parent.bot_txt._name);
};
this.myButton.onRollOut = function()
{
this.myLabel.setTextFormat(_parent.labelTxt_fmt);
};
this.myButton.onRelease = function()
{
_global.desiredLang = this.lang;
// remove buttons
for (i=0; i<_global.lang.length; i++)
{
var my_button_mc:String = "this."+_global.lang[i][0]+"_butt";
eval(my_button_mc).removeMovieClip();
}
};
}
Geeze, i'm having a hard time with flash today :)
More precisely, i'm having a hard time solving this:
i have an Mc "lang_rollover_mc" with 2 frames.
the Mc has the following script :
this.lang_rollover_mc.onRollOver = function(){
this.gotoAndStop(2);
}
this.lang_rollover_mc.onRollOut = function(){
this.gotoAndStop(1);
}
on Frame 2 of that mc, i generate 4 language buttons, and i'm trying to attach onRollover, onRollOut events to these buttons, but it does not work, it seems that the parent mc onRollover event is overlapping.
any idea what i should do to make this work? Animated gifs ? :-)
The buttons are generated (i can see their label) but the rollover does not do anything visible. And the "trace" action is not triggered either.
for (i=0; i<_global.lang.length; i++)
{
var my_button_mc:String = _global.lang[i][0]+"_butt";
var ypos:Number = 5;
var xpos:Number = 5+i*60;
var butt:MovieClip = this.attachMovie("lang_button", my_button_mc, this.getNextHighestDepth(), {_width:60, _x:xpos, _y:ypos});
// sets the buttons' label
butt.myLabel.text = _global.lang[i][1];
butt.myLabel.setTextFormat(_parent.labelTxt_fmt);
butt.chooseLang_txt = _global.lang[i][2];
butt.lang = _global.lang[i][0];
//sets the button"s behaviors
this.myButton.onRollOver = function()
{
trace("hi "+this.lang);
this.myLabel.setTextFormat(_parent.rollOverTxt_fmt );
bot_txt.text = butt.chooseLang_txt;
bot_txt.setTextFormat(_parent.speakbox_fmt);
//trace (this._parent.bot_txt._name);
};
this.myButton.onRollOut = function()
{
this.myLabel.setTextFormat(_parent.labelTxt_fmt);
};
this.myButton.onRelease = function()
{
_global.desiredLang = this.lang;
// remove buttons
for (i=0; i<_global.lang.length; i++)
{
var my_button_mc:String = "this."+_global.lang[i][0]+"_butt";
eval(my_button_mc).removeMovieClip();
}
};
}