Telling Movieclips When To Swap Out
Hi! I'm having a problem with a site I'm building. Maybe someone here can help... Is there a way that when a button is clicked, you can tell a movieclip to keep playing then swap with another one? I have a box with content on the top of that. When a button is clicked I want the box and the current content to flatten to nothing then swap content and have them both expand to regular size. The content associated with each button is the movieclip I was refering to above. Any help would be much appreciated! Thanks in advance!
FlashKit > Flash Help > Flash General Help
Posted on: 09-15-2003, 10:26 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Telling Movieclips To Stop
hey i was wondering how i would tell a movie clip to stop using a button. I just dont know how to tell the button to stop that specific movieclip, i know its simple but im an uber flash noob.
Tween Class Is Duplicating Movieclips Without Me Telling It To. Help Please.
Hey guys, if you'll look at http://extstudios.com/clients/klean/ let it load and then click on FASHION. All goes well. Then click on HOME. All goes well. Now click on FASHION again. after you've done each card once duplicate movie clips start popping up, but I've not called any such function. Here's my code.
ActionScript Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
if (_root.nextCard == "Home") {
var xScaleT:Tween = new Tween(cardHome, "_rotation", Regular.easeOut, 0, 30, 1, true);
var xXPosT:Tween = new Tween(cardHome, "_x", Regular.easeOut, 11.9, 502.3, 1, true);
var xYPosT:Tween = new Tween(cardHome, "_y", Regular.easeOut, 1.5, -648.5, 1, true);
xYPosT.onMotionFinished = function() {
cardHome.swapDepths(getNextHighestDepth());
var xScaleT:Tween = new Tween(cardHome, "_rotation", Regular.easeIn, 30, 0, 0.85, true);
var xXPosT:Tween = new Tween(cardHome, "_x", Regular.easeIn, 502.3, 11.9, 0.85, true);
var xYPosT:Tween = new Tween(cardHome, "_y", Regular.easeIn, -648.5, 1.5, 0.85, true);
};
}
if (_root.nextCard == "Fashion") {
var xScaleT:Tween = new Tween(cardFashion, "_rotation", Regular.easeOut, 0, 30, 1, true);
var xXPosT:Tween = new Tween(cardFashion, "_x", Regular.easeOut, 25.5, 502.3, 1, true);
var xYPosT:Tween = new Tween(cardFashion, "_y", Regular.easeOut, 4.7, -648.5, 1, true);
xYPosT.onMotionFinished = function() {
cardFashion.swapDepths(getNextHighestDepth());
var xScaleT:Tween = new Tween(cardFashion, "_rotation", Regular.easeIn, 30, 0, 0.85, true);
var xXPosT:Tween = new Tween(cardFashion, "_x", Regular.easeIn, 502.3, 25.5, 0.85, true);
var xYPosT:Tween = new Tween(cardFashion, "_y", Regular.easeIn, -648.5, 4.7, 0.85, true);
};
}
Anyone have an idea on how to fix this problem?
Swap MovieClips
I'm using Flash MX, when attaching a movieclip(B) in another movieclip(A) the last loaded appears over the "caller"(A) movie and this correct, but still are active the buttons on the clip that is backwards (A) resulting an uncontrolled mess.
Somebody knows how to arrange this ?
Thanks
Swap MovieClips
I want to swap two MovieClips. One of the has mask, depth etc. other one is in the library. I want to delete first one and on its place paste other one. this should have the same mask, depth, alpha, x and y.
It's very easy, when you are creating this (there is swap button in properties), I want to d just the same with source.
Please help me... I have no idea how to do it. The source code is already very big, and I can't add parent to this MovieClip. and there are a lot of uch couples, which should be replaced with other one. I want to write one function, which will get this clips and make swap.
How To Swap MovieClips?
Hi,
I have two different MovieClips of different graphics (blue_mc and green_mc), and onother MovieClip (grey_mc).
When I click on any one of the two MovieClips, it should swap with the grey_mc.
Problem:
When I click on green_mc, the grey_mc changes to green_mc. However, when I click on blue_mc, nothing happens.
I should click on green_mc again to reset it, then when I can click on the blue_mc, it swaps the grey_mc.
Any simpler way to make this works..
(Please note: I have used another two MC, bl_mc and gr_mc and placed them behind the grey_mc)
Thank you
uxk
Attach Code
green_mc.onRelease = function() {
gr_mc.swapDepths(grey_mc);
};
blue_mc.onRelease = function() {
bl_mc.swapDepths(grey_mc);
};
Trying To Swap MovieClips With AttachMovie( ) Not Working. Please Help.
Howdy all,
I'm haveing a hard time getting my head around this attachMovie() thing. I'm trying to swap movieClips when they've moved to far to the left or right and it's not working
I've set the linkage up on the MC in the Libary and here's my code. What am I doing wrong, any help would be greatly appreciated.
Thanks
if (myMC._x>=450) {
myMC.attachMovie("myMC Left", "myMC_left", 1);
myMC._x = 446;
Swap Depths Forth And Back On Multiple Movieclips?....
Hi everybody,
some very strange things happening with swap depths. Take a look at the link below. I use swap depths for all of the twelve movielclips but it works only for the four left ones! Attached is the .fla file. If anyone would like to have a look i would be very grateful.
http://www.gerasidis.gr/servicesss.swf
Thanks in advance.
Manolis Gerasidis
www.gerasidis.gr
Swap Depth Inactivate Movieclips/buttons
I´ve been working on my homepage for a while now. Bumped in to a problem the other day.
I have several rollout menus that atomic helped me with, (thx), each containing several buttons.
Every menu corresponds to a gallery and every button to a specific image in that gallery.
The menus are placed on different leyers on frame one on the main timeline.
Within every menu i´ve placed the corresponding gallery wich are invisable and become visable on press on one of the menu buttons
The problem I had the other day was, when i entered menu nr3 on leyer 3 and pressed one of the buttons to display the image in the gallery the image was displayed under the layer 1 and layer 2 so the menus 1 and 2 floated on top of the image.
So with a little help from Sicontis who helped me to add swap depth to my code I thought the problem was solved.
But looking closely at it there´s a bug.
Since the swap depth code is addet to each menu, it causes the menus under the galleryimage to pop up on rollover allthough thay are hidden by the image. and suddenly swap depth and come up above the gallery.
I´ve been looking for a soulution but since I´m 4 weeks into flash it´s quite hard.
Is there a way to inactivate the menus below when gallery is played?
or is there a way to add a code adressing the other menus to go as deep as they can and stay there... lol...
another thing I wonder is if it´s possible to have the galleries to fade in and out. is there a way to make the gradually become visable and do i have to script it using alpha instead.
I´ve attached a fla
Would really apreciate if anyone can take the time and have a look.
From the man swimming in deep water...
DR
Swap Depth Inactivate Movieclips/buttons
I´ve been working on my homepage for a while now. Bumped in to a problem the other day.
I have several rollout menus each containing several buttons.
Every menu corresponds to a gallery and every button to a specific image in that gallery.
The menus are placed on different leyers on frame one on the main timeline.
Within every menu i´ve placed the corresponding gallery wich are invisable and become visable on press on one of the menu buttons
The problem I had the other day was, when i entered menu nr3 on leyer 3 and pressed one of the buttons to display the image in the gallery the image was displayed under the layer 1 and layer 2 so the menus 1 and 2 floated on top of the image.
So I recieved help to ad swap depth to my code and thought the problem was solved.
But looking closely at it there´s a bug.
Since the swap depth code is addet to each menu, it causes the menus under the galleryimage to pop up on rollover allthough thay are hidden by the image. and suddenly swap depth and come up above the gallery.
I´ve been looking for a soulution but since I´m 4 weeks into flash it´s quite hard.
Is there a way to inactivate the menus below when gallery is played?
or is there a way to add a code adressing the other menus to go as deep as they can and stay there... lol...
another thing I wonder is if it´s possible to have the galleries to fade in and out. is there a way to make the gradually become visable and do i have to script it using alpha instead.
I´ve attached a fla
Would really apreciate if anyone can take the time and have a look.
From the man swimming in deep water...
DR
How Do I Swap Flash Movies In Dreamweaver In Place Of Swap Image?
In Dreamweaver you can swap images on a mouseover event using behaviors.
Instead of swapping images, I want to swap flash movies.
Example:
Build a table
place and play a flash movie in a cell
on a mouseover, replace that flash movie with another flash movie.
Can it be done? It apparently can't be done directly - Dreamweaver won't see flash files as swappable. Perhaps there's a workaround.
Swap Images Or Swap Symbols?
I want to load a bunch of images dynamically -- into different movie clips. And then simply have a master clip which lets me swap out these dynamically loaded clips. Is that possible?
Can I do a swap or replace symbol on the Master to have it be replaced by each loaded clip one after the other?
Ok Everyone Is Telling Me...but....cgi...?
i asked a question a few posts back and everyone is instructing me to go to cgi sites and learn some of it to accomplish my goal but...even in doing that...i still don't know how to do the flash part of it...what actions do i need to attach to a button in order to communicate with my cgi scripts...just generally...how would it work...?
james
Loading A SWF And Telling It What To Do
I have a problem!
I have a movie loaded in _level0 and I have a button that loads another movie. I need that button to load the other movie tell it to goto somewhere and unload the original movie.
Please Help me.....
Telling An Mc To Do Something From Another Mc Without Buttons.
hi everyone...
okay i have a MovieClip of this menu that slides out from the right... I want to have arrows pointing out to have it open on frame 1 and arrows pointing the other way to close it on frame 2
now...
this movie clip is inside anothe movieClip, which does the actual sliding...
so frames 1-10 it opens.. on frame 10 it stops... and then from 11-20 it close...
ok... so on frame 10 (timeline is stopped) i want to tell the movieClip (which is inside this one) to go to frame 2
i've tried putting either one of these codes on the MC which i want to control, with an instance name of "menu"
Code:
onClipEvent (enterFrame) {
menu.gotoAndPlay(2);
}
--- AND ---
onClipEvent (enterFrame) {
tellTarget ("menu") {
gotoAndPlay (2);
}
}
am i way off?
please help.
thanks
~chika
Telling An Mc To Go To A _x Position
in frame 1 i have a mc "test_mc" that moves in the oposite direction of the mouse. i also detect the x position of "test_mc"
in frame 2 (after a button click) i want to recall the last x postion of "test_mc" - which i have been able to do) and tell it to no longer respond to the mouse but rest in it's last detected x positoin.
any advice?
thanks in advance
-hp
Telling An External .swf What To Do?
hey again!
i've done a flash file where i create an imageholder for an external .swf
is there a way u can tell this .swf to go to a certain frame and/or scene?
Telling Flash To Do This..:)
Hi there
i put a button on main timeline and told flash to go to "scene 3:
ActionScript Code:
on (release) {
gotoAndPlay("Scene 3", 1);
}
i wanted that flash plays a small animation from/until frame 1-24 (stop) and next flash schould preload and display an external SWF im container
Scene3 frame25 (CodeLayer)
ActionScript Code:
this.onLoad = function() {
_root.createEmptyMovieClip("container", 1);
container._x = 0;
container._y = 0;
loadMovie("movie.swf", "container");
}
but it´s not working ! what i´m doing wrong ? help please
thankyou
__________
regards
Telling The Time
i need to be able to tell the time from the users machine. But I only need the hour not the rest.
I presume it has something to do with Date.getHours() method but can't get it to work.
any suggestions?
Telling Movie On Another Level
ok ok,
this may be very basic, but I confess i do not know
Question:
How do you tell a movie (on say Level 0) to tell the another movie (on say Level 3) to go to a particular frame (lable)? Also how is it possible for a movie to close itself? (so the main movie is on level 0, and another movie is on level three, and before it closes it does some fancy animation or something, then closes itself?)
thanks in advance
Telling Another Movie To Move
I would like to have one movie, in the main frame, tell a second movie in the bottom frame to move to the next scene. How is this possible?
Telling An Swf To Loadmovie(specific.swf) From A Swf
Hi all,
Basically, from a "site map"(that will be a swf) I want to be able to specify which movie loads when they click on a button.
So for example: On the site map, the user would click the button History (which is a sub-movie of About Us). Then, I want the About Us "main movie" to load, and then the History "sub Content movie" to load on level 1.
Is there a way to do this using the FScommand?
Thanks for the help!
Getting The Parent Name And Telling Another MC To Act Based On That
sorry for the hellacious title, i like to be descriptive.
I have a button in an MC.this MC is duplicated 6 times with names like nav1, nav2, etc. I need to assign an action to the button inside to get the parent name, strip it to the last character to find out which nav the button is in and then tell another MC to go to a specific frame based on that info.
So far I have had no luck with the following code:
1 //get my parent's name
2 //(this returns something like "_level0.nav1" )
3 parentName = _parent[_name];
4
5 //trace for testing
6 trace("the parent name = " + parentName);
7
8 //wat number is my parent
9 //(returns nothing!)
10 myParentNumber = parentName.substr(11, 1);
11
12 //trace for testing
13 trace("my parent number = " + myParentNumber);
14
15 //determine where to go based on the number
16 if(myParentNumber == "1"){
17
18 //tell the menu item to go to the label for my number
19 _root.menuSlides.gotoAndPlay ( "1" );
20
21 }
line 10 produces nothing, is the result of line 3 not a string? can it not be divided using substr? is there a simpler method to the ends? will this post ever end?
thanks in advance,
-nathan
Telling One SWF To Perform A Function In Another
Is it possible to effect mc's from one SWF to another? In other words, say I don't want to make a movie clip visible until an action in a loaded movie finishs its action. Can I do this?
I've got a situation where I want to load a bunch of SWF movies into a main SWF and I have a "next" button that I don't want to appear until the loaded mc is done. I thought
_root.Next._visible = true;
would work, but it doesn't. Is it more than this?
Thanks,
Telling An Mc When To Start Scrolling
Hello all!
I'm reall not quiet sure if this is possible. ok
I have this script attached to a MC
onClipEvent (load) {
speed = 0.2;
}
onClipEvent (enterFrame) {
dist = _parent.tar-currentPos;
currentPos = _x += dist*speed;
}
when the clip loads the scrolling begins. Now my question is, how do I tell flash to scroll when I want it to. I can always set speed to false....which in turn would stop it from scrolling onClipEvent(load). what code do I attach to my buttons to set speed to true and get the scrolling to begin?
THanks in advance,
Mikro
Telling _root To Goto ...
I've got a problem that i just can't seem to solve
I have a button inside a movieclip that needs to
tell the _root to gotoandplay("newscene", 5)
I've given the button the action:
on (release) {
_root.gotoAndPlay("newscene",5)
}
but this doesn't work and when i leave the name of the scene
out so the action is _root.gotoAndPlay(5) it goes to the first
scene :S
plz help
MC Telling _root To Play
In my movie, after like frame 20, I have _root stop, it then plays the movie. At the end of the movie, the movie is supposed to make _root play the next frame (21)
It just won't work. I tried _root.gotoAndPlay("movie",28);
Just doesn't work. I tried using frame labels, nothing. It just continues to repeat the movie clip. Little help please?
Buttons - Where Do You Put The Action Telling It To Go Somewhere?
Hi
I'm trying to learn a bit from some files I downloaded from the movie section...
Can anyone help me with where to put the action to make the different buttons go somewhere, like to a different frame etc. I'm confused cause they are being created dynamically here, so I can't just put it on each individual button...
i'm guessing I'm going to need a function somewhere...
Hope I am making sense?
Thankyou very much.
Telling A Target To Go To Certain Frame?
Goodday, here's my issue:
The following script tells a movie clip to become visible if the mouse is in a certain area.
// buttonPACK
prxTopbp = "86";
prxBottombp = "511";
prxLeftendbp = "288";
prxRightendbp = "680";
instancebp = "BPack";
if ((mousey<prxBottombp) and (mousex<prxRightendbp) and (mousey>prxTopbp) and (mousex>prxLeftendbp)) {
setProperty(instancebp, _visible, true);
} else {
setProperty(instancebp, _visible, false);
}
i would like to add an action to also tell 'instancebp' (or, 'BPack') to go to frame 15 in the movie clip of BPack when visibilit is true.
It sounds very simple but i could not get tell target to work for some reason
Thank-you
Telling A Centering MC To Stop At A Given _y Value
i have a MC that is centering vertically according to this code...
however, when the window gets smaller and smaller.. the content gets cropped off as it keeps centering per this code...
this._y = int(((Stage.height - this._height) / 2)+350);
how, can i put in code that will say in certain terms...
myMC._y = int (centered) ONLY IF mcMC._y is greater than A NUMBER
so that when the window gets too small... the bottom of my MC begins to crop and the top of my MC never does...
(my logo is at the top of the MC and i dont want it to get cropped, but i want the MC to center on the window)
i hope this makes sense....
thanks a million,
manny
Telling Where Another Movie Clip Is?
I need to place a peace of code on a button that will tell another movie clip where to go, but only if the other movie clip is on frame 1 else that movie clip need not move.
is there a way to do this.
movie clip 1 my_clip1 has to tell movie clip 2 my_clip2
to gotoAndStop(2) but only if it is on frame 1, if my_clip2 is already past frame 1 then I need it to stay where it is.
can anyone help
Telling Textbox To Scroll To Top
I have a textbox that loads in a variable called "content". Then I have 3 buttons that each change the content to something else by loading in a new content.txt file.
The problem I am having is when someone scrolls down on the textbox and then pushes a button to load a new .txt file it doesn't start at the top of the content.
How do I tell my textbox to scroll back up to the top?
Telling Your Scene To Wait?
is there a way with actionscript to tell your movie to "wait"?
Instead of dragging all my frames for 100s of spaces, is there anyway i can put an action script in to tell my movie to wait a certain amount of seconds before continuing?
Telling An Movie To Go To A Frame From Another
Hello,
I need to make a movie go to a specific
frame from a nother movie.
The way the site is designed is simple,
The site has two frames, "topFrame" and "MainFrame", in the topframe is the main menu and in the mainframe the content wich can either be html or a .swf movie. When the .swf movie is loaded in the mainframe, I want to be able to tell it to gotoAndPlay a specific frame from the main menu wich is in the topframe.
Can it be done?
And How?
Thank you
Jonyboy
Telling A Loaded .swf To Unload Itself
I load an .swf into the main movie using:
ActionScript Code:
loadMovieNum("Blah.swf", 14);
I have a button inside that movie that when clicked I want it to unload itself.
I tried:
ActionScript Code:
on (release) {
unloadMovie("level14");
}
//and
on (release) {
unloadMovieNum(14)
}
I have no idea why it doesn't work
Telling An MC To Go To A Frame Label From Another MC
I would like to get two MovieClips to talk to one another. One MC is my navigation MC (navMC). When I click on a button within navMC, I want to go to a label (slide1) on the root timeline where my second MC lives (mc_slide1). Then have mc_slide1 gotoAndStop on a frame label inside it. navMC has multiple link buttons that go to multiple labels within mc_slide1.
Here is what I've tried doing without success. Using these scripts I'm able to get to the label (slide1) on the main timeline but mc_slide1 won't go to its correspoding label.
on (press) {
_root.gotoAndStop ("slide1");
_root.mc_slide1.gotoAndStop("architects");
}
//slide1 is the frame label name on the root timeline
//mc_slide1 is the instance name of the second MC
//architects is the label within mc_slide1 that the button should link to
-------------------------------------------
on (press) {
_root.gotoAndStop ("slide1");
_global.label = "architects";
}
//on the _root timeline frame 1 I had _global.label = "" and in the slide1 frame I had gotoAndStop (_global.label);
-------------------------------------------
on (press) {
_root.gotoAndStop("slide1");
with (_root.slide1) {
gotoAndStop("architects");
}
}
I don't understand why these methods aren't working. What am I missing or doing wrong?
Flash Keeps Telling Me A ';' Was Expected..but ITS THERE
Symbol=tablesMovie, Layer=T, Frame=1: Line 8: ';' expectedThis is the error that I get. This is the code associated with it:
I have bolded the troubled line of code
Code:
on(rollOver){
if (_root.menu2.tables.ablesMovie._currentframe == 10)
stop();
else{
_root.menu2.enabledIn(1);
_root.menu2.tables.lineMovie.lineMask.whichButtonIn(1);
_root.menu2.tables.ablesMovie.seatMovie.gotoAndPlay("in");
_root.menu2.tables.8seaterOptionsBox.gotoAndPlay("in");
_root.menu2.ptcPos(1);
_root.window.menuWindowContent("Tables");
}
}
why is it giving me this error?
Telling Whether Or Not A Button Was Pressed?
I posted this 4 days ago, and received no help, so I'm trying again.
Does anyone know how to do this? ... >>
I have the 'main.swf' which has a navigation within it with buttons such as "about" "contact" and "staff" ...
One of these are pressed and load the 'background.swf' into a emptymovieclip on the 'main.swf' ...
Now from there, once the 'background.swf' has loaded, I would like for 'about.swf' to play within an emptymovieclip that is on the 'background.swf' if the "about" button has been pressed on the 'main.swf' ...
And to do this, I need it to test which button was pressed so that it loads the correct movie into the empty movieclip on 'background.swf' ...
Does that make sense?
Any help would be greatly appreciated! I need this urgently! Please!
Thanks,
Boon.
Flash Keeps Telling Me A ';' Was Expected..but ITS THERE
Symbol=tablesMovie, Layer=T, Frame=1: Line 8: ';' expectedThis is the error that I get. This is the code associated with it:
I have bolded the troubled line of code
Code:
on(rollOver){
if (_root.menu2.tables.ablesMovie._currentframe == 10)
stop();
else{
_root.menu2.enabledIn(1);
_root.menu2.tables.lineMovie.lineMask.whichButtonIn(1);
_root.menu2.tables.ablesMovie.seatMovie.gotoAndPlay("in");
_root.menu2.tables.8seaterOptionsBox.gotoAndPlay("in");
_root.menu2.ptcPos(1);
_root.window.menuWindowContent("Tables");
}
}
why is it giving me this error?
Telling Flash To Do Something Using Html
HI,
I have flash mp3 player on my site....it's driven by xml. I don't know much about Flash...ido php/javascript etc.
The xml gets loaded in and plays the songs from a specific directory.
What i need to do is make it possible to have links in html (a tags) which when clicked upon play the corresponding song in the player.
I'm sure i can code this if i had a good idea of a way to get it working. In my actionscript there is a cps variable, currently playing song. All i need to do is somehow talk to the swf and tell it to change the cps variable.
How do i do this??
Thanks
Preloader Telling What Is Loaded
hi folks,
could anybody please give me a hint how to create a preloader that tells the viewer which data are currently loading (i.e. loading sound, loading menu,...)?
thanks in advance
regards
Firegambler
[oop] Telling A Child What To Do Isn't Working.
I don't know if this is quite oop, but it feels a leap ahead in productivity for me, so I suspect it is.
I want to play specific sections of a movieclip that is nested inside my movie.
I have made a test .fla with a movieclip containing a red circle and a yellow circle as clips.
I have a movie clip called mask_mc which is used as a mask to reveal the contents of the yellow clip.
I have the following code in the main_mc to send the playhead inside my mask_mc to the "WIPE" keyframe.
It isn't playing ball.
Code:
box_mc.yellow_mc.mask_mc.gotoAndPlay("WIPE");
Can you see what is wrong with this line of command code.
I think this is quite a simple thing, but I dont know where my error is.
Many Thanks,
Tim.
Telling Target On Main Timeline From Within A Mc
this is really easy and the dumb thing is I've done it before but can't get it to work...
I have a button within a movieclip on the main timeline that needs to tell an MC target on the main timeline to play, how do I do this?
cheeeers!
Telling A Button That A Movie Is Already Loaded
I want to load a movie into a new level on a button mouseover, which is simple enough. And I want the movie to unload/be replaced when a different button is touched. Also simple.
But how do I keep a particular button's movie from restarting when the same button is touched again? I tried setting a variable in the loaded movie and reading it in the button, but it doesn't seem to work... Any suggestions?
Telling Loaded Movie Where To Play?
Hi,
When using the loadmovie command, can you direct the timeline of the loaded movie? Hmm, guess a better way to ask that is, can I tell the movie being loaded to start in a certain place?
~GD~
|