Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,691 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,318 people online right now. Registration is fast and FREE... Join Now!




ActionScript Code

 
Reply to this topicStart new topic

ActionScript Code, Help

reyalS
post 20 Sep, 2008 - 10:24 AM
Post #1


New D.I.C Head

*
Joined: 20 Sep, 2008
Posts: 1


My Contributions


I'm just starting actionscript, i have Flash CS3.
My question is that I have a header for a website drew up in Flash.
And I put text and made two layers for text one home_text and home_glow.
I created a tween to make the name glow.
And my question is how would I make the "glow" only show up when the mouse is over the text and not loop stop at the end of tween.

Thanks,
reyalS
User is offlineProfile CardPM

Go to the top of the page

BetaWar
post 20 Sep, 2008 - 03:51 PM
Post #2


#include <soul.h>

Group Icon
Joined: 7 Sep, 2006
Posts: 1,987



Thanked 78 times

Dream Kudos: 1175
My Contributions


Look into events in flash and movieclip properties.
User is offlineProfile CardPM

Go to the top of the page

Kerplope
post 22 Sep, 2008 - 01:19 PM
Post #3


New D.I.C Head

Group Icon
Joined: 22 Sep, 2008
Posts: 6



Dream Kudos: 100
My Contributions


Make two movieclips of the header one with a glow and the other without. If you want the glow movieclip to have an tween you should apply that within the movieclip and place the stop(); action in the last frame of the tween. Then create a new button symbol and on the "up" state place the header movieclip without the glow and on the "over" state place the movieclip with the glow. Make sure that you also put one of the two movieclips in the "hit" state so that flash will know where the rollover should take place.
User is offlineProfile CardPM

Go to the top of the page

pemcconnell
post 23 Sep, 2008 - 08:26 AM
Post #4


D.I.C Regular

Group Icon
Joined: 5 Aug, 2008
Posts: 394



Thanked 35 times

Dream Kudos: 75
My Contributions


or use the following on the glowing movieclip:
CODE

this.onRollOver = function(){ this._alpha = 100; }
this.onRollOut = function(){ this._alpha = 0; }
User is offlineProfile CardPM

Go to the top of the page

DilutedImage
post 24 Sep, 2008 - 07:41 PM
Post #5


D.I.C Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 642



Thanked 6 times

Dream Kudos: 25
My Contributions


A slightly more efficient way would be:

CODE
home_text.onRollOver = function() { home_glow._visible = true; }
home_text.onRollOut = function() { home_glow._visible = false; }

By using _visible instead of _alpha, Flash Player will ignore the pixels of home_glow when rewriting the display on roll out. I don't think anybody would ever notice the performance difference, but it is a more 'proper' approach.

To stop the timeline at the end of your tween, simply add this to the last frame:

CODE
stop();

User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 07:43AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month