Scenes And MovieClips
hey everyone!so, I have a flashsite (http://a.parsons.edu/~bbrummer) and... well I don't really know why, but I structured everything with scenes...now, well... as you can expect, I run into some problems with my ****load of scenes. My question would be: Is there a simple way to work with movieClips or any other method without doing everything again??thanks,bep
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 04-08-2007, 11:44 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Movieclips Across Scenes
Hi,
At the moment, I have an instance of a movieclip within scene 1 which I edit with actionscript (ie, duplicate a movie into it and change the value of some text within it). When I go to the second scene, is there any way of using the movieclip but with the changes I made in the instance in scene 1? Currently, even when I use the same instance name, it just reverts back to the origional movieclip without any of the changes.
Thanks in advance,
Matthew Dingley
Movieclips Instead Of Scenes
Hello
Im sitting here with a flash tutorial in my flash mx 2004 Savvy book.
The tutorial is about making an animation movie. In the tutorial
they have made 5 movieclips. These movieclips are arranged in
their own scenes. There is the problem - I want to use just one
scene. How is the best way to arrange the movieclips and how
making it work?
Here is what I tried:
I named the movieclip instances for a_mc...........e_mc.
Made two layers in the main timeline. In the first frame in layer1
I put "a_mc", in frame two "b_mc", in frame three "c_mc" etc.
I put a stop(); script at the first frame in every movieclip instance and at
the last frame of every movieclip instance I put _root._movieclipinstance.gotoAndPlay(2);
In layer2 in first frame I put
_root.a_mc.gotoAndPlay(2);
This didn`t work
So how is the best way to make this movie clips play one after
each other?
edit: attached the fla.file here. Its just two movieclip instances in the main
timeline at this one.
Movieclips Instead Of Scenes?
i read somewhere that scenes flat out suck. as a alternative people are suggesting movieclips or loading swfs. i dont understand the movieclips idea. how can u use movieclips instead of scenes? obviously its possible to put all info that could be on a scene into a movieclip(because so many people are doing it) but how can this be done? can some one please shine some light on this issue for me? thanks alott!
Movieclips Instead Of Scenes?
i read somewhere that scenes flat out suck. as a alternative people are suggesting movieclips or loading swfs. i dont understand the movieclips idea. how can u use movieclips instead of scenes? obviously its possible to put all info that could be on a scene into a movieclip(because so many people are doing it) but how can this be done? can some one please shine some light on this issue for me? thanks alott!
Scenes And Movieclips.
I dont know what the limitations are with movieclips and scenes. But Im working on a game where I want to customize my car in one scene and use that same customized car in a different scene. What method do I use to make these things happen? Does anyone know of a way to make these changes last from one scene to the next?
Thanks for the help.
-Angrycrow
Advancing Scenes From Within Movieclips :(
Hi...
I'm trying what ought to be simple...
I have a movieclip in the first frame of a movie. It includes a timer which, when reaching zero, does a number of things, like change a variable in another movie clip. I'm trying to get it to also make the main movie to advance to its next scene, but nothing's happening ??
Here's the code in the movieclip:
onClipEvent (load) {
startTime = 60000;
}
onClipEvent (enterFrame) {
myTime = getTimer();
showTime = Math.round((startTime-myTime)/1000);
}
onClipEvent (enterFrame) {
if (showTime<15) {
scoreMessage = "Hurry Up !";
}
}
onClipEvent (enterFrame) {
if (showTime<0) {
showTime = 0;
scoreMessage = "Time's Up !";
setProperty (_root.player, _visible, false);
gotoAndPlay ("Scene 2", 1);
}
}
All of this works fine, except:
gotoAndPlay ("Scene 2", 1);
Any ideas how to get this to work? Is it trying to advance to a non-existent second scene in the movie clip...and if so, why doesn't changin it to:
gotoAndPlay (_root."Scene 2", 1);
solve this?
or am I being very stupid
Any help much appreciated !!
Pete
Accessing Movieclips On Other Scenes
I want to call a movieclip's member function from another scene. How can I do this?
Maybe something like movieclip array would help?
this._parent["myMC"].myFunction();
Navigating Between Scenes & Movieclips
THX for reading
First of all, i have spend alot of time trying to solve this by my self. Tested with all sorts of commands, nu luck. YES im a NEWBIE
Im just implemented a picture gallery script into a movieclip called "gallery" that i have implemented
into a scene called "picture gallery". In the Scene "picture gallery" I have implemented a movieclip "called" gallery links" that have a button that points to the movieclip "gallery"
The problem is that when i try to leave the scene "picture gallery", it's always in the rest of the movie, it does not go away when i press any of the other buttons in my movie linking to other scenes. What are im doing wrong?? im really stuck now.
Is it better to make each scene as a "SWF" file or just keep the whole ting in one big movie, and just load each movie.
I hope im explaining my self so you guys/girls understand my problem.
Im a new to flash, and im using FlashMX pro2004
Please explain well, if possible show an example.
If anybody has a solution to make this from scratch, i'll do that. dossent matter, it don't work now. Need what commands to put on buttons, movieclip & scenes, to make it work.
Thx in advance
Best regards
Seiern
[F8] - Is There A Way To Transistion Between MovieClips Or Scenes?
I am trying to make the switch from making whole movies on one timeline to making multiple movieClip objects and meshing them all together to get the same effect as I get on one timeline.
The question I have is whether or not I can make multiple movieClip objects, then have a separate transitional effect between them. --( I am making advertisement videos for 3 video games. I want to make 3 separate movieClips, each containing a different game. Between the 3 movieClips, I want a static-like effect much like you would see on science-fiction movie distress call videos) Is there a way to blend the movieClips together like this?
Thanks for any help!
Update Movieclips Trought The Scenes
Hello friends,
I really need your help on this one.
i need to now how can i update the movie clip thats is in scene 1 into the other scenes. do i have to use variables?
Please help me on this one
Many thanks,
Zitron
Integrating 2 Movieclips With Multiple Scenes
I'm working on a total flash website for a customer of mine and I've hit a road block. I'm sort fo new to flash so bear with me please.
I have 2 movies (.fla) with multple scenes. I want to take one of these movies and run it in one of the scenes of the other along with its actions script (ie getURL). Is this possible to keep the scenes separated or do I have to have it all in one scene.
Thanks for the help in advance.
goldkn22
Linking Movieclips Inside Scenes
I have 4 movieclips on a scene. I'm trying to link them to each other. For instance when I go into the first movieclip (which is on scene 1, frame 1) one the buttons is supposed to link to the 2nd movieclip. Let's say the second moviclip is on scene 1 on the 60th frame. For the button I have the actionscript:
on (release) {
gotoAndPlay("scene1", 60);
}
it doesn't give me an actionscript error, but it doesn't do what I want it too. It just plays the same 1st clip over again when I click the button (the one that is supposed to go to scene 1 and play frame 60).
Can someone tell me what I'm doing wrong?
Thanks so much!
Linking Movieclips Inside Scenes
I have 4 movieclips on a scene. I'm trying to link them to each other. For instance when I go into the first movieclip (which is on scene 1, frame 1) one the buttons is supposed to link to the 2nd movieclip. Let's say the second moviclip is on scene 1 on the 60th frame. For the button I have the actionscript:
on (release) {
gotoAndPlay("scene1", 60);
}
it doesn't give me an actionscript error, but it doesn't do what I want it too. It just plays the same 1st clip over again when I click the button (i.e. the one that is supposed to go to scene 1 and play frame 60, plays scene 1 frame 1).
Can someone tell me what I'm doing wrong?
Thanks so much!
Control Movieclips Or Scenes With Xml Links?
I am trying to figure out how I can control a movie clip or scene from a link sent to flash from an xml document. i havnt found any tutorials on doing so.. only on how to send and receive xml in flash. i tried added dot syntax to the xml but that makes the flash xml not showup.
What i want to do its load a menu of buttons into flash with xml.. which i CAN do.. but i what the links to be able to control the movie clips in flash like a normal flash button.
any help?
How Do You Link Between Movieclips Inside Scenes
I have several scenes created which each have a single movieclip inside them. I want to create back buttons to allow the user to go back to the previous page, however, I don't know how to link them.
Buttons,scenes.movieclips Aaarh Help Pleeze
Hi Can you help
I have a movie with two scenes and on scene 1 i have a movie clip with a button in it that should go to scene 2. It works fine if the button is on the scene 2 time line but it's inside the movie clip which sit on the time line. Why won't it work. I have a on release go to and play scene 2 but no result. i'm slowly tearing my hair out. Can you save me from going bald.
Much appreciation and thanks
Miffy
Loading Scenes With Buttons Inside Movieclips
HY!
Ive made a movie where i have a main movie clip in my 1st scene. Then, inside this movieclip y have another movie clip for a menu, inside that menu-movieclip, i have some buttons and i cant seem to load scene 2 form these buttons. I know its beacuse the buttons are inside movie clips on the 1st scene. I think i remember that intsead of calling a scene i should name a keyframe on the second secene and call that key frame insteada of the scene, but it doesnt work!
help please...
how else can i do this!?
Loading Scenes From Buttons Inside Movieclips
HY!
Ive made a movie where i have a main movie clip in my 1st scene. Then, inside this movieclip y have another movie clip for a menu, inside that menu-movieclip, i have some buttons and i cant seem to load scene 2 form these buttons. I know its beacuse the buttons are inside movie clips on the 1st scene. I think i remember that intsead of calling a scene i should name a keyframe on the second secene and call that key frame insteada of the scene, but it doesnt work!
help please...
how else can i do this!?
Duplicated MovieClips Across Scenes And Dynamic Text Trouble
First off, I really appreciate flashkit.com and this board.
Ok, let's say I use the duplicateMovieClip function in the first scene of my movie to create some movieClips. Then let's say my movie proceeds to the second scene:
Are the movieClips I made by duplicating in the first scene deleted?
If not, can I access thier properties somehow from the second scene?
Also, if they're not deleted, how can I avoid duplicating them again if my movie needs to return to the first scene in which they were originally duplicated?
Finally, let's say I have a movieClip containing another movieClip containg some dynamic text. I can change the text value of the dynamic text, and it's _visible property is set at "true", but I can't see it in my movie. Anyone know why?
Thank you very much for your help.
Sound Across Scenes & Changing Volume In Certain Scenes..
OK, this is kind of hard for me to explain but i'll try...
I want to have a continuous sound loop over various scenes, but I want the volume to increase (i.e. fade up - and i would like it to fade rather than just suddenly turn up) during one of the scenes.. and decrease (i.e. fade out) to 0 during another scene.
On top of that, I'd like the sound loop to stop altogether when they play another audio file on the movie - then the loop resume when they return to scene 1.
Anyone able to help me here - i know it's sounds complicated but I am sure someone knows how i can do this.
Any help would be much appreciated,
thanks,
Chris
Referencing MovieClips Inside MovieClips From The Main Time Line?
is it possible to have event listeners that listen for a movie clip inside a movieclip and then execute a function from the main time line?
Or is it impossible to relate something this far removed? Sounds like a geek Jerry Springer episode!
Something sort of like this:
Attach Code
movie1_mc.closeBtn1.addEventListener(movie1_mc.MouseEvent.CLICK, closeMenu1);
movie2_mc.closeBtn2.addEventListener(movie2_mc.MouseEvent.CLICK, closeMenu1);
function closeMenu1(e:Event):void {
if (e.currentTarget.name == "closeBtn1"){
movie1.gotoAndPlay(27);
movie1.visible = true;
} else if (e.currentTarget.name == "closeBtn2") {
movie2.gotoAndPlay(27);
movie2.visible = true;
}
}
Adding Movieclips Inside Of Two Other Movieclips... XML Powered Slideshow
hello..
I have been working on this project that used part of the kirupa.com tutorial for XML slideshows as a base. What it does is takes a set of thumbnails from an XML file and puts them in a movie clip on different layers. (Each thumbnail a new movieclip on a new layer of the original movieclip)
Anyways, what I am trying to do is make a menu movieclip pop up when a button is clicked. Inside this movieclip is where I want to throw the movieclip for thumbnails to load on. The menu movieclip is working fine and whatnot, but I cannot figure out how to get the thumbnails to load inside that second movieclip.
Here is a chunk of my code:
Code:
function createThumbnailScroller(current_mc, currentThumbFile, thumbCenter) {
thumbnail_scroller.createEmptyMovieClip("t"+current_mc, thumbnail_scroller.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+20)*current_mc;
target_mc.pictureValue = thumbNumb[current_mc];
//trace(thumbNumbforJS[current_mc]);
target_mc.onEnterFrame = function() {
thumbWidth = target_mc._width;
};
target_mc.onRelease = function() {
//tell JS to jump to that slide
flash.external.ExternalInterface.call("jumpToSlide", thumbNumbforJS[current_mc] )
//set scroller movieclip back in its original position (go back to main screen)
yVal = 362;
scroller_move();
};
target_mc.onRollOver = function() {
fadeDown(this);
};
target_mc.onRollOut = function() {
fadeUp(this);
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(currentThumbFile, "thumbnail_scroller.t" + current_mc);
}
"thumbnail_scroller" is the movieclip which is inside of "scroller", the menu movieclip.
Thanks...
EDIT:
I got it working.. I just had to add "_root.movieclipname." in front of the movieclips I referred.
[CS3] Simple Display List Problem (MovieClips In MovieClips)
I have an object called UI_Total which contains 3 objects called Star, instanced as star1 star2 and star3.
In my code I do the standard:
PHP Code:
mainUI=new UI_total;
addChild(mainUI);
to instance the UI_Total.
Now, I can do something like
PHP Code:
mainUI.star3.x+=500
no problem.
And when I do
PHP Code:
trace(mainUI.star3.parent)
I get [object UI_Total] as expected.
Would someone be so kind as to explain to me then why
PHP Code:
mainUI.removeChild(star3)
doesn't work, and also why I can't do anything like
PHP Code:
mainUI.getChildIndex(star3)
Adding Movieclips Inside Of Two Other Movieclips... XML Powered Slideshow
hello..
I have been working on this project that used part of the kirupa tutorial for XML slideshows as a base. What it does is takes a set of thumbnails from an XML file and puts them in a movie clip on different layers. (Each thumbnail a new movieclip on a new layer of the original movieclip)
Anyways, what I am trying to do is make a menu movieclip pop up when a button is clicked. Inside this movieclip is where I want to throw the movieclip for thumbnails to load on. The menu movieclip is working fine and whatnot, but I cannot figure out how to get the thumbnails to load inside that second movieclip.
Here is a chunk of my code:
Code:
function createThumbnailScroller(current_mc, currentThumbFile, thumbCenter) {
thumbnail_scroller.createEmptyMovieClip("t"+current_mc, thumbnail_scroller.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+20)*current_mc;
target_mc.pictureValue = thumbNumb[current_mc];
//trace(thumbNumbforJS[current_mc]);
target_mc.onEnterFrame = function() {
thumbWidth = target_mc._width;
};
target_mc.onRelease = function() {
//tell JS to jump to that slide
flash.external.ExternalInterface.call("jumpToSlide", thumbNumbforJS[current_mc] )
//set scroller movieclip back in its original position (go back to main screen)
yVal = 362;
scroller_move();
};
target_mc.onRollOver = function() {
fadeDown(this);
};
target_mc.onRollOut = function() {
fadeUp(this);
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(currentThumbFile, "thumbnail_scroller.t" + current_mc);
}
"thumbnail_scroller" is the movieclip which is inside of "scroller", the menu movieclip.
Thanks...
RollOver Scripts On Movieclips In Movieclips With RollOvers
Hi,
This might get a little confusing so I'll try to explain clearly.
Basically, in Scene1 I have a colored rectangle movieclip with a rollover script that activates its animation e.g. on(rollOver){this.gotoAndPlay(2). That works just fine in activating the rectangle animation,which is just an alpha and tint change.
Within the rectangle movieclip symbol is another movie clip consisting of text graphics that has a similar rollover script placed within its instance within the rectangle symbol.
First of all, this rollover script will not activate when moused over, though the rectangle effect change does.
When I set the text movie clip as a button and place it within Scene 1 rather than within the rectangle symbol, the rollover does work, but it performs a rollOut of the rectangle movieclip. Even though the text button is directly on top of it, the rollOut occurs with the rectangle movieclip when the text button is rolled over.
So maybe you can see what I'm saying here. As part of the first movieclip, an embedded rollover script won't work. As a button placed on that movieclip, the button rollover state interferes with the movieclip rollover script.
I'm sure somebody has encountered this. If I haven't thoroughly confused you, hopefully some charitable soul will help me out.
thanks
Movieclips Within Empty Movieclips...problems
Okay, I'm doing a band web site for my brother and I'm running into this problem...
I want each of the links to be a separate flash file. I understand how to do that and have basic ones working. I have empty movieclips and use the loadMovie function, i.e.
Code:
on(release) {
loadMovie("shows.swf", "shows");
}
The thing is though, the shows.swf file has a textbox which is inside a movieclip which loads an external text file (this is so that they can update the site easily themselves). When I just double click the shows.swf file myself, it opens in the flash player correctly, but when I try to open it from the main.swf file, the shows.swf file loads, BUT the text doesn't appear in the textbox(which is in the movieclip). The movieclip which holds the textbox has an instance name of textbox. I can give you guys the two files if you want to see more if it will help you give me a solution to this problem. I thank you for your time and hope someone can help me.
Michael
Removing Movieclips, Alot Of Movieclips
through a duplicateMovieClip action, i created about 200 mc's named "circleMovie1", "circleMovie2", and so on.
now, how can i delete all these mc's without typing out 200 "removeMovieClip" actions?
plz help!
Movieclips Inside Movieclips Problems
hi.
i have a mc called question13 which holds a number of other mc's inside it on the 12th frame, called tick1-tick6. each of these acts as a simple radio button with the following code (for tick1)...
on (release) {
if (_root.tick1select == 1) {
_root.question13.tick1.gotoAndStop(1);
_root.tick1select = 0;
}
else {
_root.tick1select = 1;
_root.question13.tick1.gotoAndStop(2);
}
}
These work fine as they are.
but i need to set the tick1 to look as though it is "ticked" (ie at frame 2) from the main timeline, not within question13, how do i do this?
Movieclips Play Sounds Of Other Movieclips...
I made a very simply movie comprising of 6 movieclips with sound that play when you press the corresponding key. The top 3 clips play fine but the bottom three play the sound or sounds from previous clips.
also the huskey clip will play when you press either enter or space but it should only be played when you press space. (I was thinking that enter is reserved for playing movies or something.
Thanks for all help.
im using Flash 5
My .fla in a zip file -can be downloaded here...http://www3.telus.net/seanc007/MC_Test.zip
(Too big to be attached)
Checking Distance Between Movieclips Within Other Movieclips
I'm not sure if there is a really quick & dirty way to do this, but I have some movieclips, which are nested within another movieclip, and I'd like to write some code that will return which one is closest to a movieclip on the main timeline. Since there _x's are entirely different because they're not in the same movieclip - is there any way I can make this work?
Thanks!
Target Movieclips From Nested Movieclips...
All,
I was wondering if you could give me a hand?
I have a file that contains two movieclips. One movieclip contains a container clip and the other movieclip contains two nested movieclips which end up with a button. Please see diagram...
I would like for the button, when clicked, to load an external .swf file into the container movieclip which is nested inside a _root movieclip. See diagram...
I have used the following code on my button to no avail:
Code:
loadMovie("Flash/homeIMGs/image1.swf", _root.mainImageMC.imageMC);
AND
_root.mainImageMC.imageMC.loadMovie("Flash/homeIMGs/image1.swf");
Please help.
Movieclips As Buttons Embedded In Movieclips
Hi,
I have a couple movie clips embedded inside a main movie on the root of my movie.
i have an action onRollover applied to the main movie clip, which triggers actions on the movie clips inside it.
i want to use the child movie clips as buttons, but i am getting no response to the code below:
ActionScript Code:
this.mcPic.onRollOver = function() {
trace("rollover");
_root.mcPic.btnBuy.xSlideTo(135, .5, "easeOutBounce");
_root.mcPic.btnListen.xSlideTo(105, .5, "easeOutBounce");
}
this.mcPic.onRollOut = function() {
trace("rollout");
_root.mcPic.btnBuy.xSlideTo(360, .5, "easeOutBounce");
_root.mcPic.btnListen.xSlideTo(-91, .5, "easeOutBounce");
}
// the following code here gives no response.
this.mcPic.btnBuy.onRelease = function() {
trace("click OK");
}
this.mcPic.btnListen.onRelease = function() {
trace("click OK");
}
any help would be appreciated.
thanks!
eric
Getting My Buttons Active When Movieclips Are Within Movieclips
Ok so I have this site in progress with these neat drop down menus. When you rollover the image, two or more choices appear that link you to other pages. Only when you rollover them, the buttons don't work. The buttons work when you isolate each movie clip. But once I place the movieclip in the main time line, the buttons don't work anymore. The rollovers don't happen. They aren't clickable.
I need to know how to tell flash to make these buttons work. I can do this if a button is in the maintime line but not when it's embedded in a movieclip which is then embedded in the main time line. Get it?
I uploaded the work in progress so you can see what I mean. www.stephanieerdel.com/headermov.swf
rollover "Vibrations" and you'll see the choices pop up. In the movie clip each choice changes color when you rollover it. As mentioned before, when I put the clip in the main timeline, the buttons don't work. but you see them and the movie clip works fine.
If someone can write out what the code is to let flash know to make these buttons work, I would appreciate it soooo much.
Thank you!
-Stephanie
Calling Other MovieClips Inside Other MovieClips
The problem I am having is a little moe signifcant than what the titles suggests.
What I am trying to do is to determine whether a movieClip, which is nested inside another a movieClip hits another moviceClip, which, you guessed it, is inside another movieClip.
Something along the lines of this:
Code:
onClipEvent(enterFrame){
if( _root.character.charNose_mc.hitTest( this )){
_root.character._x -= _root.char_speed;
}
}
Obviously this code is not working. The movieClip the hitTest( this ) is referring to is inside another movieClip. And charNose_mc is nested inside character at the root level. As you can tell, the goal of this code is to move the character movieClip in a negative direction using a predefined variable called char_speed.
Any ideas on what I am doing wrong, or what is the proper way to format this code? Thanks!
Why Do Movieclips Inside Movieclips Have Different _x And _y Than The Timeline?
I'm confused, why does a MC inside another MC have different _x and _y values than the main timeline?
What I am trying to do right now is animate a MC inside another MC then get the main MC holding everything to move where that new MC ended animating at (it's part of a game I'm making.)
I know it's confusing but Flash shows the cursors current X and Y in the info panel, which is the same as the main timeline. Yet inside the movieclip, an x of 76 and a y of 277 on the timeline is -195 and -30.9 (respectively) inside the MC.
How do I fix it so I can get the _x and _y values to match up so I can tell the main MC to reposition itself to the new X and Y (of the inside MC)
MovieClips Inside Other MovieClips - Detecting All
I have a movieclip called mapWindow, inside mapWindow are dynamically created movieclips of various sizes. The movieclips inside the mapWindow don't take up the entire space of the mapWindow and thus I use a startDrag on the mapWindow upon detection of a mouse press. The problem is, I don't want the start drag to start if the mouse is detected over any of the child movieclips inside mapWindow.
I have a few ideas of how to proceed, but I'm not sure how to reference all child movieclips of a particular movieclip - or something along those lines.
It would be easy to use the hittest function if I knew how to reference all the movieclips I need to, but alas...
Thanks in advance.
Calling Other MovieClips Inside Other MovieClips
The problem I am having is a little moe signifcant than what the titles suggests.
What I am trying to do is to determine whether a movieClip, which is nested inside another a movieClip hits another moviceClip, which, you guessed it, is inside another movieClip.
Something along the lines of this:
Code:
onClipEvent(enterFrame){
if( _root.character.charNose_mc.hitTest( this )){
_root.character._x -= _root.char_speed;
}
}
Obviously this code is not working. The movieClip the hitTest( this ) is referring to is inside another movieClip. And charNose_mc is nested inside character at the root level. As you can tell, the goal of this code is to move the character movieClip in a negative direction using a predefined variable called char_speed.
Any ideas on what I am doing wrong, or what is the proper way to format this code? Thanks!
Targeting Movieclips In Attached Movieclips
I have a movieclip that is linked with the name sound1. Inside this movieclip is another movieclip, a loadBar, that when I place on the mainstage, functions fine. I want the loader to be in the attached MovieClip. I'm having issues with targeting though:
ActionScript Code:
rotateMenu.onRelease = function() {
mySoundLoading = 0;
myNewMovie = attachMovie(mybounce, "holder", this.getNextHighestDepth(), {_x:182, _y:125});
this.myNewMovie.loadBar._xscale = mySoundLoading;
trace(this.myNewMovie.loadBar._xscale);
trace(mySoundLoading);}
My first trace comes up undefined...the loadBar doesn't function.
I've tried targeting this.holder.loadBar._xscale.
I've tried targeting without this.
I've tried targeting the name of the linked movie:mybounce....
How do I get to the loadBar within my attached movie??
Thanks.
AS3 - Reading Movieclips Inside Movieclips
hey all. i'm such a noob when it comes to AS3 but i'm determined to learn.
i've had to drop out of strict mode to make this work. can someone tell me why? i've a feeling it has to do with casting maybe. this is in an .as file and not on timeline.
trace(getChildByName("box1").playerStats.x);
in strict it throws up "1119: Access of possibly undefined property playerStats through a reference with static type flash.displayisplayObject."
yet trace(getChildByName("box1").x); works just fine.
also i want to refer to it dynamically with "box"+i. do i use this["box+i].playerStats.x?
edit: trace(getChildByName("box"+playerPos).playerCards.x); seems to work ok!
help!
Targeting Movieclips From Movieclips
I just moved up to Flash MX from Flash 4 and the dot notation is killing me.
My goal is to target one movie clip (mc2) and play a certain frame(lable1) from a button on another movie clip. Normally, I would do an "on release, tell target" and everything would be grand, but my dot notation isn't working properly. It works on the first click but intermittently on further clicks. My code on the button is:
on (release) {
_root.mc2.play(lable1)}
The first time it plays the right lable, the next time I click it plays the next lable on the timeline, next click it jumps to another lable-all within mc2 at least. Each label has stops so that isn't the issue (i don't think)
Is there a better way to do this? Why is this so hard!?!
Controlling Movieclips Within Movieclips-help
i need to tell a movieclip to play but it seems like it won't work becos this MC is embedded within another MC.
it goes like this:
MC1 calls MC2, and within MC2 i need to call out *another* MC (let's call it MC3) with buttons that will call out other MCs. On each button on MC3 i've put this code:
on(release) {
this.gotoAndplay("mymovie");
}
when i publish to movie, the link is active but there's no response when i click on it.
what went wrong?
Loading Movieclips Into Other Movieclips
Hello, not sure if this is possible but...
I've got a random number of dynamically generated movieclips.
I want to put all these movieclips inside a scrollpane.
I realise that I can only have 1 movieclip inside a scrollpane, so
how can I load each of these random movieclips into my container clip?
Cheers for your help
Detecting MovieClips On MovieClips
If you have object1, say a movie clip and its dropped onto object2 another movie clip, object2 is now the droptarget of object1. Am I correct?
Is there any way to access object1 from object2. Say, give me the object that is on top of object2.
And is there any way to determine if an object has any objects(doesn't matter what object) on top of it?
Movieclips Inside Movieclips
hi.
I am having problems with my game. I want to make bombs and for this i needed a movieclip 1 inside movieclip 2. When movieclip 1 is touched by the player the movieclip 2 plays. I have had no success so far and i cannot use such things as nameing the bomb as it wil take too long because i would like to c +p loads on the game.
Here are the codes i have tried:
code: onClipEvent(enterFrame) {
if(this.hitTest(_root.box))
_root.play ();
}
that made the main frame change.
code: onClipEvent(enterFrame) {
if(this.hitTest(_root.box))
play ();
}
this did nothing
i also tried this but it did not work.
code: onClipEvent(enterFrame) {
if(this.hitTest(_root.box))
_root.this.play ();
}
Have you got any ideas? i tried to provide code and my errors like i must. thanks
[F8] Movieclips Within Movieclips Probs
another super long one!
on my main timeline sits a moviclip called photobook. Its first frame is empty except for a transparent button, which when clicked, 'opens the book' by going onto frame 2, a page from the book
inside this clip laid out on the 'pages'are six other clips, they appears as 'newscuttings' in the scrapbook which is my photobook clip. I have scripted it so that when the user clicks on one of the six clips, they see a larger version of the newscutting image. I have achieved this by placing a larger version of the image in a layer above the original image, all contained in the 'newscutting' clip. The I created a 2 frame clip called 'papermask' the first frame containing some invisible shape, the second containing the mask shape which covers the larger version of the image. i placed this 'papermask' clip in a layer above the larger version, and turned masking on.
then I applied the following script to the newscutting movieclip:
on (release) {
this.papermask.gotoAndStop(2);
_parent.closeBtn.gotoAndPlay(2);
}
the second line refers to a 2 frame clip which acts as a close button to the enlarged image. the second frame contains the close button, so when the enlarged image appears, so does the close button.
the close clip has the script attached to it:
on (release) {
_parent.newscrap1.papermask.gotoAndStop(1);
this.gotoAndPlay(1)
}
It closes the image by going into the mask clip and returning the playhead to the first emppty frame, hiding the big version from view. it goes to its own first frame, hiding itself from view.
Right, now i get to the point!!
This all works, I can see a larger version of my news cutting image by clicking on movieclip, and can close it by clicking the close clip.
the problem is, when i click a close BUTTON which closes the parent "photobook" clip by returning it to its first, invisible frame, the 'newscutting' clip that i have clicked on stays there, even though it is inside the 'photobook' clip and should not be there, as it does not exist in the first frame if 'photobook' !
I tried attaching this to photobook's close button:
on(release)
{_parent.newscrap1.gotoAndStop(1);
gotoAndPlay(1);
}
but no luck!
i know this is a bit of an essay, but i wanted to give as full context as possible so someone could give me some hints!
|