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




Movieclip Control (if Statements)



Hey guys,

So basically I'm building a site. When you click one of the menu items it
loads the page using the 'with' command.

Example:

About button

with(_root.about){
play();
}

So when you click a button it makes the movieclip play,
then when you click the button again or the close button
the movieclip plays again and it dissapears.

What I am looking for is when you click a different button
if on of the other pages is open it closes then the new one opens
so you dont get the overlapping pages.

I think I need if else statements but have no idea of how to go about it.

My fla file is attached.

Thanks in advance.



FlashKit > Flash Help > Flash MX
Posted on: 10-04-2005, 08:18 AM


View Complete Forum Thread with Replies

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

Movieclip Control (if Statements)
Hey guys,

So basically I'm building a site. When you click one of the menu items it
loads the page using the 'with' command.

Example:

About button

with(_root.about){
play();
}

So when you click a button it makes the movieclip play,
then when you click the button again or the close button
the movieclip plays again and it dissapears.

What I am looking for is when you click a different button
if on of the other pages is open it closes then the new one opens
so you dont get the overlapping pages.

I think I need if else statements but have no idea of how to go about it.

My fla file is attached.

Thanks in advance.

Moviclip Control (if Statements)
Hey guys,

So basically I'm building a site. When you click one of the menu items it
loads the page using the 'with' command.

Example:

About button

with(_root.about){
play();
}

So when you click a button it makes the movieclip play,
then when you click the button again or the close button
the movieclip plays again and it dissapears.

What I am looking for is when you click a different button
if on of the other pages is open it closes then the new one opens
so you dont get the overlapping pages.

I think I need if else statements but have no idea of how to go about it.

My fla file is attached.

Thanks in advance.

Loading Multiple SWF In A Movieclip Using Conditional Statements
Hello all,

I'm an actionscript beginner and having some trouble figuring out how to do what I'm trying to do. Is there anyone out there who can help? I've been searching for an answer but I haven't come across anything that seems to be working.

I'm trying to load several different SWFs in a movieclip on the stage at different times using conditional statements, all dynamically through actionscript. I've never done this before so I'm not sure how to even get started. What classes do I need to import first? How do I use the Loader class? Then how do I get each SWF to run as part of a conditional statement?

Sorry for all the questions, but I'm a novice. Thanks in advance for anybody who can give a suggestion!

Control A Nested MovieClip From A Button Component Inside A Seperate MovieClip.
I am a beginner in using Flash and Action Scripting.

This is the Scenerio:

I want to control a movieclip that is inside of another movie clip.
I control it from a button component that is inside of a seperate movie clip.

test = button component instance name
test1 = function
test2 = Movieclip instance name
test3 = Movieclip instance name
testbutton = movieclip name where button component is located

I am able to control a movieclip on the main timeline with the following AS 3.0:

test.addEventListener (MouseEvent.CLICK, test1);
function test1(event:MouseEvent):void
{
event.target.root.test2.gotoAndPlay(2);
}

I want to control a movieclip inside MovieClip1.

I tried this:

test.addEventListener (MouseEvent.CLICK, test1);
function test1(event:MouseEvent):void
{
event.target.root.test2.test3.gotoAndPlay(2);
}

The movie loaded fine when I tested but got this error when I pressed the button:

TypeError: Error #1010: A term is undefined and has no properties.
at Untitled_fla::testbutton_26/test1().

Please help!!!!!!!!!

Super Newbie Question: Using Multiple IF Statements, For One ELSE Statements
What i want to make ... is

