A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: linking event functions together

  1. #1
    Senior Member
    Join Date
    May 2000
    Posts
    814

    linking event functions together

    I'm attempting to create a gallery viewer similar to the Apple on here:
    http://www.apple.com/ipad/

    Where the slide indicators are linked with the forward and back arrow controls.

    What i have is my forward and back arrows controlling the content, newsHolder MC.

    I also have the dot indicators controlling the newsHolder MC correctly.

    But what i can't figure out is how to link the forward and back arrows to sync with the dot indicators?


    PHP Code:
    function dotPressHandler (e:Event):void {
        
        
    changeIt(e.currentTarget.id);
        

    //current selection history code
            
    if (currentButton) {  
            
    TweenMax.to(currentButton.dotCenter0.25, {removeTint:trueease:Expo.easeOut});
            
    locked true;
            
    currentButton.mouseEnabled true;  
            }  
            
            
    currentButton e.currentTarget as MovieClip;
            
    TweenMax.to(currentButton.dotCenter0.25, {tint:0xFF0000ease:Expo.easeOut});
            
    locked false
            
    currentButton.mouseEnabled false;

    }



    function 
    changeIt(pict:Number):void {
    trace(pict);
    TweenMax.to(newsHolder0.5,{ x:-(pict newsWidth), ease:Expo.easeOutonComplete:unlockTween});

    }



    function 
    fwdHandler (e:Event):void {
        
        if (
    lockStrip == false) { 
            
    lockStrip true;
            
    newsCurrentX newsHolder.x;
            
    newsNewX newsCurrentX newsWidth;

            
    TweenMax.to(newsHolder0.5,{ x:newsNewXease:Expo.easeOutonComplete:unlockTween});

            }
        
            
    }
            
    function 
    bckHandler (e:Event):void {

        if (
    lockStrip == false) { 
            
    lockStrip true;
            
    newsCurrentX newsHolder.x;
            
    newsNewX newsCurrentX newsWidth;

            
    TweenMax.to(newsHolder0.5,{ x:newsNewXease:Expo.easeOutonComplete:unlockTween});
            }
            

        
    }



    function 
    unlockTween():void {
          
    lockStrip false;


  2. #2
    Senior Member
    Join Date
    May 2000
    Posts
    814
    still stuck

  3. #3
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Your dots and your arrows should both eventually call the same method to do the selection. That method should ensure that all the controls are in sync.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center