PDA

View Full Version : having trouble with tween mx.transitions.Tween


this_end_up
07-25-2008, 08:45 PM
Hey guys.

I have a website that calls content(which are in the library) into layers using mx.transitions.Tween.

The original designer used this script to show the content using Strong.easeOut. Originally there were five layers of text, all in the same frame number. The first frame has a continue/back button to reveal additional content. The rest of the layers have just one "page" of text (no continue/back button).

When I click on the sub-navigation, the new content fades in.

Now, I need to add more content to the each of the other layers so that each section will utilize the continue/back button. Here is where problems lie. If I replicate the continue/back and place it into each of the other layer content, everything looks good until I try to click on the continue/back buttons on either of the layers. Only one works...which is the highest layer within the frame. I tried to use scrollPane, other buttons, with no success.

I was wondering if anyone can help by looking at my code and telling me the best route...I have thought about placing each section into a single library instance, where each section and its "second page" is in its own frame/timeline.

Below is what I am calling from my library:
-services_btn0
-services_btn1
-services_btn2
-services_btn3
-services_btn4
-servicestxt0
-servicestxt1
-servicestxt2
-servicestxt3
-servicestxt4


And below is the code:
stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;
_quality = "BEST";

hideText = function(){
for(i=0;i<5;i++){
this["services_txt"+i]._alpha = 0;
}
}

hideText();

createServicesSub = function(){
buttonNum = 5;
for(i=0;i<buttonNum;i++){
this["services_btn"+i].clicked = false;
this["services_btn"+i].pageVar = i;
this["services_btn"+i].onRollOver = function(){
if(this.clicked != true){
this.gotoAndStop("highlight");
}
}
this["services_btn"+i].onRollOut = function(){
if(this.clicked != true){
this.gotoAndStop("off");
}
}
this["services_btn"+i].onRelease = function(){
hideText();
resetButtons();
this.gotoAndStop("on");
this.clicked = true;
new Tween(this._parent["services_txt"+this.pageVar], "_alpha", Strong.easeOut, this._parent["services_txt"+this.pageVar]._alpha, 100, .25, true);
}
}
}

resetButtons = function(){
for(i=0;i<buttonNum;i++){
this["services_btn"+i].gotoAndStop("off");
this["services_btn"+i].clicked = false;
}
}

createServicesSub();

services_btn0.gotoAndStop("on");
services_btn0.clicked = true;
new Tween(services_txt0, "_alpha", Strong.easeOut, services_txt0._alpha, 100, 1, true);

Thanks

gnomeontherun
07-29-2008, 05:18 AM
I think we will need to see the FLA file on this one. I'm not completely sure I understand what the design is without seeing the file. Can you post it?