on (release) {
if (part.text == 1) {
gotoAndStop(random(1)+4);

if (part.text == 2) {
gotoAndStop(random(2)+4);

} else {
gotoAndPlay(33);
}
}

that doesnt work for some reason.. Any ideas why? Thanks!

Control/sinc Video Movieclip And Text Movieclip
Here´s a tricky one:

I need to sincronize/control a movieclip with texts and a swf (a video) that I loaded, both on the main timeline.

I have a swf (a video) that I loaded in a movieclip into my flash file and a movieclip with texts in it. Both are on the main timeline. Trouble is if the movie is playing and I want to pause it, for example, the swf video pauses but the texts movieclip keeps on playing. If I rewind it, the swf video goes back, the text movieclip still keeps on going. You get the picture.

For control I´m using a camtasia component - camtasia is the software I made the video with. I´m not putting the movie straight into the flash file because the swf made with camtasia turns to be way smaller that if I just loaded into flash.

I´ve attached a txt file with the controller script. Also i´ve put for download the flash file i´m talking about (flashsinc.zip) so you can better understand what I mean. Here´s the adress:

http://www.altoqi.com.br/temp/flashsinc.zip

Thanks a lot.

[F8] Control Movieclip From Button Inside Another Movieclip
ok. I have the Main Timeline..on the stage i have "side_menu_mc" inside that i have "menu_menu_mc"."slider" is menu_menu_mc's Instance name.

Inside "menu_menu_mc" i have a button (services_btn)."button_1" is its instance name. Upon clickin on this button, i want a frame labelled "services" (frame 18) in "side_menu_mc"'s timeline to display.

i attempted this.after some googling.but it does sweet nothing.


Quote:





Originally Posted by my shizer code


menu_menu_mc.services_btn.onRelease = function() {
trace("button pressed");
_root.gotoAndStop("services");
}

Control Movieclip From Button In Another Movieclip
I've been searching and searching for the answer to this newbie problem, but I can't find it, so I hope someone won't mind pointing me in the right direction.

I have 5 buttons within movieclip (1); movieclip (1) is located on the main timeline. I'm trying to get the buttons to jump to a certain frame of movieclip (2) which is also located on the main timeline.
The code I've been using for, say, the first button is:

Code:

Code:
on (release) { _root.mainwindow_rooms.gotoAndPlay("lounge"); }
"mainwindow_rooms" is both the library name and the linkage identifier of movieclip (2). It doesn't have an instance name on the stage (is that relevant?)

I can't get this to work. Can someone please help me with this? I have no idea what I'm doing wrong, I'm not very good with Flash.

Movieclip Control
lets say if I have a APPEAR button set to on release: telltarget "instancename" gotoandplay frame 10.

The movieclip "instancename" has already been loaded in the same level as the APPEAR button but action has been given to go to stop at the beginning of that level. When the APPEAR button is being click now, the "instancename" will play and it will cover the current button and hide it.

How do I set actions to another "back" button in the "instancename" movieclip so that it will unload and show up the APPEAR button in the previous level again?

Hope I make sense.

Thanks

Control Movieclip
can anybody help me with the script to make a button on my main movie play a movieclip inside a movieclip? cant figure it out. i just need a button to tell a movieclip to goto and play. anybody?

thanks for your time,
j-son

How To Control A Movieclip Outside Of It?
i have a button on the main stage and a movieclip. Now wich string do i need for the button to start playing the movieclip from frame nr.91 for example???

i've tried this
with "can" as the movieclip instancename

on (rollOver) {_root.can.gotoAndPlay(91);
}

MovieClip Control
I'm trying to get a similar effect to the fly mc on this site:

http://www.24-7media.de/

When you touch the fly with the cusor, it plays. Then stops and waits to be touched again to play the next segment of its timeline.

My problem is that I can only make it continue to play if it IS being touched. Once it flys away from the mouse the if hittest statement I'm using is no longer true. So that's obviously not the right direction I should be going with this. I'm stuck.
Any ideas?

Movieclip Control
say you have a button on level 20, How do you tell the movieclip "ball" on level 10 to go and play a specific keyframe?


Thanks in advance!

Movieclip Control
Hello everyone. I am building a menu that involves having several buttons nested inside a movieclip. Inside the movieclip , the buttons alpha increase from 0 to 100 while they move into position on the stage. I put a stop() command on the last frame of the movieclip. This part is simple, heres where i get confused. Behind the movieclip,on a seperate layer, i have an invisible button. On rollover, i tell flash ,

_root.menu._visible = true;
_root.menu.play();

(menu is the instance name of the movieclip). This works fine except as the mouse continues to move from one button to next the script keeps looping, causing the movieclip to play over. I understand why its doing it, the invisible button loses focus when the user rollovers one of the nested buttons, then whey they rollover the invisible button it runs the script again. Is there a better way to this ?

Movieclip Control
hi, i'm having trouble controlling movie clips that are within my main movie using a button. i need to be able to play them and choose which frame to play them at but all i can figure out is how to change their properties ie. visibility and alpha value. can this be done? if so how. thanks for your help.

jeremy boyd

MovieClip Control
HELP ANYONE!!!!!!!!!!!
I am new to Flash and my background is really in print. So I'm trying to expand my horizons, but FlashMX is giving me a headach.

I have a movieClip(MC) navbar on my stage. In navbar is is a MC navslider that consists of 8 buttons. navslider is also behind a mask that will limit what is seen on the stage. Also in the navbar is a MC 1101 that contains 2 layers/3 frames(1-blank, 2-MC 1101-over, 3-MC 1101-out) each frame has a stop action.

I am trying to make the rollover/out happen in the navbar so that the mask is not in the way. This is my code that will not work:

on (rollOver) {targetPath(_root.navbar.1101){gotoAndStop(2);}
}
on (rollOut) {targetPath(_root.navbar.1101){gotoAndStop(3);}
}

I get
**Error** Symbol=navslider, layer=Layer 1, frame=1:Line 3: ')' or ',' expected
on (rollOver) {targetPath(_root.navbar.1101){gotoAndStop(2);}

I want the rollover to play one clip and rollout to play the other.

1101 is the name of the MC that has the Over and Out MC and it is the name of the instance of MC-1101 on the timeline for MC-navbar.

I have also tried to put it on the main timeline and just call it to the _root. and I've tried without "targetPath" but nothing works.

Then to add to the injury I want the _x value of the MC 1101 to alway be the same as the button that controls it. The buttons slide back and forth so you can only see 3 at a time.

Movieclip Control
Hi all

I have created two buttons which in turn control two movieclips

button A controls the fade in and out properties of called "content"
button B controls the fade in and out properties of called "content2"

I have been able to tell button A to fade out the movieclip called "content"
and then to fade in the movieclip called "content2"

I can also tell button B to fade out the movieclip called "content2"
and then to fade in the movieclip called "content"

What I am struggling to do is when you FIRST press either button at the start to just play that buttons specific movieclip e.g

button A = mc_content
button B = mc_content2

I know that I am needing a conditional statement of some sort but I got no clue on how to approach it. Any help, advice examples etc would be very helpful to me

thanks all

w9914420

a sample of my file

Movieclip Control...
I know it's a pretty simple question, but I can't remember how to do it. I have a movieclip that I've dragged onto my main timeline and have a button movielcip that I want to, when clicked, have play the contents of the other movieclip on the main timeline. Do I have to give the movieclip instance a name or what? In the end, this entire swf will be loaded into another swf, so maybe _root won't work? I dunno. Any help would be great! thanks!

Movieclip Control
Not sure if this is possible but here goes...Is there any way to play a movieclip to the end then have it play backwards, back to the start again.

Control A Movieclip
Hi,

I've created a presentation which is in a movieclip called "Presentation".

Now I need to create controls for the movieclip.

I need the following controls:

PLAY/PAUSE (this I can do)
Go back to the beginning of the movie (this I can also do)

But I need to create a progression bar, which I can grab with the mouse and scroll back or forward anywhere (while the movie is played) - how is this possible? Also I would like the progression bar to go from 0 to 100 % as the movie is loaded?

Will appreciate any help or references :-)

Cheers,

Mads

How To Control One Movieclip From Another?
I have 2 movieclips on the stage. When i get to a certain frame in one movieclip, I want it to tell the other movieclip to stop. How do I do this? Let's call them mc_1 and mc_2. On frame 10 of mc_1 I was trying to call:

MovieClip(this.parent.mc_2).stop();

but I get an error that says "1119: Access of possibly undefined property mc_2 through a reference with static type flash.displayisplayObjectContainer."

Both movieclips are on the stage in the same frame. Can someone help? This should be simple but I don't know what I'm doing wrong.

[F8] AS2 MovieClip Control Help
I have the movie clip moving left right a decent attack

But....

how do i keep him facing left when i have pressed left key and vice versa

And before anyone says i have tried myself and it didnt work

it failed..... Epically

below is what i have just for those who might have download or saving problems


Code:
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x += 8;
this.gotoAndStop(3);
} else if (Key.isDown(Key.LEFT)) {
this._x -= 8;
this.gotoAndStop(2);
} else if (Key.isToggled(Key.SPACE)) {
this.gotoAndStop(4)
} else {
this.gotoAndStop(1);
}
}



