473,378 Members | 1,543 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

AS 3.0 - making a movie clip into a clickable button

3
I have a _mc that I've added to the stage. On it's layers first frame I have this code that spins the _mc around and has some great effects:

import fl.transitions.*;
import fl.transitions.easing.*;

TransitionManager.start(img4_mc, {type:Zoom, direction:0, duration:3, easing: Bounce.easeOut});
TransitionManager.start(img4_mc, {type:Rotate, direction:Transition.IN, duration:30, easing:Strong.easeInOut, ccw:false, degrees:720});
TransitionManager.start(img4_mc, {type:PixelDissolve, direction:Transition.IN, duration:2, easing:Regular.easeIn, xSections:10, ySections:10});
TransitionManager.start(img4_mc, {type:Fade, direction:Transition.IN, duration:4, easing:Strong.easeOut});
TransitionManager.start(img4_mc, {type:Photo, direction:Transition.IN, duration:4, easing:None.easeNone});

This works great but, when that _mc comes to rest - I want it to be clickable.
I went and tried to put code that would make this clickable and put it in the same frame - but, then my _mc wouldn't spin. Then I put the code on the first frame of the actual _mc and it did the same thing.

Why does the code to make it clickable cancel out the code that makes it spin?
What's the best way to do this? ( I want it to spin and then be able to click on it)

Big Thanks,
zb
Feb 6 '08 #1
3 5766
nomad
664 Expert 512MB
I have a _mc that I've added to the stage. On it's layers first frame I have this code that spins the _mc around and has some great effects:

import fl.transitions.*;
import fl.transitions.easing.*;

TransitionManager.start(img4_mc, {type:Zoom, direction:0, duration:3, easing: Bounce.easeOut});
TransitionManager.start(img4_mc, {type:Rotate, direction:Transition.IN, duration:30, easing:Strong.easeInOut, ccw:false, degrees:720});
TransitionManager.start(img4_mc, {type:PixelDissolve, direction:Transition.IN, duration:2, easing:Regular.easeIn, xSections:10, ySections:10});
TransitionManager.start(img4_mc, {type:Fade, direction:Transition.IN, duration:4, easing:Strong.easeOut});
TransitionManager.start(img4_mc, {type:Photo, direction:Transition.IN, duration:4, easing:None.easeNone});

This works great but, when that _mc comes to rest - I want it to be clickable.
I went and tried to put code that would make this clickable and put it in the same frame - but, then my _mc wouldn't spin. Then I put the code on the first frame of the actual _mc and it did the same thing.

Why does the code to make it clickable cancel out the code that makes it spin?
What's the best way to do this? ( I want it to spin and then be able to click on it)

Big Thanks,
zb
What does your button Timeline look like.
and what are your actions for the button look like.

nomad
Feb 6 '08 #2
zb42
3
Thanks for the reply -
The current state of the code is here. I have it listed in the first frame of the layer on which the movie clip 'img4_mc' resides.

zb
++++++



import fl.transitions.*;
import fl.transitions.easing.*;

TransitionManager.start(img4_mc, {type:Zoom, direction:0, duration:3, easing: Bounce.easeOut});
TransitionManager.start(img4_mc, {type:Rotate, direction:Transition.IN, duration:30, easing:Strong.easeInOut, ccw:false, degrees:720});
TransitionManager.start(img4_mc, {type:PixelDissolve, direction:Transition.IN, duration:2, easing:Regular.easeIn, xSections:10, ySections:10});
TransitionManager.start(img4_mc, {type:Fade, direction:Transition.IN, duration:4, easing:Strong.easeOut});
TransitionManager.start(img4_mc, {type:Photo, direction:Transition.IN, duration:5, easing:None.easeNone});

function centerClick(event:MouseEvent):void
{
var request:URLRequest = new URLRequest("index.cgi");
navigateToURL(request, "_self");
}
img4_mc.buttonMode = true;
img4_mc.addEventListener(MouseEvent.CLICK, centerClick);
Feb 7 '08 #3
zb42
3
Well, I solved my problem.
In the post above, the linkage script is pretty much correct
for making a mc clickable to a url in AS3.

But, it is extremly important to remember the little
'import flash.net' thingy at the top of your script.

zb42
Feb 11 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: torbs | last post by:
I have a problem when I use javascript to get the length and position of a movie I recieve from a rtsp stream. The length and position is extremely high and not the actual length and position of...
6
by: P3dro0203 | last post by:
I have got a Movie clip that i have made in FLASH MX, and when i attach a actionscript to the button the hit CTRL + ENTER so veiw the SWF file, the actionscripting does not work. Is this becasue i...
10
elamberdor
by: elamberdor | last post by:
Hello All! Well, I can load in swf's just loverly, but what I have is a sliding menu, with buttons in it, that when pressed, load an image into an empty movieclip. I really just need to know how...
0
by: RLW | last post by:
Hi, I inherited a Flash usability problem: It's a self assessment test created in Flash. I think it was originally built using individual flash files for each question and arrays. Now it has...
2
by: robtyketto | last post by:
Greetings, I have workable code to allow movie clips to be dragged around. However I can't find an example of a drag n drop where the movie clip has to be placed with a certain range/xy...
5
by: mukeshrasm | last post by:
Hi I want to play/pause a movie clip when I click a button and the value of button should changed to play when it is paused and pause when it is playing. I am new to flash so how can I do it.
5
by: Katt | last post by:
first of all I am new to flash. I just started to use CS3, and I have 2.0 actionscript selected Cannot get my MC button instance to go play a movie clip on another frame, I have tried...
2
by: Mickey Flores | last post by:
I have just tried to attach a background sound with on/off button to my movie clip at frame 1 of the main Timeline. Flash Movie: the movie will keep on replaying until a viewer clicks a button....
1
by: angelicdevil | last post by:
ok wat i m trying to do it get flash to read a xml file and load the titles in xml as a button into the imagetitles movie clip made on stage in flash . so that when i click on a title it displays...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.