Mouseover State While Playing A Movie Clip
how do i stay on a mouseover state while playing a movie clip. I have attached my file as the example.
i would like the text "LINK" to stay "up" while the 2 links appear, how do i do that? any suggestions?
thanks, jgatienza
FlashKit > Flash Help > Flash Newbies
Posted on: 01-23-2006, 05:50 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Movie Clip Won't Stop Playing In Over State....
i have inserted a movie clip into the over state of a button. i only want the clip to play on rollover, but it is currently playing on rollover, and onclick.
i think flash is atomatically resetting the button when i click on it, then when it sees that my mouse is still on the button, it plays the movie again.
anyone have any suggestions?
Button Down State...playing A Movie
Okay...I have this game idea, where there are these balloons and they are all buttons...so when you click on them, they are supposed to blow up [I made a crosshair cursor and such]. Well, I made each balloon a button, and set the over state as the same as normal, and then I set the Down state to be a movie...still with that? Then...I made the movie as the pieces of balloon blow up and its all good...so that all worked, and when I tested it, it only worked when I was holding the mouse down. I know I've seen how to make the movie play when you just click once. And then I need to movie to stop playing at the end [stop ();] and have hte balloons completely be gone. If you can find the tutorial, or send me the code that'd be great, thanks
On Mouseover Show Movie Clip, On Mouseout Close Movie Clip *HELP*
Basically what I am trying to do is this...
I have a movie clip that is a name. When you put your mouseover the name I want another movie clip to display to the right of the name. This clip has a photo and bio of the person.
The photo and bio have an animation that fades it in and an animation to fade it out. I have 5 frames for the fade in, then stop frame, then 5 frames for the fade out.
What actionscript do I need to use to make that second movie clip load when a user mousesover the name (first movie clip) and to make the second half of the second movie clip play when the user removes their mouse from name (first movie clip).
NOTE: I tried using loadMovie and unLoad movie but I couldn't do it loading another swf. The reason being this is already an swf loaded inside a main movie. I guess you can't load an swf inside an swf that's already loaded inside an swf. I hope this all makes sense!
I appreicate all the help!
Thanks a lot!
Mouseover A Movie Clip
I have created a menu which is a movie clip on my main timeline. I would like to change the alpha level of an image on another layer to 30% whenever i mouse over the menu movie clip and back to 100% when I mouse out. Is this possible? Thanks in advance for your help.
Movie Clip On Mouseover
I have a movie clip , how can i give it an onmouseover effect like buttons have?
onclipevent ?
Check If Movie Clip Finish Playing Before Playing Next
I'm trying to figure out how to create a conditional variable script to check to see if one of the 4 movies are finished before starting the next selected one.
I have 4 menus with 4 movie clips that have an opening and closing animation in them.
When clicking the one of the buttons I would like it to check and see if any of the movie clips are in the open position. Then have the movie that is in the open position play it's closing animation. Then play the selected category movie that the person clicked on.
I know it's all done with variables but just cant figure out how to put it together.
here is what i have so far.
menuStatus = 0;
trace(menuStatus);
but1.onPress = function() {
if (menuStatus == 0) {
menuwork.gotoAndPlay("start");
menuStatus = 1;
} else if (menuStatus == 2) {
resetMenus();
}
};
but2.onRelease = function() {
if (menuStatus == 0) {
menuwhoweare.gotoAndPlay("start");
menuStatus = 2;
}else if (menuStatus == 1){
resetMenus();
}
};
function resetMenus() {
if (menuStatus == 1) {
menuwork.gotoAndPlay("close");
menuStatus = 0;
} else if (menuStatus == 2) {
menuwhoweare.gotoAndPlay("close");
menuStatus = 0;
}
}
thanks for any help in advance
On MouseOver Play Movie Clip
This must be simple!
All I want to do is have a movie clip play when triggered by a mouseOver event!
I have tried this so many ways and it won't work!!!!!!
eg. this actionscript attached to a button:
on (rollOver) {
star.play();
}
help!
Help - Scaling Movie Clip On Mouseover
Is it possible to have a movie clip scale to a certain size when you roll over it?
The way I tried to set it up was...
I put the movie clip that I want scaled inside another movie clip. On frame 1, the movie clip is small, then it tweens to full size (at frame 15), and then back down to small (at frame 30). The actions are to stop at frame 1, frame 15, and frame 30.
Then I put a button on top of that movie clip, and had the button invisible, but the same dimensions as the clip, and I had
onRollOver {
GoToAndPlay(1)
}
onRollOut {
GoToAndPlay(15)
}
Can anyone see what I'm trying to do? The problem is that when I roll over the button, the movie clip grows and shrinks as it should, but then the button is covering the whole clip, and I cannot have access to buttons inside that clip...
Essentially this is a music control device, I want it to be small when the mouse is off of it, and full-size when the mouse rolls over, a much similar effect to the icon bar on the bottom of the screen in Mac OS X. Thank you so much to anyone who can help. I'll check back to respond if anyone needs more info.
MouseOver Play A Movie Clip
Have gone through the archives for this one but can't find this very simple code, surely someone most have asked this before.
Have a movieclip (a colourbox flying in with some text and stops) which works as a link.
This is what I want:
When the mouse is Over, the clip dissapears and it plays another movie clip.
When the mouse is out it that dissapears and shows the original movie clip again.
Any clues?
Movie Clip Keeps Looping On Mouseover
Movie clip button works in own timeline (it stops after one pass) but keeps looping on mouseover when imported into website button - how can I run it to frame 8 and stop on mouseover?
Movie Clip Hit State
Hi,
I have some movieclips acting as buttons, what I want to do is give them a visited, or currently hit state.
I have kind of achieved this but when another button is clicked then I need to reset the first button to its original stater# so I dont have more than one button in a 'hit state'.
The buttons cannot be referenced in any way as there are loads of them in my actual site, so this may not be possible
I have linked an exaple fla that better depicts this.
Hope some one can help,Thanks
Movie Clip Hit State
Hi,
I have some movieclips acting as buttons, what I want to do is give them a visited, or currently hit state.
I have kind of achieved this but when another button is clicked then I need to reset the first button to its original stater# so I dont have more than one button in a 'hit state'.
The buttons cannot be referenced in any way as there are loads of them in my actual site, so this may not be possible
I have linked an exaple fla that better depicts this.
Hope some one can help,Thanks
Part Of Movie Clip Inactive On Mouseover
Hello!
This is what I want to do:
http://www.sammijdesign.com/gjflash/one.php
(Depending on which number you last clicked on / which page your on), when you mouse over 1, the word ONE fades in and out. When you mouseover 2 the word TWO fades in and out.
I don't want anything to happen when you mouseover the words ONE or TWO (when they are not shown) - but instead, what I have, is when you mouse over the words, they fade in and out, but I want nothing to happen.
How I have each of the numbers/buttons set up, is through multiple frames on a movie clip.
Here is my as3 code.
Code:
try {
var keyStr:String;
var valueStr:String;
var webStr:String;
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
for (keyStr in paramObj) {
valueStr = String(paramObj[keyStr]);
if (keyStr.indexOf(".") != -1){
webStr = keyStr;
keyStr = keyStr.substring(0, keyStr.indexOf(".")); //now it's "home"
}
}
//tf.appendText(keyStr);
} catch (error:Error) {
// tf.appendText(error);
}
var tl:MovieClip = this;
var buttonA = ["one","two"];
for (var i:int=0; i<buttonA.length; i++) {
var childButton:MovieClip = MovieClip(tl.getChildByName(buttonA[i]));
childButton.buttonMode = true;
childButton.addEventListener("mouseOver",handleMouse);
childButton.addEventListener("mouseOut",handleMouse);
childButton.addEventListener("mouseDown",handleMouse);
childButton.addEventListener("mouseUp",handleMouse);
}
function handleMouse(evt:MouseEvent):void{
if(evt.currentTarget != MovieClip(getChildByName(keyStr))){
var frameLabel = '';
switch(evt.type){
case MouseEvent.MOUSE_OUT:
frameLabel = "out";
break;
case MouseEvent.MOUSE_OVER:
frameLabel="over";
break;
case MouseEvent.MOUSE_DOWN:
frameLabel="down";
break;
case MouseEvent.MOUSE_UP:
frameLabel="up";
break;
}
evt.currentTarget.gotoAndPlay(frameLabel);
}
}
one.addEventListener(MouseEvent.CLICK,handleOneMouseClick);
two.addEventListener(MouseEvent.CLICK,handleTwoMouseClick);
function handleOneMouseClick(evt:MouseEvent):void{
if(evt.currentTarget != MovieClip(getChildByName(keyStr))){
navigateToURL(new URLRequest("one.php"),"_self");
return;
}
}
function handleTwoMouseClick(evt:MouseEvent):void{
if(evt.currentTarget != MovieClip(getChildByName(keyStr))){
navigateToURL(new URLRequest("two.php"),"_self");
return;
}
}
function wpdetect() {
trace("webpages Array successfully loaded");
var curpage:String = paramObj['currentPage'];
switch(keyStr) {
case "one":
//blog button in down position here
one.gotoAndStop("down");
trace("User is on the blog page");
break;
case "two":
//blog button in down position here
two.gotoAndStop("down");
trace("User is on the blog page");
break;
default:
trace("Webpage not found. Update Case Statement.");
trace(keyStr);
}
}
wpdetect();
Any help would be amazingly appriciated!!!!
Thanks!!
Activating A Movie Clip By Mouseover Button, Anybody Can Help?
Hi
can anyone help me with this one?
I have a movie with a preloader, then 12 buttons are loaded on the screen and an area reserved to display
12 movies.
buttons are animated on mouse over, by placing animation on over keyframe of button.
I would like for buttons to do 2 things more:
by mouse over each button would start 1 of 12 movies (short animations that display a preview of my garphic desig
n work), each button starts 1 movie all displayed in the same space, all starting with alpha values a 0% so they
are transparent and when mouse over activates the movie the short animation fades in, if mouse moves to anothr
button the movie simply stops (I am not even dreaming at this point of anything more complicated) and the next
mvie starts playing.
Also on click the buttons would open a nw browser window displaying the graphic design in larger size and more
detail.
I cannot manage to get the actonscript down, have tried several tutorials but cant seem to get them to
work,alltough the tutorials seemed pretty good.
The tutorials were using telltarget command but I kept getting error messages with ";" signs aparently missing
somewhere all the time, actually I am sure I was just doiung something wrong and it would have made absolutely no
diffeence even if I had semicolons planted everywhere, as I just dont know actionscript.
The pop up/new browser window sems to be ok alltough have not as of yet tested it fully, logic is that the mouse
over would call a java function that lies on the html page that holds the flash.
If anyone could help me find a way to start a movie that is located on another layer, in 1 frame in the same scene
, well I would be very happy, as then I might have a chance to actally pull my site together sometime.
Thanks for anyone who takes the time to read this, I would appreciate a small tutorial/simple instructions (or a link) on how
to start a movie on mouse over.
Thanks
Sami
Animated Button In Mouseover /movie Clip
http://www.fxnetworks.com/shows/originals/rescueme/ - when you mouse over the graphic for the links, it animates. Is this a button, movie clip, both? This is want I would like to do. How can I do this with cs3 flash?
Mouse Pointer On Mouseover Of Movie Clip
I have created a flash navigation header and i made the "buttons" from movie clips so i could have an animation on the buttons when they are mouse over.
But how do i have the mouse pointer turn into the hand on mouse over?
here is the code i am useing to have the movie clip play the animation on mouseover:
home_mc.addEventListener("mouseOver", homeOver)
function homeOver(evt:MouseEvent)
{
home_mc.gotoAndPlay("home_over");
}
-- thank you for any help
How Do I Get A Movie Clip Into A Button State?
Hello again. Thx for the help last time but I am still having some trouble implementing it. I am trying to simulate a beating heart on MouseOver. Rather than scripting anything, it was suggested that I create a Movie clip of a beating heart separately and then insert into the button's Over state. How exactly do I do that? I have made a 4 keyframe MC, then on another canvas made the Heart button, but I don't see any way to insert the MC into the Over state. I can't find any examples in the 2 Flash books I have nor this site. Help!!
And again, I appreciate the help. Some of you guys really know your stuff.
Movie Clip Into A Button State
Is placing a multiframe movie clip into the keyframe of a button's over state possible? On rollover of a button, I want to give the impression that the button is pulsating. Many thanks for the help.
Movie Clip In A Button's Over State?
Hi,
Is it possible to insert a movie clip into the over state of a button? Whenever I try this, it only shows the first frame when the buttons are enabled. I basically just want to have a few small tweens happen when the user rolls over the button.
Thanks
Movie Clip In The Down State Of A Button
I'm creating a button to change audio tracks in my movie(s). When the user clicks on the button, I want it to play a small mc animation once through. The problem is, if the user doesn't hold the mouse down, it reverts back to its up state. Is there any way to make sure that the animation plays once through even if the button is switched to the up state? I just started working in flash a few days ago, so I assumed this would go in the newbies section.
Movie Clip On Button Hit State
okay, i have a movie that i wish to run on the hit state of a button i created. but on release of the mouse button, the movie stops. im guessing i need actionscript, right?
Movie Clip In Button's Down State
hi everyone.
I have a button in Flash MX with a quick movie clip in the button's down state. My problem is how do i get the button to play the button's full animation once clicked before calling the URL for the next page? The full animation only happnens if you hold down the mouse button and dont release it, othewise you'd only see a couple of frames.
Thanks
[F8] Movie Clip Button Over State
Hello i have movie clip
I have a button in there, I have text come up on the over state but this is now now not coming up could anyone please tell me one how i can make it come up or how to get around it thanks guys
Movie Clip State Externally
I have a movie clip in a file called main.swf that runs my menu. I also have image links directly on my homepage to get people to the still forming key areas of my site. These Images are in a seperate "homeText.swf", HomeText is in a sub folder. In HTML it would be something like "../main.swf" etc.
I need the movie clip mcMenuOne to change frame when these images are clicked.
Any pointers are greatly appreciated. Action Script book is for Flash 5 does anyone have recomended reading for the current, or MX04 Flash?
Sweet, Lunch time, I'm outa here.
Movie Clip Buttons With Down State PLEASE HELP
Hi all
Flash beginer, sorry if this is a simple question.
I'm working on a new site for the company I work for and I want to have a flash menu. See my example
http://www.jaybe.co.uk/zzz.html
I've managed to get the buttons glowing on the roll over and then returning to the original state on roll out, this looks really nice and I'm happy with it but I want:-
When a button is clicked like beds for instance I want this to remain with a large glow ie. the roll over state until a new button is pressed. When the new button is clicked this will then become highlighed so the user always knows which page they are on. Only one button can have a down state at a time.
I will appreciate any help but please bear in mind that my action script isn't great. I undestand what I'm looking at but i find writing it difficult but I'm determined to learn.
Thanks
Ricky55
Problem With 2 State Movie Clip
I have a movie clip that is an 'about' button. It has 2 frames one for each state(see gif). The problem is I have added the following code to the rollover (blue box). It traces the message but does not move the timeline. Any reason why the this keyword should not work here?
inv2.addEventListener(MouseEvent.MOUSE_OVER, goBack);
function goBack(event:MouseEvent) {
trace('yo');
this.gotoAndStop(1);
}
Entering Mouseover State When It Shouldnt...
I have some text buttons forming a menu bar, these buttons have over states with a small tool tip offest from the button. The problem is when the mouse moves over the tooltips area, the mouseover state is entered and the tooltip appears. However, i only want the tooltip to display when the mouse is over the button, and not when its over the tooltip as well.
Any ideas?
Cheers
Woff
Thumbnails Get Stuck In Mouseover State
hi!
i have a little problem - i have a line of thumbnails which scroll with the mouse movement. each is a seperate .swf which contains code making them grow with a rollOver and shrink again with a rollOut. the problem is that if you are scrolling through too quickly, the thumbnails get stuck on the rollOver state and stay enlarged, i guess because the mouse has rolledOut before the enlarged state has been reached so the rollOut doesn't register. can anyone tell me how to fix this? the animations are just 5 frames each, running at 25 fps, so they are pretty quick... anyway - any thoughts?
thanks
emma.
Capturing The State Of A Movie Clip At A Particular Instance?
Hi! Can anybody help me with this!
I have a movie with a heavy actionscript code running in the first few frames. I am using this movie into another main movie and eveytime I do so, the script gets executed and this slows down the main movie load time.
What I want is if I could capture the state of the first movie after a certain number of frames and ...say it can be saved in a .swf fromat. I can use this into the main movie. This will remove the load time, I think.
Can anybody suggest how to go about it ? or if any other way to get rid of the load time ?
Thanks! Please help!
maven5.
How To Make The State Of A Movie Clip Global?
Hi guys,
I've got 9 frames in my .fla for different parts of my application, i've made a really neat sound control movie clip with volume slider etc, which runs from actionscript on the main timeline.
My problem is that i'd like the sound control movie clip to be on each screen/frame of my application. Placing it on the stage is not enough because it obviously requires the code repeated on the main timeline, but somehow I need the current state to be passed on (so the volume is consistent).. bearing in mind frames can be visited in any order.
What approach would be recommended?
[F8] Is There An Active State For Movie Clip Buttons?
Hi All,
I have functions for my movie that do a on press, on release, on rollout states. But I was wondering what the code or if there was an example how how to code in action script. If the user clicked on the button then it would keep a color to show that is the active button that was clicked already?
Similar to the HTML: active state
Any ideas ? Actionscript 1 please
Reseting The Movie Clip To The Orginal State
Hey guys I really have a conflict problem!
I have a website with 9 pages and each page (movieclip) i call it frame1 to frame9 anyway in the frame4 (page4) I have loadmovie action which is loading another page with 4 buttons inside the problem is when I go to page 4 and play it and get back to any other page the movieclip (page4) doesn’t reset again to its original state.
How I can do that with very simple code.
Help please
Help, Add Video To Button / Movie Clip Over State
How can I add a few seconds of video into the over frame/state of a button?
Visit http://www.fxnetworks.com/shows/originals/rescueme/#/home/ to see the example of video that animates when I mouse over the the red boxes Exclusive Video, About The Show, and Cast & Crew.
Can You Still Get Buttons To Change State While Even In A Movie Clip?
Hello,
I trying to do an effect where the navigation flash buttons on a page slowly move back and forth, but still hopefully change color when you roll over them. I made my buttons, then put them all in a movie clip to get the motion, however, when you roll over the buttons they don't change the color I intented them to do. Oddly enough, you can still click on them and they'll take you to the pages I assigned them. Is there any way to get the roll-over effect, but still have the buttons slowly move on the page?
BTW: the button states were each created in photoshop, just in case.
Thanks!
Rob
Duplicating A Hit State For A Movie Clip Button
Hi everyone,
I'm currently using movie clips as buttons and was wondering the best way to create a hit state, like what is found on button symbols. The movie clip images I'm using are png's with alphas, so I don't want the entire thing clickable. They need to remain movie clips, because they are animating at different points during the movie.
Thanks in advance.
Movie Clip Buttons Down State Question
Hi all
Flash beginer, sorry if this is a simple question.
I'm working on a new site for the company I work for and I want to have a flash menu. See my example
http://www.jaybe.co.uk/zzz.html
I've managed to get the buttons glowing on the roll over and then returning to the original state on roll out, this looks really nice and I'm happy with it but I want:-
When a button is clicked like beds for instance I want this to remain with a large glow ie. the roll over state until a new button is pressed. When the new button is clicked this will then become highlighed so the user always knows which page they are on.
I will appreciate any help but please bear in mind that I can't write action script like Lee. I undestand what I'm looking at but i find writing it difficult but I'm determined to learn.
Thanks
Ricky55
Text Link Button With Mouseover State
Hey all,
REALLY simple thing I can't get Flash to do.
I need a text link button that changes color when you mouseover it.
I created it as a button with an Up and Over state with my colors desired. I then created a Hit Area that is the whole button. BUT, when I mouse right on the text, it goes back to the Up state color, but if I'm off the text a bit but still in my hit area, I get my rollover color.
What am I missing here?
Sound Clips On MouseOVER State Buttons
I have imported a few sound clips to my library. On the OVER state of my buttons properties I choose SOUND, then select the sound from the menu. I have done this for each individual button (4 total).
The issue is that the sound clip plays but the sounds are "running" into each other. What are the steps to make the OVER state sound clips play once and then stop before the next sound plays?
Thanks!
Daniel
Sound Clips On MouseOVER State Buttons
I have imported a few sound clips to my library. On the OVER state of my buttons properties I choose SOUND, then select the sound from the menu. I have done this for each individual button (4 total).
The issue is that the sound clip plays but the sounds are "running" into each other. What are the steps to make the OVER state sound clips play once and then stop before the next sound plays?
Thanks!
Daniel
Text Link Button With Mouseover State
Hey all,
REALLY simple thing I can't get Flash to do.
I need a text link button that changes color when you mouseover it.
I created it as a button with an Up and Over state with my colors desired. I then created a Hit Area that is the whole button. BUT, when I mouse right on the text, it goes back to the Up state color, but if I'm off the text a bit but still in my hit area, I get my rollover color.
What am I missing here?
Movie Clip Animation Not Finishing In Button State
I'm sure this question has been asked dozens of times, but the search feature of the board isn't working right now, and I don't feel like sifting through hundreds of posts...
If there's already an explanation on this board, please just point me to it. Otherwise:
How do I get a button state's movie clip animation to play and finish its animation when you click the button?
If the answer is "move the movie clip outside the button", then could you please explain a little further? Do I put it on the main stage? If so, does it matter which frame?
Movie Clip As A Button: Can't Get My Extra State To Work.
*EDIT: Resolved with solution posted at end, however, the problem was not AS related as I thought. I'll encourage this to be moved to the appropriate forum then.
I'm using Flash MX 2004 Version 7.2
Okay, I'll try to explain this the best I can. I'm trying to use a movie clip as a button with 4 states, 3 of which are standard, as shown below:
The first frame contains a regular stop(); action.
The last frame contains a stop(); action as well, as I want the clip to stop after this tween.
For the movie clip in the document, I'm using the following ActionScript:
code:
on (release)
{
gotoAndPlay("slash");
}
According to the materials I have with me, this is supposed to play the movie clip starting at the "slash" frame (as opposed to the main timeline).
The problem I'm having though is that the tween is only playing to frame 17 of the movie clip, and then it goes blank, as if it's already played.
I've got a FLA linked below, just be warned it's pretty primitive. I'm actually trying to get something like this working so when I create my battle system for a game I plan to make, I don't have to insert frames for these tweens on every new enemy - I can just use the same button over and over, and apply the proper battle equations to it on(release).
FLA: http://atlas.walagata.com/w/naojason...stemengine.fla
First Post... Text Anim/movie Clip On Btn Over State
*Just born into AS 2.0**Flash MX 2004 Pro* I've searched the forums and I think I've come close to the answer. -2 part question- I have a MC on the over state of a BTN... (control enter to test movie) I place my cursor over the BTN and the MC plays (alright). Problem 1) If I move the cursor off the BTN prematurely the MC instantly jumps back to the start without finishing the animation (text motion tween) I've tried and tried but don't know what to do...
Second part which seems so obvious isn't so to me lol. I can not for the life of me get the .getURL to work?? I've tried it inside the BTN timeline, I've tried it in the movie clip timeline to no joy. No script errors it just doesn't do anything. The one time I did get it to work it processed the .getURL when I rolled the cursor over the animation (on a nav bar)... I want it to worke when clicked on. Any suggestions?
Thanks much in advanced. Will be glad to post .fla if needed.
Maintaining Over State On Button Within Movie Clip After Clicking
Hey Guys,
This is frustrating me and its prob so simple and is a tiny thing but is required for userbility.
I have a slide show with next and previous buttons, when a button is clicked i need it to remain in the over state so that the user has the ability to continuosly click through all the slides without having to move the cursor to regain the over state.
At the moment after the click event the button returns to the up state even though the cursor is still over the button.
I have tried a gotoAndStop(2) statement on release of the button but it does not work.
Is this because the buttons are within a movie clip ? because when i test the movieclip on its own the buttons work the way i want but when i test it from the main timeline they do not.
Pleae help
Slight Problem With Movie Clip Buttons With Down State
Hi
Some one helped with with this code the last time I did a menu like this but this time I'm using a dummy button inside my main movie clip just to ensure the buttons are easy to click.
I have a menu bar made up of animated movie clips this is all working as I want apart from one small thing. I can set which button I want to be down intially this works but when I roll over it re enables instead of just remaining down.
The menu can be seen here:-
http://www.creativeauto.co.uk/home.html
How do I get the exterior styling button to just remain down even if I roll over it. (or when any button is down I don't want it to re enable)
My code
Code:
//Container to hold the active menu item
activeMenu = undefined;
//Sets which buttons is to be down intially
activeMenu = exteriorStyling_mc;
activeMenu.gotoAndStop("down");
//example of the code for the buttons
exteriorStyling_mc.exteriorStyling_btn.onRollOver = over;
exteriorStyling_mc.exteriorStyling_btn.onRollOut = out;
exteriorStyling_mc.exteriorStyling_btn.onPress = clicked;
//the functions
function over() {
// check if not an active menu
if(_root.activeMenu == undefined || this._name != _root.activeMenu._name) {
this._parent.gotoAndPlay("on");
}
}
function out() {
// check if not an active menu
if(_root.activeMenu == undefined || this._name != _root.activeMenu._name) {
this._parent.gotoAndPlay("off");
}
}
function clicked() {
// reset old active menu item
if(_root.activeMenu != undefined) {
_root.activeMenu._parent.gotoAndPlay("off");
}
// make menu active
this._parent.gotoAndStop("down");
// save new menu item
_root.activeMenu = this;
}
How To Make Dynamic Text Appear And Disappear When MouseOver On A Seperate Movie Clip
Hi i hope someone can shed some light on by novice AS writers block.
I am creating a photogallery with thumbnails that reads all the data from XML, this is based on the excellent Kirupa tutorial.
What i want to happen is that the text only appears when you mouseOver the image.
I thought it would be a simple using an if statement but can not get it to work.
you can view the page at http://www.bru-ha.com/roza-flash/art_7.swf
below is the actionscript for the file & the FLA.
Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
media = [];
credit = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
media[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
credit[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[4].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load('xml/art_7.xml');
///////////////////////////////////// preloader
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
///////////////////////////////////////next and previous image function
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
text_mc.desc_txt.text = description[p];
text_mc.media_txt.text = media[p];
text_mc.credit_txt.text = credit[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
text_mc.desc_txt.text = description[p];
text_mc.media_txt.text = media[p];
text_mc.credit_txt.text = credit[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
text_mc.desc_txt.text = description[0];
text_mc.media_txt.text = media[0];
text_mc.credit_txt.text = credit[0];
picture_num();
}
}
/////////////////////////////////////////////////////////load thumbnails
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(eval("thumbnail_mc.t"+k)._width+10)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc._alpha = 30;
target_mc.onRollOver = function() {
target_mc.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 15;
//or any other number you like, if it's too fast or too slow
} else {
this._alpha = 100;
this.onEnterFrame = null;
}
};
};
target_mc._alpha = 30;
target_mc.onRollOut = function() {
target_mc.onEnterFrame = function() {
if (this._alpha>30) {
this._alpha -= 15;
//or whatever number you used above
} else {
this._alpha = 30;
this.onEnterFrame = null;
}
};
};
};
//////////////////////////////////////////////////////////text fade
//text_mc._alpha = 0;
//picture.onRollOver = function() {
//picture.onEnterFrame = function() {
//if (text_mc._alpha<100) {
//text_mc._alpha += 15;
//} else {
//text_mc._alpha = 100;
//picture.onEnterFrame = null;
//}
//};
//};
//picture.onRollOut = function() {
//picture.onEnterFrame = function() {
//if (text_mc._alpha>100) {
//text_mc._alpha -= 15;
//} else {
//text_mc._alpha = 100;
//picture.onEnterFrame = null;
//}
//};
//};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
stop();
any pointers are gratefully recieved.
Cheers
Bo-doodle
[CS3] Drop Down Back To Inital State Inside Movie Clip - U.S. Map
Hello all,
My Case:
I have a US Map and several states are clickable, when you rollover a state it changes from yellow to red (this is a MC). When you click a state it stays red and a box 'drops down' from it with a body text explaining something about it (this is another separate MC). The box can be close in two ways: 1. By clicking on the state again. Or 2. By clicking on an X that the box has.
My problem:
I can't find a way to close the box via the X.
The Explanation:
The box with the text and the X are all a Movie Clip, this MC is activated by clicking on the state on the main Time Line, but I don't know how to make the X close the MC it's contained in (the drop down box). I can close the box from outside (main Time Line) by clicking the state though.
Does that make sense?
You have to consider that the X ' wouldn't ' know when the box is contained in is either open or closed... which is actually the piece of ActionScript that I need.
The code I'm using:
This is the code I'm using on the state to open and close the box containing the explanatory text, and the closing X of course:
Code:
on (release) {
if (Number(test) == 1) {
test = 0;
} else {
test = 1;
}
}
My problem:
As I mentioned, I don't know how to use the above code and use it inside a MC to make the box close itself if it's open... the X to close the box can only be seen when the box is open or has dropped down.
Can anyone give me a hand please?
Download the FLA:
To understand better my problem you can download the original file from here: http://www.ricardozea.net/map/map.zip
Thank you!
|