A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Changing Alpha on Rollout

  1. #1
    Heaven is made
    of 1's and 0's
    Eyenovation's Avatar
    Join Date
    Feb 2001
    Location
    So. California
    Posts
    1,851

    Changing Alpha on Rollout

    I have a a movie clip running on mouseover, but I would like to use Actionscropt to fade the alpha to zero upon rollout. I believe this would be done using setProperty, but I'm not quite sure how to create the easing effect or 'tweening' effect. Can anyone please lend any assistance?

    Thanks!~

  2. #2
    Senior Member
    Join Date
    Mar 2003
    Location
    127.0.0.1
    Posts
    154
    theres pretty much one way to do it, but a bunch of ways to implement it. when i write the code i usually throw ALL of the code in the first frame of the timeline.......anyways it would look something like this:

    Code:
    movieclip.onRollOut = function()
    {
    	this.onEnterFrame = function()
    	{
    		this._alpha -= 10; 
    		//the 10 = however much you want 
    		//it to decrease every frame
    		if (this._alpha <= 0)
    			this.onEnterFrame = null;
    	}
    }
    basically its not that complicated to figure out, that IF statement is just in there for efficiency reasons so that once the object is gone is doesnt keep descreasing the alpha which is already at zero. that should work for you. [keep in mind i dont have flash infront of me so i may very well have typed out the "onRollOut" function name wrong or something simple like that........just try it out]

    remember this is for implementation in the first frame of a timeline...if you want to put it in the obj there are some minimal changes required.

  3. #3
    Flashkit Veteran joejoe2288's Avatar
    Join Date
    Apr 2004
    Location
    Hickville, Oregon
    Posts
    2,554
    eyenovation what have you been doing for your last 2000 posts???
    So tired of all the fighting....

    http://joejoe2288.kawanda.net

  4. #4
    Heaven is made
    of 1's and 0's
    Eyenovation's Avatar
    Join Date
    Feb 2001
    Location
    So. California
    Posts
    1,851
    Quote Originally Posted by joejoe2288
    eyenovation what have you been doing for your last 2000 posts???
    Because I have 2000 posts, I'm supposed to be an actionscript expert or something? I could have 20,000 and if I didn't know something I'd be humble enough to ask.

  5. #5
    Flashkit Veteran joejoe2288's Avatar
    Join Date
    Apr 2004
    Location
    Hickville, Oregon
    Posts
    2,554
    Sorry if it seemed like i was hindering you, that truely wasn't my intention. I was simply wondering how you had 2000 posts, I would think that is a common enough question you would have viewed it in a different post. Obviously i was mistaken and I apologize and in no way was I questioning your intelligence.
    So tired of all the fighting....

    http://joejoe2288.kawanda.net

  6. #6
    Heaven is made
    of 1's and 0's
    Eyenovation's Avatar
    Join Date
    Feb 2001
    Location
    So. California
    Posts
    1,851
    No offense taken by any means. I did try the search function but it's difficult to search when you're not sure what 'term' to search for. As always many thanks to the community for helping me.

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