dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: easy question for you guys

  1. #1
    2008 Man of the Year JWin's Avatar
    Join Date
    Aug 2005
    Location
    here
    Posts
    768

    easy question for you guys

    OK I've got an animated drop down menu and instead of doing this the noob way I'm trying to use actionscript. Now when the menu retracts I want it when you mouse over to go to the frame corresponding to the same place on when the menu is coming out (if that makes any sense).

    There are 30 frames in the menu animation, 1-15 are dropping down, 16-30 are coming back. When you mouse out it starts retracting if you mouse back over at 27 it should go to frame 3 and play. here's my code :

    Code:
    frame = Math.abs(30 - _currentframe)
    
    hitarea.onRollOver = function () {
         trace(frame)
         gotoAndPlay(frame)
    }
    that is in a keyframe at frame 16 there is a stop on frame 15. Is the problem in the math? cause it just out puts 14 every time and goes to and plays 14 no matter when I roll over

    thanks in advance

    SAMedia Blog (general bs) :: jwinmedia (my music site)
    "Think of an advertisement where the product you're marketing is Jesus!"
    -From a work for hire ad

  2. #2
    Senior Member
    Join Date
    Apr 2006
    Posts
    1,059
    why dont you just have the animation reverse to pull the menu back up

    if(not mouseOver){
    gotoAndStop(_currentFrame-1)}

  3. #3
    Senior Member RangrJay's Avatar
    Join Date
    Sep 2005
    Location
    Las Vegas
    Posts
    163
    could you post your fla....if your doing what i'm thinking, you don't need any more then 2 or 3 keyframes, and the effect will all be done in AS.
    Xero Patience Studios
    Web Design
    Software Development
    Graphic/Logo Design

  4. #4
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    frame = Math.abs(30 - _currentframe) is only being set once and is not reset at any point in your above code ..hence frame will always have the same value .. yep best bet is post ur fla

    but anyway delete frames 16-30 and see how this works:

    Code:
    hitarea.onRollOver = function () {
    	delete _root.onEnterFrame;
        _root.onEnterFrame = function(){
    		hitarea.nextFrame();
    		if(hitarea._currentframe == 15){
    			delete this.onEnterFrame;
    			}
         }
    }
    
    hitarea.onRollOut = function () {
    	delete _root.onEnterFrame;
        _root.onEnterFrame = function(){
    		hitarea.prevFrame();
    		if(hitarea._currentframe == 1){
    			delete this.onEnterFrame;
    			}
         }
    }
    Last edited by silentweed; 05-31-2006 at 03:11 PM.
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  5. #5
    2008 Man of the Year JWin's Avatar
    Join Date
    Aug 2005
    Location
    here
    Posts
    768
    here it is functioning pretty much the way its supposed to but not the way I want it to. This doesn't include my (non functioning) retract script.

    ./edit
    i don't know why its 900 kb I deleted everything but anyway here it is off my server
    http://www.jwinmedia.com/misc4/dropdown.fla
    Last edited by JWin; 05-31-2006 at 03:12 PM.

    SAMedia Blog (general bs) :: jwinmedia (my music site)
    "Think of an advertisement where the product you're marketing is Jesus!"
    -From a work for hire ad

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