Its for a Spirte game i'm making just need a little help

MovieClip Control...
I'm only a newbie as'r I know how to load movieClip externally/internally. But what I'm trying to do is load an animation onRollover from a nav, then when I onRollout I want the animation to reverse.

But not only this I want it so that when I'm rolling onto another btn in the nav the animation will 'wait' untill the previous reverse animation has finished.

Can anyone get me started on this??

MovieClip Control
This one is easy, I am sure. So here goes.

In my main timeline, I have a movieclip attached to a frame. When a button is released, the playhead goes to this frame and plays the movie. This is where I am having a little trouble. When the movie is done, I want the playhead to go back to my scene and play the next frame. How do I do that?

Any help would be great.....THANKS! I love this site. A lot of helpful people.

Control A Movieclip
Maybe sound very basic but right now I'm

If I have a movieclip that I want to start and when that have done I want my actionscript do something else

Like to have so much actionscript in same place

Control Movieclip
i want to so something ,it's that when my mouse cursor is over it(mc),it will go from a to b,which a is the starting point and b is the end point.i know how to do it using tween but how to do that in actionscript because i'm might want to use some easing effect on it.

AS3 MovieClip Control
Hi All,

I have a counter on a boardgame counting through spaces in an array.

when the chip reaches space 36. the chip.visible=false, animation plays, chips position is moved to space 2

