Flash Buttons and a nested movie clip
I have made my movie clip and now I want to nest it into a
button. I am not sure what code I need to use for this and how to
nest it. I want, when a person rolls over the button for the movie
clip to run. When they roll off of the button the movie clip stops.
When they click on the button it takes them to a link. If anyone
can please help me with this, I would SO greatly apprecaite it.
Thank You ahead of time.
Thank You SOOOO Much for replying to this. I can't tell you
how much I appreciate your help.
I just assumed that was the only way I could do it, (nest
it.) So, my MC is called jiggle.
So everywhere you have the my_mc. Should I replace it with
jiggle.onRollOver etc....?
ALso you say to attach the code to the action layer in the
frame the MC appears, not in the MC itself.
So, in the timeline that I have my MC , I have an actions
layer. Do I not want an actions layer there? Should I just save the
timeline with my MC and then cut and paste it into another timeline
that has the actions layer?
I actually have 5 of these MC.that all need to do the same
thing, they are each for a different button.
Similar Messages
-
Button in a nested movie clip-Help!
Hello!
I have an issue that I have never been able to solve and need
to now since I am on a tight deadline.
I have a movie clip button on my main timeline. The code
works fine (up, over and out). Inside that movie I have an
animation where a bubble appears with text, our mission. If I use
the URL link for text it works fine. The problem is I need, when
clicked on, a UILoader to load a file. If I put the correct code on
the main timeline I get an error since that pop-up has not loaded
yet. If I put the correct code(I used before on main timeline only)
in the movie where the pop-up is I also get an error which send the
file into an eternal loop. What am I doing wrong??
I would greatly appreciate any help with this.
Thanks.
RobHi Ned,
Thank for the quick response. The button does have an instance name of "myreserve_btn" and it only seats on page layer in frame 3. and I changed publish settings and got this output message:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at SpaLuvicebestmassageoptionintown_fla::MainTimeline/frame3()[SpaLuvicebestmassageoptionint own_fla.MainTimeline::frame3:1]
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
at SpaLuvicebestmassageoptionintown_fla::innnerbody_25()
at flash.display::Sprite/constructChildren()
at flash.display::Sprite()
at flash.display::MovieClip()
at flash.display::MovieClip/gotoAndStop()
at SpaLuvicebestmassageoptionintown_fla::MainTimeline/bodymassagebtn_clicked()[SpaLuvicebest massageoptionintown_fla.MainTimeline::frame1:12]
Is there a way around this?
thanx in advance -
Buttons with nested movies clips...
Hi guys
I'm a flash newb. Have just read some tutorials on creating
flash buttons that contain nested movie clips for the different
states. So I went and made 5 of them for my site, all seems great
the rollover effects are just as planned, and I thought I could add
URL link to them in Dreamweaver but thats not working out. Been
googling my *** off to add URL via actionscript (of which I
understand VERY little) , found some code (add the following to key
frame :on(release) {
getURL('
http://www.generic.com',
'_parent');
Major problem is, when I try to add AS to the frame/button,
I'm getting told I 'current selection cannot have actions applied
to it' If I persist and add the script anyway, funnily enough it
doesn't work.
I did an experimental button, consisting of diff coloured
boxes, and AS will apply to that no problem.
I'm tearing my hair out, as I already posted the flash links
on my site and have had to add a note for visitors to use static
links in the interim.
I would love to post the .fla file but I don't see an option
anywhere here to do so.
If some wise soul can help my dumb *** out of this bind it
would be greatly appreciated.You were using AS2 code, which will not work in AS3. That
particular code is placed on an object, which AS3 does not allow
for, which is why it wouldn't let you... all code in AS3 goes into
timeline frames.
For mouse interctive objects (buttons, movieclips, etc) you
assign event listeners to the object. Let's say your button has an
instance name of "btn", here's a variety of the possible event
listeners avaiable, and I've assigned them to the button....
btn.addEventListener(MouseEvent.CLICK, clickHandler);
btn.addEventListener(MouseEvent.DOUBLE_CLICK,
doubleClickHandler);
btn.addEventListener(MouseEvent.MOUSE_DOWN,
mouseDownHandler);
btn.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
btn.addEventListener(MouseEvent.MOUSE_OVER,
mouseOverHandler);
btn.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
btn.addEventListener(MouseEvent.MOUSE_WHEEL,
mouseWheelHandler);
All of those "...Handler" things at the end are the names of
functions you create to take action when the listener hears
something it's assigned for... you can name them anything you want,
and here's and example of how the function might look for the CLICK
event...
function clickHandler(event:MouseEvent):void {
trace("clickHandler");
Again, you can name the function anything you want, and the
code within the function can be whatever you need done when the
button is clicked... just be sure to include the argument
"event:MouseEvent" because the listeners throws an argument to the
function and the function needs to expect it. The "event" part of
that is a variable name, so you can name it whatever you like, such
as "e", which is commonly done. The MouseEvent defines the class,
and should be exactly what it is.... a MouseEvent, caps and
all. -
Flash CS4 Link to a Movie Clip from inside another Movie Clip
I am working on a Flash CS4 project which has 5 buttons with 5 corresponding movie clips all on the main timeline. Everything in functional so far.
My problem is this: I want to be able to mouse click on a particular word in the text inside movie clip 4 ("mc4") and have it link to movie clip 3 ("mc3") (on the main timeline).
I've tried many things, and I can't get it working.
I have tried to highlight the word then link it to "mc3" in the properties panel where it says link (I successfully linked to an email address and to an outside website in other parts of the project)....
I tried to link it in the properties panel to "mc3", I tried & "parent.mc3", "root.mc3";
Linking it this ways seems to be the simplest, logical thing to do, but I don't know what kind of prefix it needs.
Then, I tried making the word (inside mc4) an invisible button (button6) then linking it to the mc3, with it's actionscript in the main timeline with the other button functions.
I tried duplicating mc3 and duplicating invisible button 3 and moving it's hotspot to over the word.
I tried putting a copy of mc3 and the button inside mc4, with the actionscript also inside mc4.
I tried duplicating mc3 and calling it mc6, and putting that inside mc4, with the actions back on the main timeline, and tried again with the actions inside mc4.
I tried with mc6 and invisible button 6 on the main timeline, but that doesn't seem possible.
I tried using this code from Adobe Actionscript 3.0:
button6.addEventListener(MouseEvent.CLICK, startMovie);
function startMovie(e:MouseEvent):void
this.play("mc6"); [and I also tried with "mc3"]
Nothing works!! Please, I would appreciate any suggestions!!
Thanks,
SuzanneIf I limit my attention to the second sentence of your posting, then I suggest the following (borrowing from the rest of your posting)...
If that invisible button6 is inside MC3 (on MC3's main timeline), atop the word you are trying to link to the movieclip, and you just want to make mc4 play by clicking that invisible button6, then assign the following code to the button6 inside MC3...
button6.addEventListener(MouseEvent.CLICK, startMovie);
function startMovie(e:MouseEvent):void
MovieClip(this.parent).MC4.play();
If I missed, then I missed following your explanation. -
Making Button links within a movie clip
I am attempting to learn more Flash in general and
actionscript in particular. I have created a flash piece that
consists of 4 buttons within a movie clip that is being masked by
another movie clip. One movie is the set of 4 buttons. The other
movie is a "spotlight" that moves with the cursor. As the spotlight
shines on each button, the button's text changes color and is "lit
up".The Over state of each button is set to cause the button to
change color. When I put a keyframe in the Down state of each
button in order to add actionscript to create the action that makes
the button clickable to take the viewer to a web page, it tells me
that no actions can be given to this Down state. If I try using
Behaviors to accomplish the same thing, it tells me that Behaviors
are not supported. If I put actionscript into the actions layer of
the timeline, it does not do the required action, i.e. clicking on
the buttons leads nowhere. I have tried moving the actionscript
before, between, and after the setInterval and setMasker
actionscript that controls the interaction between the two movie
clips (which work perfectly). I have tried inserting an actions
layer into the button movie clip--same result--nothing. I have
tried putting the actionscript in the second frame of the actions
layer (both in the main timeline and in the movie clip), all to no
avail. I did give each button an instance name and used them in the
actionscript.
Here is the actionscript I am using for one of the buttons:
book.onPress = function(){
book.getURL("http.//www.bainbridge.wednet.edu");
I do not get an error message with this actionscript. I just
don't get sent to the web page. I am using Flash 8.
What else I should be doing? Is this a problem because the
cursor is already attached to an action? I am sure that this must
be possible, if only I knew more.
Thanks for helping.do you have the actual mc identified as ( book ) on the root
as well as the code i posted above? if so, are the code and the mc
on the same frame? also you should note that the code posted above
is meant to be placed on your root time line, not directly on the
mc identified as ( book ). one more thing: you must target your mc
( book ) correctly.
target like this:
IF YOU ARE ON THE MAIN TIME LINE ( _root ):
// if ( book ) is setting on the _root already then your
target path is simply book.onRelease.
// if ( book ) is setting inside another movieclip on the
_root, find out what movieclip ( book )
// resides in. that will now be the first part of your target
path.
// next find out if ( book ) resides in yet another
movieclip. if so, that will be the next part of
// your target path.
// continue this until you reach ( book ). the entire path
you took to reach ( book ) is your
// target path.
// you can also click on the target icon in your actionscript
pane to insert a target path for
// your movieclip.
here is an example in which ( book ) resides inside another
movie clip ( yourMovieClip ) on your _root:
yourMovieClip.book.onRelease = function () {
getURL("
http://www.cnn.com/"); -
hi,
I recently downloaded a flash template that was built on AS2
and have been trying to figure out how it works for a couple of
weeks now (excuse my ignorance when it comes to AS). I have a
question about nested Movie Clips. The way the template is
constructed invovles a massive amount of nested movie clips and a
large number of instances of each movie clip. The way i understand
it is that if an instance of a movie clip is put on the stage and
given an instance name, any modifications to that movie clip should
be unique to that instance. However when i modify the colour of any
of the movie clips i select, it changes the colour of all other
instances.
Am i missing something obvious here??
Thanks in advance for your help
Kind Regards
DamienYea. This particular template i am working with appears to
change and manipulate colours dynamically as you said. Also it
doesn't have all of the content (txt and images) within the actual
flash document. They are all loaded dynamically through a txt
document and external files (jpgs amoungst others) which makes it
alot harder to edit since i dont fully understand the xml format
they have in the txt document. As well as this, the template has
no, and i mean NO documentation what so ever which makes it much
more difficult to work through. But i guess i will keep pluggin
away at it :)
Thanks again for your help Ned
Damien -
Hi All,
First off, I am a noob to Flash and AS3, but have learned a lot over the last few weeks working on this project (http://www.jtapia.com/vcore/vcore_eng_up.html - go to COMPANY INFORMATION > PROCESS SUMMARIES to see the problem).
My problem is I have a nested movie clip that houses a text URL link to a PDF file in another nested MC. The link works fine OUT of the parent clip but does not work when nested inside the clip. The odd thing is, I have almost the SAME exact thing in the navigation and it all works fine (except it isn't a URL link but I do use an event listener to look for MOUSE_OVER, etc).
The only code refrencing the parent clip is:
1) The fluid layout code (a stage event listener)
2) At different stages in the main timeline, I adjust the nested timeline to various points in the nested clip (i.e. - MovieClip(mc_page_text).gotoAndPlay(2); )
Everything works great EXCEPT the URL links. The animations, everthing else works - no errors.
I've been reading and searching for help on this for hours and can't find a solution. Any help is much appreciated!
Thanks!
Jake
PS - if I left out critical info, please let me know and sorry in advanceHi kglad,
There really isn't any code...the parent clip (main timeline) is on a stop(); frame - the link is via the STATIC TEXT properties box under OPTIONS > LINK. I think that is what's so confusing to me. The only other code is this (as I mentioned in the first post):
the fluid layout code:
function resizeListener (e:Event):void { //fluid layout code
// trace("stageWidth: " + stage.stageWidth + " stageHeight: " + stage.stageHeight);
mc_page_text.x = ((stage.stageWidth / 2) - 258);
mc_page_text.y = ((stage.stageHeight / 2) - 161.5);
mc_logo.x = ((stage.stageWidth / 2) - 354.05);
mc_logo.y = ((stage.stageHeight / 2) - 244);
mc_contact.x = ((stage.stageWidth / 2) + 132.95);
mc_contact.y = ((stage.stageHeight / 2) - 239.7);
mc_nav.x = ((stage.stageWidth / 2) - 500);
mc_nav.y = stage.stageHeight - 178;
mc_footer.x = ((stage.stageWidth / 2) - 500);
mc_footer.y = stage.stageHeight - 15.05;
mc_bg.width = stage.stageWidth;
mc_bg.height = stage.stageHeight;
mc_fade_out.width = stage.stageWidth;
mc_fade_out.height = stage.stageHeight;
And these two references to the mc_page_text MC (the parent clip of the actual STATIC TEXT items) from the main timeline:
MovieClip(mc_page_text).gotoAndPlay(2);
MovieClip(mc_page_text).gotoAndPlay("textFADE");
Thanks for the help!
Jake -
Making a button rollover change a movie clip's frame
Hi again everyone,
I knew how to do this in AS2 but now I am having problems
with making a button on the stage goto a frame in a movie clip on
the stage.
I've attached a sample of my code below, hopefully you'll see
the error and be able to point it out to me?
I have a movie clip on the stage that has different
information in different frames. I want to make it so that when
someone rolls over the button, the movie clip fades in and goes to
the correct frame to display the information.
With this setup the way it is below, I keep getting "Warning:
3590: void used where a Boolean value was expected. The expression
will be type coerced to Boolean.
I know where the problem is happening, "function
XXX(event:MouseEvent):void {navigateToURL(XXXweb)}"
How can I write this differently and eliminate this problem?
Thanks,
JeremiahI'll give that a shot, thanks!
A follow up question to that one, is there a way to make it
so that I can have one rolled over function applied to several
buttons / frames in the movie clip? This movie clip has 50+ frames
in it and if I could reduce my coding, it would make life a lot
easier.
Thanks,
Jeremiah -
Can't get nested movie clip to play
Hi everyone,
I have a movieclip on one of the frames on the maintimeline.
Within this movieclip is a nested movieclip which itself is
contained by another clip. The first movie clip plays to a certain
frame where I've got some code telling the nested movie clip to
play at that frame but this nested clip doesn't play. I'm not sure
if I'm targetting the nested clip incorrectly or whether something
else is wrong with the code.
The .fla file can be downloaded at:
http://www.officelinkonline.com.au/Ad/
if someone would take a look. The movie clip in question is
on the layer called text5, and within this mc on frame 15 is the
code I'm trying to use to get the nested movieclip to play at that
point. The code used on that frame is:
this.innerText5_mc.free_mc.play();
stop();
pauseAnim = setInterval (this, "nextFrame", 4000);
I wondered if someone could take a look and see what I might
be doing wrong? Basically the free_mc clip just makes the word
"FREE" scale up.
Would really appreciated any advice.
ThanksThanks again. I'm a bit worried that you weren't able to see
the font that I used. All of the text used in the animations are
static text fields. I don't seem to have the option to embed these
characters since it's static text. It'll only let me embed if the
text fields are dynamic. Does this mean I have to change them all
to dynamic text fields, and if so do I need to embed the font in
every text field in every frame of the animation or can you do this
in one place?
Appreciate your continued help. -
Pause Playback for Nested Movie Clips
Anybody know a script solution for how to target pause of a
myriad of different movie clips from a button script on the root
timeline?
I'm using this script which works fine for pausing the root
timeline, but if I've passed off control to a movie clip, you would
have to press this button again to make the movie clip stop.
Here is the button script:
on (release) {
if (global_sound.getVolume() == 100) {
global_sound.setVolume(0);
stop();
Help appreciated. Thanks!kglad,
I mean I've issued a stop(); in the root timeline and now the
movie clip is going to play until it is done. Once it is finished,
I issue a resume back to the root timeline with a _root statement
and the playback continues in the root timeline. Essentially the
movie clips need to complete their playback and then they can
return back to allowing the root timeline to continue. -
Flash buttons and slideshow don't show [was: Please help]
hello all and thanks in advance
ive made my site using dw cs3 and all works perfectly on my hdd when i preveiw in i.e or firefox ,however when i upload the site to my server (justhost)
the flash buttons and slideshow do not apear ! dont know what i can do to reslove this so any ideas would be great and thanks again for reading
regards martin
[Subject line edited by moderator to indicate what the question is about]hi again and thanks so much
the file was there but the script folder it was located in was using a capital letter to start ...doh
again thank you so much
regards martin -
I am making a website based in flash actionscript 3.0 i have a button nested in its own movie clip, because I have the button expanding to be able to read it i have figured out the only way to do this is by creating it as a movie clipa nd inside the movie clip creating it as a button
I added an event listener to the blog button by saying,
blog.addEventListener(MouseEvent.ROLL_OVER,gotoblog);
function gotoblog(evtobj:MouseEvent){
gotoAndStop(2)
this part of the code works it goes to the 2nd frame of the timeline it is in and stops wich is a blown up version of the origanal symbol
i added on frame 2 a second command
blog.addEventListener(MouseEvent.CLICK.gotoblogpage);
function gotoblogpage(evtobj:MouseEvent){
gotoAndStop("blogframe")
trace("the blog button was clicked")
i have named the symbol blog and have name the frame of where the blog page is going to be "blogframe" this line of code at the bottom is where i run into trouble the output window in Flash is saying "The blog button was clicked" just like i want it to. no errors are accouring why than is the playhead not going to frame "blogframe"? if the button is working when i click it the code is right i belive the problem here is it does not want the playhead to go to the frame i want it to. So i gues my question is, how can i make a button withing a movie clip interact with the main timeline?I have a similar problem if could please help me i'd really apreciate it!!
So i have a looping animation of some thumbnails, the hierarchy goes like this
Scene1(main timeline) -> imgBar(MC)->imgBarB(MC within the imgBar MC)
My buttons symbols are in the last MC "imgBarB" where i have this code:
ss1.addEventListener(MouseEvent.CLICK, OneButtonClicked);
function OneButtonClicked(event:MouseEvent):void{
MovieClip(root).gotoAndStop("ssbox1");
I want to control the Btns in my "imgBarB" MC to play a labeled frame(named "ssbox1") on another MC on the main timeline,this other MC goes like this:
Scene1(main timeline)->ssbox_mc(MC where my labeled frame is) -
Trouble Copying and pasting a movie clip from another flash scene
Hello,
I have been trying to copy a movie clip from the library of one flash and paste it into the library of another. But when I do this, it always gives me, "One or more library items already exist in the document.
I have tried finding and renaming those items, renaming the existing movie clip, and even changing it into a graphic instead. Still it always replaces these certain movie clips in my main flash file.
I even tried the following:
Creating a new movie clip in the new file. Then going into the movie clip of the other file I wish to copy over, and trying to copy its frames and put it into the new movie clip i created in the main file. Even then, it says I'm replacing library items!
Can someone help me?
ThanksThe easiest way to be sure you are renaming everything is to probably to copy the movieclip into a new empty file's library and then rename each symbol in there. Unless I am missing something, when you do that, each isolatable symbol inside that movieclip will appear as a separate symbol in the library, making it easier to be sure you have renamed them all.
-
Nested movie clips and actionscript
I have this code set up:
/* This is to get the rollover menu movie clip */
this.profile_button.onRollOver = function(){
profile_button.gotoAndStop("on");
/* This is to get rid of the rollover menu */
this.profile_button.onRollOut = function(){
profile_button.gotoAndStop("off");
/* This tells where to go when someone clicks on menu 1 */
this.profile_button.profile_menu_1.onRelease = function() {
gotoAndStop("5");
/* This tells where to go when someone clicks on menu 2 */
this.profile_button.profile_menu_2.onRelease = function() {
gotoAndStop("10");
This is on the main timeline and menu_1 and _2 are in the
Profile_button movie clip. When I export I get the drop down menu
but when I click on the menu items it won't do anything. Any help
would be much appreciated. Thanks.i'm not sure what direction you were going with loading a
Movie Clip, but there are many ways you could go here, depending on
what sort of effect you would like as well. One simple way is that
you could have an invisible button underneath profile_button that
covers the screen which acts to remove the menu buttons(and itself)
on rollover. So in other words, rather than
profile_button.onRollOut, you're doing more like anything other
than profile_button.onRollOver... make sense? if that doesn't work
for you, you could check mouse coordinates every x milliseconds by
setting an interval... -
Animated drop down buttons not working in movie clip
Hi,
I am working on this site: (AS2)
http://www.steamandclean.com/Index_w_1.html
I have two types of drop down menu. One under Commercial and one under Technical
The buttons are movie clips. The drop downs are also movie clips that start in frame 2 and are triggered on rollover.
The child buttons are buttons living on the drop down movie clips. They are set to getURL
As you see they are not willing to neither link to any url or will they run their move clip animation. One is a button and one is a movie clip.
The left movie clip has a mask, but it makes no difference if I remove the mask . It also has a emboss filter and no difference is I take that away either.
All of it is in one flash movie right now, but I will be splitting it up in a master navigation movie and individual swf's soon.
Right now I have the main movie, then the button MC then the dropdown MC and in the drop down MC I have placed either a animated (button) MC or a button. So it nested in nested in.......
In both cases I scripting the child buttons like this:
on (rollOver) {
gotoAndPlay(2);
on (rollOut) {
gotoAndPlay(6);
on (release) {
getURL("http://steamandclean.com");
I have also tried to use
_parent.getURL and _root.getURL in stead of just get URL, but it does not work.
The drop down buttons seem to be buried. In the left side the whole drop down panel seems to act like a link?
What am I doing wrong?
Can you help?
ggaardeHi Ned
Thank you for your reply again.
I figured it out.
Your reply prompted me to have my main button on rollover to go to a frame number on the main time line and then move the content of the drop down movie clip to that frame.
The drop down panel now work and the child buttons animation now work as well. I just had to find a way to make the drop down panel disappear on rollout. Since I could not script the actual drop down panel I created three skinny invisible buttons and placed them on the right, left and button of the drop down panel. I scripted them to go back to frame 1 on both rollover and rollout. Done.
See the result there:
http://www.steamandclean.com/Index_w_1.html
(Left side only)
Thank you for your help.
ggaarde
Maybe you are looking for
-
Simple pass not working with Chrome
I've seen this posted numerous times (some posts going back to 2012) and I have yet to see an answer that works. I just bought a windows 7 machine with simple pass. Simple pass simply does not work with chrome. The only time it works is when I log o
-
Hi All, Pls guide me where the settings can be done to trigger an internal mail (SAP Business Workplace) at any user exit, like UD, QI01 Save, GR (MIGO) save etc. And what to do if I want to mark the same to MS Out look E-mail ID. With Best Regards,
-
Can I clone contact information to speed up the entry of new contacts?
I go to meetings and get business cards from 8 people at the same company. Once I put one contact in, much of the contact information is the same. Is there a way to clone a contact so that I just have to edit the name, phone, and email address so I d
-
Playing VIDEO_TS folders using DVD Player?
Hello, Right before I updated to 10.4.3, I had started using Mac the Ripper to download all of my DVDs to my external FW drive so that they all would be instantly available to me. They played just fine in DVD Player (I just chose File, Open, and chos
-
no deja repriducir al musica .