SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Wizard aaron.martone's Avatar
    Join Date
    Feb 2003
    Location
    Florida, USA
    Posts
    2,322
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Flash doesn't behave properly

    I've read SOOO many article on making buttons that I just can't figure out what I'm doing wrong here...

    http://www.aaronmartone.com/test_nav.asp

    For right now just bother with the H (its the only one with functionality) The button's code:

    Code:
    on(rollOver, dragOver){
     _root.hMovie.gotoAndPlay("grow");
    }
    on(release, releaseOutside, rollOut, dragOut){
     _root.hMovie.gotoAndPlay("shrink");
    }
    on(press){
     getURL("home.asp","_top","GET");
    }
    The GROW label is 10 frames that animate the H to grow larger and grow in transparency. The SHRINK label is 10 frames that does just the opposite.

    Notice that if you mouseover the H slowly, it works the first time. The H grows and when you mouse off, the H shrinks. But then if you mouseover again (or faster), it breaks.

    Mousing over the button now does nothing until you mouseoff (which plays the SHRINK animation, making it large and opaque again and animate to the small look. Why isn't the rollOver registering anymore?

  2. #2
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that's similar to my panoramic button found here: http://www.plasmapages.com/PPv2003.html

    but I do mine different: I just create a button with a different MC that plays on up, over and down.

  3. #3
    SitePoint Wizard aaron.martone's Avatar
    Join Date
    Feb 2003
    Location
    Florida, USA
    Posts
    2,322
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hmmm.

    So is it seperate MCs for each state of the button, or are they different labels in 1 MC that are played dependant on the button's state?

  4. #4
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mine are all just different MCs.

  5. #5
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is this for MX? I am thinking you could get a more accurate animation, using just enterframe event handler and chaning the _xscale and _yscale properties. Now the font I picked is kinda messy so when you look at it thats why the animation looks choppy, but I think you are using an image anyways so you won't have the problem. Also you can reuse the functions for all of your buttons. So you don't have to code each one individually.

    http://www.irq11.com/~louie/animated.html

    The actionscript
    Code:
    myClip.onRollOver = function() {
     this.onEnterFrame = growLetter;
    }
    myClip.onRollOut = function() {
     this.onEnterFrame = shrinkLetter;
    }
    function shrinkLetter() {
     if(this._xscale > 100) {
      this._xscale = this._yscale -= 10; 
     }
     else {
      this._xscale = this._yscale = 100; 
      delete this.onEnterFrame;
     }
    }
    function growLetter() {
     if(this._xscale < 200) {
      this._xscale = this._yscale += 10; 
     }
     else {
      this._xscale = this._yscale = 200; 
      delete this.onEnterFrame;
     }
    }

  6. #6
    runat="server" Golgotha's Avatar
    Join Date
    Nov 2001
    Location
    Colorado
    Posts
    2,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and freddy proves why he is da man, I like this way, but I may add a Math.round in there to keep the pixels whole numbered? may make it smoother looking- just a hunch?

    hey freddy could you give us a side-by-side with one with Math.round and one without and see if it's any smoother?

  7. #7
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well since I am using just a text field, thats why it looks choppy, if I make it an image first watch.

    http://www.irq11.com/~louie/animated.html


Bookmarks

Posting Permissions

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