//This plays the movieClip
this.ani_99.gotoAndPlay("Start");

At the end of the movieClip animation which is 65 frames long i want the chip to become visible

Anyone know how? in actionscript 3 cheers Dan

AS3 MovieClip Control
Hi All,

I have a counter on a boardgame counting through spaces in an array.

when the chip reaches space 36. the chip.visible=false, animation plays, chips position is moved to space 2

//This plays the movieClip
this.ani_99.gotoAndPlay("Start");

At the end of the movieClip animation which is 65 frames long i want the chip to become visible

Anyone know how? in actionscript 3 cheers Dan

Movieclip Control
Hey guys,

So basically I'm building a site. When you click one of the menu items it
loads the page using the 'with' command.

Example:

About button

with(_root.about){
play();
}

So when you click a button it makes the movieclip play,
then when you click the button again or the close button
the movieclip plays again and it dissapears.

What I am looking for is when you click a different button
if on of the other pages is open it closes then the new one opens
so you dont get the overlapping pages.

I think I need if else statements but have no idea of how to go about it.


Thanks in advance.

[AS2]How Do I Control The Fps Of A Movieclip
I am trying to control the speed of multiple movieClips. Each movieClip has to run a different rate of speed. What is the best way to accomplish this?

Thanks
Scott

[AS2]How Do I Control The Fps Of A Movieclip
I am trying to control the speed of multiple movieClips. Each movieClip has to run a different rate of speed. What is the best way to accomplish this?

Thanks
Scott

Movieclip Control
Hi.
I have 2 movieclips, both feature some buttons. In my main movie I want a button that is within movie clip 1, when clicked, to show and start the other movie clip. What is the best way to achieve this (in Flash MX) ?
I am not sure about best practice in Flash so am getting in somewhat of a muddle.
Many thanks if you can help me.
Andrew.



