Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2007
    Posts
    77
    Thanks
    0
    Thanked 0 Times in 0 Posts

    having trouble with tween mx.transitions.Tween

    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

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    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?
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •