Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Controling Movieclip



What script should I put on the button action to make the movieclip which stays in a different frame (not where the button is) be played from the particular frame.

_root.movieclipname.gotoandplay(frame#); - plays only when the button in the same frame as a clip does...

Thanks a lot...



FlashKit > Flash Help > Flash ActionScript
Posted on: 09-16-2003, 03:47 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Help Controling A Movieclip Within Flash?
Hey,

Im a noivice at actionscript. Im currently using flashMX to produce game for kids to teach them the effets of light and water on plant growth. Ive done this by using buttins to increase/decrease the ammount of light, which will make a movieclip of a plant become more healthy looking, and vice versa! but it wont work!!!!

Firstly I created a 5 frame movie clip of a plant looking dead to looking healthy/growing and labeled each frame 1(dead) to 5(alive)...

Then i created buttons that will increase or decrease the value of a variable 'light' by 1.

I then used the following code within a movie clip called 'actions' to be placed off stage, which 'should' as i understand it make the movie of the flower growing move to the relevant frame as the variable light is changed

onClipEvent(enterFrame){
if (light == 1){
plant.gotoAndPlay(1);
}
else if (light == 2){
plant.gotoAndPlay(2);
}
else if.....ETC

I have no idea why its not working! can anyone help me or suggest a better way to do this?

Cheers

Adam
ca102680@ntu.ac.uk

Controling Movieclip Alpha...
I had this working before but somehow it was erased on my flash file and now I can't get it to work again.

on(release) {
stop();
alphacover.alphaTo(50, 2);
}

I had something like this code on a button, simple, it is supposed to make the instance MC alphacover go to 50% on release. Now I can't get it to work. It was working before so I know this is simple. Anyway I'm too stupid to get it to work again. Does anyone know what is wrong.

[F8] Controling When To Start A Movieclip...help
Hi there!

I need some help. I want to control when to start a movieclip from the main timeline.
Let me explain:
I have another movieclip playing and somewhere in there during that MC's animation I want to start another MC - MC2.
I've tried using currentframe but it seems like that only works when the playhead has stopped. Would be really cool to know how to do this during a MC's animation...on the fly so to speak....

Niklas

Controling The Direction Of A MovieClip
i need alittle help
.. the next issue that has been hammering me in the head is
This : i have created a map and and now i am able to scale it up and down .. that part is fine ..... but in order to give a person a detail view of the map .. i have to scale it to =800% .... but at that resolution the map is larger than the the the stage .... so i was trying to make the map move in the opposite direction of the mouse .... base up on how far from the center of the map_mc the mouse is.. in in all four direction .... for eg the map would move down if i move the mouse up
right if i move the mouse left . and so on ........ this would enable views to see different parts of the at 800% ... this link will give sample source file http://www.whatsinjamaica.com/map_movements.fla[/b]

Controling External Swf Loaded In A Movieclip
How can I control an external swf that is loaded into a movieclip using loadMovie. Thanks

[CS3] Controling Nested Movieclip From The Timeline
This seems like it should be so simple, but I'm still stuck. I want to tell a movieclip (about_mc) to gotoAndPlay it's second frame from the main timeline. about_mc is nested inside of map_mc.

This is what I have:

Code:
map_mc.about_mc.gotoAndPlay(2);
I'm getting this error when it tries to run that code:
TypeError: Error #1010: A term is undefined and has no properties.
at attempt8_fla::MainTimeline/startAnimation()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at fl.transitions::Tween/set time()
at fl.transitions::Tween/nextFrame()
at fl.transitions::Tween/onEnterFrame()

If anyone can help I would really appreciate it! Thanks

Controling A Movie Clip From Another Movieclip
I have a movie clip that contains a play and a stop button. And i want it to pause a movie clip that is inside another movie clip on the root.


on(press){
_root.initial.secondary.progressbar.stop();
}

WHY ISN'T THIS WORKING!!! What am i missing?

I am trying to make the "progressbar" movie clip pause when the play button is pressed.

Controling MovieClip With Action Script ARG...
I have a MovieClip I want to control with actionscript. I want when I mouse over a button it plays that MovieClip and when you mouse the movie clip goes back to the original state.

I want it to have a delay though when you mouse of, like it's timed in second before it returns to previous state.

What I have are my buttons sitting within this movie clip; so when user mouse over a hot spot the movieclip plays reveling the buttons and opn mouse off it hides then, but with a delay.


Thank you

Controling Scene From Inside Movieclip
Hello...

I have a movie scene (Main) that has a movie clip (MC) plaing in it...

MC has a button that is meant to dictate where in Main to go to; the standard "on release go to and play frame x of Main" does not work, I assume because it is not a seperate scene... can anyone tell me how to control a scene from inside a movie clip?

The Bird from Down Under
bigbird_3156@optushome.com.au

Controling A Movieclip From An Html Page In Another Frame
Hello guys!
This is the site that i am refering to: http://www.inwww.ltd.uk

What i want: In the footer of the page are several links.
When i press the home button for example i want to have the same effect as pressing the home button from the flash movie...over the flash movie not the html page that is changing if not there...using JS or something else.

Regards,
Dragos.




[F8] Sub-movieclip Controling Another Sub-movieclip
I have a button on a movieclip and I want this button to send a 'play' command to another movieclip of same level. I thought I should just use the following code:

on (release) {
play();
gotoAndPlay("_root.screen", 12);
}

where screen is the instance name of the movieclip to control, and 12 the frame at which I want it to start playing.

I have also tried attributing a variable to the pressing of the button (ex:test=1), so that when this variable equals the right value, the movieclip starts playing, but no luck with that either.

Controling Mcs From One Swf To Another Swf
Hey guys need some help

I have five swf all on there own levels. On level0 I have a set of buttons that load swf into level1 and level2.
In level1 I have a menu, which tells the content in level2 what to do.Now the content in level2 is never the same, it depense on which button on level0 is pressed, to determen the content in level2. But the menu in level1 is always the same.

Now my problem is that the menu on level1 is hidden until a button on level0 is pressed and then animated to reveil itself. Now I have a loadmovie script level1 and level2 on each of the buttons in level0. However I only want the swf in level1 to load once.

I know it sounds confusing but if any one can help me that would be great.
Thank you
Malachai

Controling Mcs From One Swf To Another Swf
Ok need some help on a tough problem.

I have an animated menu that is set to open once when a button on the parent level is pressed.
however there is a home button on the animated menu that tweens in back to its hidden position when pressed.
The problem is when the button on the parent level is pressed after the home button, the menu doesn't open.
The menu is on a different level and i have tried to Unload the swf and it doesn't what to reset the menu. Here is the script I am using for the button on the parent level

on (press) {
if (_root.ctr<1) {
loadMovieNum ("menutop.swf", 2);
_root.ctr++;
}
}
Thank you to any one that can help me.

Controling Swf From Another Swf
Ok here's the deal!

I have a web site built in dreamweaver with 2 seperate flash menu's. What i need to do is control one menu from the other.

the top menu is to navigate the user to specific pages in sections, displaying the section title at the top.

Now the second menu is a side menu that performs a quick jump to pages within specific sections.

what I want to happen is when the user uses the quick jump menu i want the top menu to display the section the user is in.

any help is well appreciated.

Controling MC
hi

i want to be able to tell a file.swf to which i have loaded into a movie clip to stop playing and then play when hit a button

i have tried for hours with different ways and now its driving me mad

i have been using code like this:

_root.mc_instance.stop(); // (from the timeline for this)


HELP
cheers

Controling A Swf
Hi
I have a separate animated swf file that has no interaction but just plays through its long sequence of frames.


But now i want some buttons on top of this swf that will allow me to jump forward or backwards 20 frames at a time.

I gues this is going to invole layers but i really don't know where to start.


Can anyone point me in the right direction?

Controling One Mc From Another
Hi,
I've got two movie clips, one with buttons in it, and one with images in it, they are both on the stage. Say they are called "alpha" and "beta". What I want to do it press a button from "alpha" so that it changes the image in "beta". I thought I'd attach this line to the button in "alpha"

_root.beta.attachMovie(test1, test2, 1)

but it doesn't work. Any ideas on how to control one movie clip from inside a different movie clip?

It's not the attachMovie part I'm having trouble with, it's the communicating with the second movie clip.

Controling A MC With AS
I am trying to change the x and y scale of an MC with a transperant button, however I want the MC to stop at a fixed x and y scale.

So if my MC instatnce is named (clip_mc)

I have tryed this on the root time line on a layer called actions.

clip_mc.onEnterFrame = function() {
if (scale) {
clip_mc._xscale+=5;
clip_mc._yscale+=5;
}

then of the transparent button I ASed

on (press) {
_root.scale = true ;
}
on (rollOut, dragOut) {
_root.scale = false ;
}

This works but I now need to get clip_mc to stop at a fixed x and y scale.

Any help is appreciated,

sandokel

Controling One Swf With Another?
if I have two swf movies in same frameset, but different frames, can I control one from another?

let say that Mov1 has a botun which controls MovieInstance in Mov2,
each in it's own html frame.

thanx

Controling One Swf From Another.
Hi there,
I'm not sure how to word what I'm trying to do so I can't find info on how to do it...

Here goes.

I have one html page with two different swfs on it (or would like to).

Id like to have it so when an action happens in one swf (in this case a menu with buttons gets moused over) it causes an action to happen in another swf. I know how to do it when there are multiple movies all in one big swf file but not from one swf to another.

Thanks in advance for the help.
Thanks.

Controling One MC By Another...
Hi everybody

I got a small MC that's like a squer on a brain, i need that squer to be dragable, and whan i drag it, it controls a biger MC thats behind a mask (so i can see only part of it at a time)- basicaly- whaen i move the squer left, the biger MC moves left...and so on.
Can anyone direct me or tell me how can i do it?

Thank you
Michael

Controling One MC By Another...
Hi everybody

I got a small MC that's like a squer on a brain, i need that squer to be dragable, and whan i drag it, it controls a biger MC thats behind a mask (so i can see only part of it at a time)- basicaly- whaen i move the squer left, the biger MC moves left...and so on.
Can anyone direct me or tell me how can i do it?

Thank you
Michael

Controling MC With MC
Hey all -- tell me what I'm doing wrong (because I got about 5 Flash Books here and I'm stuck)

I'm trying to gotoandPlay a movieclip with another movieclip and it's not working out.

This is what I have so far on the button type MC:

on (release) {
_root.stickerMC.gotoAndPlay(1);
}

OK -- what am I doing wrong -- help!

Thank you.

Controling The Other Swf From The Other Swf...
hi, how to control the other sef by a click of a button from other swf???
i wanna create a website with multiple swfs inside a main big swf. and i wanna like, click a button at swf C that moves something at swf G...

do i use the _root. comand??? and i saw a _global. comand... what does it do?

hope u guys know what i mean... thanks


thanks alot.

Controling Mc From Another Mc
I'm using actionscript 1.
I want the "home" menu button to also control a second mc. It's instance name is pl7_main. It's a secondary menu that needs to reset to frame one when home is pressed. The home button is inside another mc. What's the best way to do this?

Controling One Swf From Another
Hi

I have an idea to make portfolio view-er for my site and implement it in with help of dreamweawer. But i would like to create another swf ( like menu swf) to control images in portfolio swf.
Is that eve possible like i have imagined it? To control content showing in one swf from another on same page of same site?

tnx fror responses....

regards

Luka

Controling Several Swf Help
HI there, iam new to flash and i have an idea about swf file
what i want is have a menu, say a,b,c,d and i want each heading to pull out the related swf file and load on a seperate level. but when i click on another menu title the swf closes and the new one loads.
The trouble is that i have the swf files loading on seperate layers, but i want the menu to detect which later has an swf file on it and closes it....does that make sense.

Controling Mc
First of all, thanks for all the help.
U´ve being great!

My q is...

How do I make a button to control a mc to start playing?

thanks

Controling
I have two SWF .One is Parent.swf and the other is Child.swf.I successfully loaded the Child.swf into the parent.Now I want to control the Child.swf from parent ,using ActionScript. How to do this Please help !

Controling Swf's
Hi everyone,

What I want to do is:

I have 2 swf's one loaded in level0 and another loaded in level1 (called from the first one). I want to put a button on the second swf that would control the first one by telling him to go to an exact scene and frame just like the gotoAndPlay action.

Is this possible?

Controling Swf Within Clip
Help!

Let's see if I can describe this problem...
I've got a movie with 2 movie clips, one contains my menu buttons, the
other, whose instance i've named content, is essentially empty. I am able to
load swf movies into the "content" clip based on the button the click in the
menu clip, using the following script:

on (release) {
stop ();
loadMovie ("home.swf", _root.content);
}

I want to be able to control the movie (home.swf) based on the button that
the user clicks on- have it go to a specific frame/label right away... is
this possible?

Any help would be really appreciated!

Thanks!
AJ
chocochipp@aol.com

Controling Speed
is there a way (besides changing the frame rate and adding 400 hundred frames) to control the speed of a mc that moves right to left across the screan with action script??

Controling GetTimer() ---------- HELP
Is there a way to start and stop this function at will.
I have it on the second frame of my movie with a stop on the first frame. I want this timer to start when the user gets to the second frame. The way it works now is that if the user is on the first frame for 20 second, the timer will start at 20 seconds.

Controling Movies
Those who know what they are doing may laugh at this but im a bit of a newbie with flash 5. I want to know how to control the parent timeline from the timeline of a child that was made with the loadmovie command. My real problem is that i have a button which loads another movie and stops my main timeline. At the end of the loaded movie i placed an unload, so it disappears. My problem is that i cannot get the main timeline to play again. Any suggestions?

Controling Volume
is there a way of controlling the volume of a piece of music by pressing keys

for example.... when pressing 1 the music would be off and the higher the number u press the louder the music gets

hope u can help

Controling External Swf's
What's up Peeps!

Me got this little prob. See I got an external video loading and playing on the main time line(main time line pauses here), but when it stops I want the main time line to continue runing. Any one have any ideas for the script.

Cheers!

Controling Movieclips
Hi,

I'm working in flash MX and I have my page set up with the content in different movieclips that I load with "attachMovie"

But here's where I'm running into the trouble.

I don't want the next clip to load until the "fadeout" is done. (the fadeout is the last of the frames)

I have the movieclips set up with frame labels so (ie:"start", "hold", "fadeout")

So, I sort of have it working with this:

if(currentframe == totalframes){
contentBox.attachMovie("newclip", "attached", "_level0");
}

Is there an easier way to check if the clip is finished, and then load the next one? Is this just a bad set-up?

I'm having trouble debugging the site because of the "if" statements in there and I think it just looks sloppy - I'd like have all the code built into the functions rather than checking if the clip is done every time we enter a frame - regardless of if they pushed a button or not.

Thanks for any help.

I hope my question is clear and makes sense - I've been working on this for a while and I think my eyes are turning square

Here's the actual code from my fla:

Code:

siteSections = new Array("about_us", "contact_us", "our_services");

function switchContent(newPage){
newContent = newPage;
if(contentBox.attached != undefined){
contentBox.attached.gotoAndPlay("out");
}else{
contentBox.attachMovie(siteSections[newPage]+"_content", "attached", "_level0");
}
}

if (contentBox.attached._currentframe == contentBox.attached._totalframes && contentBox.attached != undefined) {
contentBox.attachMovie(siteSections[newContent] + "_content", "attached", "_level0");
}

about_us_but.onRelease = function() {
switchContent(0);
}
contact_us_but.onRelease = function() {
switchContent(1);
}
our_services_but.onRelease = function() {
switchContent(2);
}



[Edited by Thursty on 06-25-2002 at 03:24 PM]

Controling MC From Different Scenes
Can you control a MC i.e a toggle button that is in Scene 1. From a button that is in Scene 2?

Controling My Audio
Check it out. . .


I got a flash peice that has sections with a voice over situation. There is background music as well. I have buttons that turn off the background music but NOT the voice over.

How do I script the actions to turn on/off CERTAIN sounds BUT NOT ALL SOUNDS.


The way I have it set up now is:

background music is exported as a symbol "background"
Voice over music is exported as a symbol "voice"

when I turn the background music off. . it turns everything off. . . same with the voice over button..

How do I control this?


HAPPY 4th everybody!!!
[Edited by Apollo Becate on 07-04-2002 at 03:58 PM]

Controling 16 Mc's Through Array
Hi,

I've got a randomly filled array: pause_values, which sets the playback speed for 16 movieclips: dag0 to dag15. It may look like this:
0:900,
1:500,
2:900,
3:500,
4:700,
5:300,
6:300,
7:100,
8:300,
9:200,
10:300,
11:800,
12:0,
13:200,
14:500,
15:900

I want the pause_values to control their corresponding dag# mc speed. I use this code in a separate control mc: myframerate
Frame 1:
startTime = getTimer();

Frame 2:
i = 0;
while (i<16){

if (getTimer() - startTime > pause_values[i]) {
_root.alles["dag" + i].gotoAndPlay(_root.alles["dag" + i]._currentframe + 1);
this.gotoAndPlay (1);
//trace(pause_values[i]);
}
i++;
}

The problem with this code is that it only starts the dag# mc with the lowest pause_value. In the array above it starts only mc dag12. When there are more then 1 mc at the lowest rate, it plays all of those. But I want the code to loop through all the dag# mc's and start them at their own speed.

Hope I've made myself clear.
Can someone please help me to adjust the code?

TIA, Danielle.

Loading And Controling Jpg's
i want to load multiple jpg's into my movie. so far i have been able to load them, and control their size, but i want to be able to click on them and have them open up in a new browser a bigger version of it self, like thumbnails. here is my code.

this.createEmptyMovieClip("pict1", "host1");
pict1.loadMovie("pictures/kyle.jpg");
pict1._xscale = 22;
pict1._yscale = 16;
pict1._x = 15;
pict1._y = 80;
pict1.onRelease = function() {
getURL("kyle.html", "_blank");

btw-i am running flash MX
Thanks

Controling Nested..
Hi,

is there a way to controll all nested MC's all at once?

for ex:
...
_root.container."all-it's-children".gotoAndStop(1);
_root.container.thisonespecific.gotoAnddosth-else(1);

the second line is no problem of course. It's the first one i'm stugling with.
I thought there was sth. like Child?
For the record, still using 5.


thanx
Koen

Controling Sound
i have created a stop and play buton which is controling a audio loop on my current website. But how do i get the sound to loop automatically without the user having to press the play button for it to play. whilst still having the option to stop it.
thanks to all
tony

Controling A Swf File
Hi _ Thanks for read my POST

1.- I have 2 swf in one HTML page one x.swf (movie control) control the other target.swf calling the name of the frame.

2.-when target.swf is one frame he load other movie using LOADMOVIE.

3.-The new movie ( inside TARGET.swf) also has frame names but when I try to control this one calling in the same way the name of the frame I CANT. This is my problem.

x.swf ---contol--->target.swf <-ooo-loadmovie-ooinside.swf

*in x.swf I use
labeltogo = "r1";
getURL("javascript:go1()");

How to call the frame name of the inside.swf movie?

THANK YOU!

Controling Buttons?
Ok, Im trying to figure this out and am haveing no luck looking at the tutorials or posts, hope someone can help me out. I have a swf that has a bunch of buttons in it that are all converted to mc's. Now I only want certain buttons to show up when in a projector I have sends a variable for that button to my cgi stateing lets say button1 on. here is what I have on my button1

onClipEvent (load) {
if (_root.button1 == "on") {
this._visible = 1;
} else {
this._visible = 0;
}
}

this works fine when I am playing around and in the first frame of my time line I type this in.

button1 = "on"; or button1 = "off";

My ? is, what do I need to do to have this load from a cgi. Do I need to have a invisable mc that these statements are loaded into like a bunch of dynamic txt boxes each with a label like button1, button2, and so on then have my buttons read those txt boxes. Hmmm the more I type then the more that seams to be the way to do it. well I will give it a try at least. The second part of this problem is I want to have radio buttons that people can select for the buttons to be on or off. other words button one Then two radio button one on the other off. How do I figure out wich one is checked and wich variable it will send to my cgi script? Hope somone can understand my rambling here LOL

Controling Layers
Ok, I am makeing several "draggable windows" within flash. I have a number of different things that may be up on the screen at any one time. Now there is only a need for one window to be "on top" at any one time. However I found that the setfocus command will not allow me to specify what I would like to be at the top. What I'm meaning is, look at the windows. If you have several programs open, they are in seperite windows, by selecting a different window, it makes that one pop up to the front. Thats what I want to do with thies seperate windows. I want to contol what window will appear on top of all other windows. These will change from time to time, so while one window will be up top, it may be at bottom a little later. Right now, anything in the front, stays in the front, and anything in the back stays there. How can you control whats in the forground (in front/top), and whats in the background(bottom/back)?

Sparkyfire

Controling Scenes
I am learning flash and have got some way, using some useful resources from your website. Now I have built up a large'ish site. Is there anyway to control scenes loading to reduce download times. So the scene only loads when you click to go to it. I can make it work using seperate files with the loadmovie actionscript. thanks for your help.

Controling A MC With Actionscript
I want to click a button, which I have placed on the root timeline, that will move a MC with the instance name clip_mc, but once clip_mc moves along the y axis i want it to stop at a specified point along the y axis
This is what I have tried:

//frame 1 on root timeline action window:

clip_mc.onEnterFrame = function () {
if (move) {
clip_mc._y-=5;
}
}

//then on the buttons action window:

on(press) {
_root.move = true;
}

This moves clip_mc, but I do not know how to make it stop at a fixed coordinate.

please help

Kelly

Controling Flash From VB
Is there a way to send commands to flash through vb? When I stop my movie in vb the animation parts stop but the music continues.

Copyright © 2005-08 www.BigResource.com, All rights reserved