Movieclip Control
I am a rookie ActionScripter who has a question about dynamically controlling movieclips. I am trying to make a movieclip play using the hitTest function while it is nested within another movieclip that is being moved around (horizontally) by a slider menu control.
I am using movieclips that represent events on a time line (a graphical representation of years, not the Flash TImeline), and as those squares move -in response to input from the slider control, which is keyed to the parent movieclip- across the vertical center line of the screen, they should expand (and contract again when they move out of the center line, but I haven't gotten to that part yet). I have tried to use the hitTest function to respond to either an invisible movieclip stationed in the middle to act as a "trigger" for this action for each movieclip as they are scrolled across, or to a point. I have also tried to write code that would the use the ._x property of each movieclip to trigger the action. For example:

onClipEvent (load) {
inside = _root._x + 265
outside = _root._x + 285
}
onClipEvent (enterFrame) {
if (content.item2._x > inside || content.item2._x < outside) {
content.item2.gotoAndPlay(2);
}
}

this doesn't seem to work at all. The hitTest hasn't worked much better. I know that I probably have to do something to convert coordinate spaces but I am at the limits of my experience. Is there a problem making the I am assuming that once this is working the way I want it to, it will be relatively easy to duplicate the effect for all the item movieclips; any hints on that would be great. I realize that there is a way to use the xScale and yScale properties to accomplish the scaling effect that is simply animated here, but I'm in over my head as it is. Any pointers in the right direction would be greatly appreciated.
I'd be glad to email the FLA to anyone who wants to see it firsthand. Thanks

MovieClip Control
I want to control different MovieClips using the if statment (i think).

I have 4 MovieClips I am using for site navigation, each MC will be dependant on each other. For example if I activate one MC the other three MC's must be able to restore the MC I activated to it's original state, whilst activating itself. How do I use some sort of logic to acheive this.

I apologise if this meesage is confusing - if somebody get's the jist of what I am trying to achive please reply and I will try to elaborate further. Thanks

Movieclip Speed Control?
Hi,

I have a movieclip containing an animation. I want the animation played slower than my original movie speed. Is it possible to do that with actionscript?thanks in advance!

How Can I Control An External Movieclip
hey.


can anybody help me?

i have my main menue (level 0 ) and want to control the movieclip (level 1) which i load into my main flashmovie.

Control Every Movieclip Without Have To List Them
when you stop the timeline of a movie the movie clips carry on, is there any way to attach a funtion to a button that pauses all the movie clips too?
I tried: -

on (keyPress "p") {
tellTarget ("movie1") {
stop();
}
tellTarget ("movie2") {
stop();
}
}

... and so on, but the problem is i have to list every movie clip in this way. Was just wondering if there's a way to say: -

on (keyPress "p") {
tellTarget ("ALLMOVIECLIPS") {
stop();
}

Thnx for the help again

How To Control Frame From One Movieclip To Another
please help!

this is what i want to do: somemc.gotoandstop(4);

however that script is being carried out by a button thats in another movieclip, and nothing happens.. don't know if this is making sense..

like i have:

/ some_mc
scene1
some_other_mc

so how do i secify the path if it needs to go back one, like back to the parent, then out to a different child? please reply if i need to clarify, thanks alot!

How Do I Control Embedded Movieclip?
probably simple question for most of you...
but since I never really find the time to learn actionscript - I always struggle.

HOW can I get a button on the main stage to control (i.e. play/stop) an embedded movieclip? Is there a way at all???

I have a short video sequence as a movie clip on my main stage. I'd like to add some controls that would enable the viewer to pause and play again the movie.
Now I think everything would be quite simple IF my control panel wasn't a fold out menu. I put the menu together on my main stage - as this is the only way I could get it to work properly...

Any advise anyone? (plz)

(newbye) Control Movieclip
I've a movieclip, stopped in its frame 1.

In a precise instant, I want the movieclip (called ue) goes to frame 5.

I tried this, but doesn't work:

_root.eu.GotoAndStop(5);


How can I do it?

Tnx in advance.

Control Movieclip By Mousemove
Does anybody how to do it?
I've seen it on this page:
http://www.janvision.com/yulia/eng.htm

When you move right or left with the mouse over the movieclip, the animation goes forward or backward frames.

Movieclip & Button Control.
Okay,

I have a menu option called portfolio with the options, Music and Advertising.

Portfolio is a button, with an animation movieclip in layer 1 placed inside the over action area of the button, this animation loops contiously whilst the user is over the button.

In the same button on the second layer is another movieclip animation that opens up a further two buttons (Music and Advertising). This part i can do. But when the mouse rolls over the two buttons the initial opening animation constantly plays frame 1 of the animation. I've tried substituting the two buttons for movieclips but it just crashes the movie.

I've been scanning this site for tutorials to find some similar menu systems but hav'nt come across much that will help me, any solutions to keeping an animation playing constantly whilst having the option of choosing two separate button options would be great, or some like minded tutorials

thanks

Movieclip Control GRRRRR
haven't been here in a while, now i need help ... HELP ME

i have a flash mx movie.
then i have created a movieclip around 100 frames long, with a stop() every 25 frames.

this animation is supposed to run in the background of the stage with text being displayed on top of it. and when i click a button, the background animation is supposed to play to the next stop().

so i supposed it is something with instance names and tried this:

on (release) {
i_ani.play();
}
(i_ani is the instance name of the mc)

this doesn't work, so i tried
on (release) {
animation.play();
}
(animation is the name of the mc)

won't work either, even if i put "_root." in front of it.

i got something similar to work when i was using external swfs, but in this case i want to put it all in one file to prevent confusion.

any ideas?

thanks in advance.

Buttons And Movieclip Control
Hello. I'm trying to make a movie where after clicking on a button named maunal, you can control a movie clip with mousemove. Unfortunatly, I can't find the problem in the script. On the button I have:


on (release) {
manual == true
tellTarget ("manual") {
nextFrame();
}
tellTarget ("auto") {
prevFrame();
}


}


On the movieclip I have:



onClipEvent(mouseMove){
if (manual == true) {
nextFrame();}
}



My guess is it's in the manuel == true, but I don't know why. Any clues? Thanks,

-A

Frame And MovieClip Control
Here's a discription of my situation. Please read and help out in any way. Should be an easy one for you guys. Just trying to make my MC's more accessable in one scene, instead of having a hundred+ frame

"Scene 1" has 15 frames
Each frame contains one 20frame Movie Clip
I would like at the end of each Movie Clip to go back to "Scene 1"
and play the next Frame or next Movie Clip,

I have a "Stop" action on each Frame in Scene 1 to allow the movie clips to play though.
I tried...

gotoAndPlay("scene 1", 2);

On the last frame of the first Movie Clip but it just Plays frame 2 of that Movie Clip. Not the 2nd frame of Scene 1. I need MC_one to play through and then play MC_two, then MC_three and so on and so on.
and then go back to "Frame 1" of "Scene 1". Im sure its simple but im still fairly new.

Any help would be great, Thx

Control Movieclip In Button
I want to send a movieclip to a frame on rollover. movie is on the button 'over' state timeline and icant seem to target it..

Complex Movieclip Control
I have button_1 that manipulate many diferents things of movieclip_1
but there are a lot of movieclips in movieclip_1
that I want to change also:
for example:
movieclip_1 change de color
movieclip_2 change the scale
movieclip_3 change x...
movieclip_4 change y... etc

The root is always bad or one action stops the others.
Any ideas???

How To Control The X And Y Coordinates Of A Movieclip.
I have got a Flash MX file where I want up, down, left and right buttons to control the x and y coordinates of a movieclip.

I can get it to work using this code..

on (press) {
mymovieclip._x=mymovieclip._x+5;
}

but the user has to keep tapping the buttons to create an incremental change in position; holding them down doesn't work.

Is there a simple way of getting a button to work by holding it down

MovieClip Instance Control
Hi All.
I'm using mx2004 (mac)

main timeline has a movieClip in it.
In the movieClip, the 1 frame has a stop(); on it.
In the main, I'm animating the frame 1 of the mc, until I get to frame 10, at which point I want the MC to play all starting on the next frame.

So, frame 10 on the main looks like this:
stop();
this.myMC.gotoandplay(2);

It just stays stuck on the MC's frame 1. I've also tried:
stop();
_root.myMC.gotoandplay(2);

and

stop();
_level0.myMC.gotoandplay(2);

and

stop();
_level1.myMC.gotoandplay(2);

I'm pretty sure ONE of these would work. So I'm thinking that I've goofed up the naming of the instance on the stage. I named the instance where the keyframe is stopped at frame 10. No change. So I also made sure that the previous KF and tween were highlighted and named that myMc as well.
Still no go.

Any suggestions would be appreciated.
sb

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