Addding Hyperlink to the MovieClip in Flash

Here is the AS3.0 Script code for adding hyper link to the movie clip in flash:

import  flash.display.MovieClip;
import  flash.events.MouseEvent;

MySliderMc1.addEventListener(MouseEvent.CLICK, onClickHandler);
MySliderMc1.buttonMode = true;
MySliderMc1.useHandCursor = true;

function onClickHandler(myEvent:MouseEvent)
{
navigateToURL(new URLRequest(“http://www.thomaswhite.com/”));
}

Notes:

1) MySliderMc1 is the movie clip instance name

2) MySliderMc1 should be present from frame 0. Otherwise,

3) Write Action Script at frame 0 by creating new separate layer for the event . Right click on frame 0 and click Actions to open Action script window.

In the similar way, you can add other events using the code below:

MySliderMc1.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
MySliderMc1.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
MySliderMc1.addEventListener(MouseEvent.MOUSE_DOWN, onPressHandler);
MySliderMc1.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);

function onRollOverHandler(myEvent:MouseEvent)
{ trace(“Over”); }

function onRollOutHandler(myEvent:MouseEvent)
{ trace(“Out”); }

function onPressHandler(myEvent:MouseEvent)
{ trace(“Press”); }

function onReleaseHandler(myEvent:MouseEvent)
{ trace(“Release”); }

Source: http://www.iheartactionscript.com/coding-movieclips-as-buttons-in-as3/

Advertisements

Flash: Fading In and Fading Out

Make sure that you already have Created Motion Tween for the Symbol that you want to have fade in and fade out effect.

So, Select the key frame(along with symbol selected) where you want to start the fade in and go the properties window.

In properties window, under COLOR EFFECT catergory,  Set the Alpha from Style drop-down list and also set Alpha slider to 0% (zeor).  after setting Alpha slider to 0(zero), symbol will disappear.

Select the keyframe(along with symbol’s selected – as the symbol is not visible, you can select middle of the green transition) where you want to display full symbol,  and set the Alpha slider to 100%.

Color Effect Setting For FadeIn and FadeOut

Color Effect Setting

select the keyframe(last keyframe along with symbol selected) where you want the symbol to fadeout and set the Alpha slider to 0%