My ActionScript not working! When published works in Flash 6 not in Flash 8~
I have this file which I created from http://www.tutorialized.com/tutorial...entation/11499 where the actionscript works in Flash Player 6 but when I publish into Flash player 7 or 8 it does not seem to want to play.
It gets a pop up message stating:
"A script in this movie is causing Flash Player to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort?"
My purpose to get this working in Flash 8 is because I need to incorporate CSS Stylesheets externally.
Here is the following actionscript:
stop();
numberOfTabs = 3;
for (i=1; i<=numberOfTabs; i++) {
line = eval("tab"+i);
line.onRelease = function() {
for (i=1; i<=numberofTabs; i++) {
otherTabs =
eval("this._parent.tab"+i);
otherTabs.bottomLine._visible =
true;
}
this.bottomLine._visible = false;
contentFrame = Number (this._name.substr(3,
1));
this._parent.contents.gotoAndStop(contentFrame);
}
}
tab1.bottomLine._visible = false;
tab1.onPress = function() {
gotoAndStop("tab1");
};
tab2.onPress = function() {
gotoAndStop("tab2");
};
tab3.onPress = function() {
gotoAndStop("tab3");
};
How does it need to be changed?
Also, good eyes Can, i didn't see that case issue.
(the strict typing is just in there because its good practise)
var numberOfTabs:Number = 3;
for (i=1; i<=numberOfTabs; i++) {
var line:String = eval("tab"+i);
line.onRelease = function() {
for (j=1; j<=numberofTabs; j++) {
otherTabs = eval("this._parent.tab"+i);
otherTabs.bottomLine._visible = true;
}
this.bottomLine._visible = false;
var contentFrame:String = this._name.substring(3,1);
this._parent.contents.gotoAndStop(contentFrame);
}
}
tab1.bottomLine._visible = false;
tab1.onPress = function() {
gotoAndStop("tab1");
};
tab2.onPress = function() {
gotoAndStop("tab2");
};
tab3.onPress = function() {
gotoAndStop("tab3");
};
hooked up some strict datatyping and also change "substr" to "substring". To use a start and end point you have to use "substring". for more info read this:
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary698.html
:+)
I will verify my code and check it!
#If you have any other info about this subject , Please add it free.# |
Author:
rose
03 21st, 2010 in
portal.gzui.com
edit