Transitions Using MovieClips
hi Users,
I am making a Flash presentation CD and in it I want to show the transitions between different MovieClips. I have done this thing in a website that when I click a button it should first show the ending of the previous section and then opening of the new section. But in the website I have called SWF files. I am not calling different SWF files for the presentation CD because after compiling it in to a .EXE it still show the rest of the SWF files in the CD which I don't want to show. So that's why I have decided that instead of calling different SWFs I will call different Movieclips so that in the end it will show it in a single .EXE file.
In the SWF part we used a variable which used to hold the name of the SWF and when the next button is clicked it checks whether the associated SWf is loaded or not and then play the closing of the previous file and opening of the new file. I tried the same coding using Movieclips but it didn't worked. So I need help in that section. If someone can help.
Regards, Xeeschan
ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 03-21-2005, 09:31 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Transitions For Movieclips... Is It Possible?
I basically want to add transitions to just movieclips or at least i think that would be the appropriate term. The problem is I want to have a sub menu that expands and contracts. So basically I want when lets say button "1" is pushed submenu, lets call "sub1" slides in. Then When you click "2", "sub1" slides out and "sub2" slides in. I don't really have a clue how this would work but any help is appreciated.
By the way, it will probably done in like 2 weeks but I have been working on my FIRST site ever. It was the reason I joined kirupa in my search for knowledge. Before this site, which I am still doing, I had not done a SINGLE Flash or PS ever. I mean ever, I had never even seen them let alone know that ActionScript even existed! I think you guys will like it since I am spending about 2 months on it (and Im still not done). I guess I am one of those people who don't like to put out mediocre work when i know its mediore. Well Thanks for the help.
Mike
Transitions For Movieclips... Is It Possible?
I basically want to add transitions to just movieclips or at least i think that would be the appropriate term. The problem is I want to have a sub menu that expands and contracts. So basically I want when lets say button "1" is pushed submenu, lets call "sub1" slides in. Then When you click "2", "sub1" slides out and "sub2" slides in. I don't really have a clue how this would work but any help is appreciated.
By the way, it will probably done in like 2 weeks but I have been working on my FIRST site ever. It was the reason I joined kirupa in my search for knowledge. Before this site, which I am still doing, I had not done a SINGLE Flash or PS ever. I mean ever, I had never even seen them let alone know that ActionScript even existed! I think you guys will like it since I am spending about 2 months on it (and Im still not done). I guess I am one of those people who don't like to put out mediocre work when i know its mediore. Well Thanks for the help.
Mike
Transitions With Internal Movieclips
I was wondering if anybody messed around with the verison of this tutorial with transitions for external swf's using movieclips in the library instead of external swf's. and if so maybe could help me out with doing that? i basically took the code
container.loadMovie("section1.swf");
and changed it into
container.attachMovie("section1", "section1", 1);
...and tried some other stuff but can't seem to get it to work. anybody have any ideas? if so i'd really appreciate it.
Transitions Between Movieclips In A Container
My buttons are inside movieclips. Each button attaches another movieclip from the library into a container. Everytime I try the swf by pressing any button, it attaches perfectly to the container. The problem is that once a movieclip is attached, if I press another button, the new movieclip does not substitute the previous one.
Furthermore, I am also trying to have a nice transition between movieclips as per this tutorial:
http://www.kirupa.com/developer/mx2004/transitions.htm
The only difference is that this tutorial is for external swf and in my example, all the movieclips are already in the library.
Please help me. Here is the actions I have for the on release state:
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "contact";
_root.container.attachMovie("contact", "contact", 1);
} else if (_root.currMovie != "contact")
{
if (_root.container._currentframe >=
_root.container.midframe) {
_root.currMovie = "contact";
_root.container.play();
}
}
}
Confusion With Movieclips And Scene Transitions...
Ok, I was having probs with scene to scene transitions (http://board.flashkit.com/board/showthread.php?threadid=328846) and was advised to use movie clips.
My movie goes as follows:
Scene 1 stops at frame 1 and my movie clip with my content moving in loads. When I click my button, frame 2 loads a clip with my content moving out, and at the end of this clip is a go to scene 2 action. This is where my next content will move in in another clip.
Seems straight forwards huh? However, for some reason my clip in scene 1, frame 2 (the content moving out) keeps looping. I've looked at actions over again but can't work out why. Any ideas? I'll send a copy of my .fla if this will help
Thx
Lev
ps. when people talk about loading in .swf's is this movie clips also? and are layers levels or is this all something totally different?
Tween Transitions, Movieclips & OnRollOver Flicker
Hi, I'm using actionscript to make a button out of a movieclip that use's an elastic mx.transitions class for onRollOver and onRollOut. My problem is if you hold the mouse cursor near the edge of the movieclip it keeps restarting the elastic tween which results in an ugly flickering effect (closer to the center of the mc is fine, you don't get the restarting/flicker) .
Is there anyway I could stop this from happening so that the tween plays right through even if the mouse cursor is held on the edge of the mc?
Transitions Between External SWFs W/ Symbol Transitions - HELP
So I've been pouring over this forum looking for a solution to my problem. (this is probably a little lengthy, so I apologize in advance).
I've been using the techniques in the tut: Transitioning between external SWFs
to create a little flash movie to be used for work. I've created files to mimic the tut, ALMOST to the T.
Somethings that I have changed... I'm using a transition on a symbol to fade in and out. I'm also using a gray gradient in the first 12 frames as a "woohoo, look at me" intro.
So my problem is that when I start the mainmovie.swf file it's supposed to pull in the first swf file (section1.swf) and go through the same actions as the above tut. But what is REALLY happening is that section1.swf starts, but it's only the gray gradient. When I click on button 2, I get the same gradient, only this one loops (which isn't supposed to happen). Same thing with section 3.
I've gone through the code (which should be right, because I cut/pasted into flash, changing only the file names), but also doesn't mean much, because this is my first dive into AS.
Yes, I have five buttons and only three external fla files, I figured, let me get these working first, and then do the other two buttons.
On top of this, I wanted to get the entire sequence to play and loop three times. But my main concern is to get the buttons working. I would attach the files, but they are too big, even zipped.
HELP PLEASE! Thank you in advance,
~V
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!
Loop Through Movieclips Within Movieclips
Hi guys, I ve checked everywhere but I cant find the simple answer to this. I just need to be able to control different movie clip from a loop. The only difference between this and what all the turorials tell me is that my Catergory buttons are within the scope of another movie clip..ShopCatergories..I would have thought the following code should work but I does nothing.
Code:
var temp_mc;
//I put this one in just toe check if I can manually stop on of the
//animations..this works fine.
ShopCategories.CatButton1.stop();
//But none of these stop playing??
for (var i = 0; i<3; i++)
{
temp_mc=["CatButton"+i];
trace(""+temp_mc);//traces the correct thin eg..CatButton1 etc
ShopCategories.temp_mc.stop();
}
Movieclips Interacting With Other Movieclips
I am creating an AS3 Flash CS3 project that moves shapes to other shapes. I have created movieclip buttons, when one clicks on the button a shape connects to another shape. Each button has its own layer and within that layer lies two additional layer. One layer for the actions and another layer for the button states.
I am now trying to disable one button while another is enabled or in the down state.
I have tried listening for the state of the other button, root paths, and every other option that I could find on the net, but with no avail.
Controlling Movieclips Within Movieclips
I have a button on my root scene which I want to control the timeline of a movieclip that is an object with a movieclip on that root scene. Basically-
Scene 1 -> Movieclip (archMC) in 'Scene 1' -> Movieclip (picnavi) in 'archMC'
I want a button on Scene 1 to change the timeline head to go to frame 1 on the movieclip 'picnavi'. And I only have about 6 hours to figure out how to do it!
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. i think it could have targetted it wrongly.
can someone help me pleeeease!
aryastark
Loading Movieclips Into Movieclips
what i want to do is have one movieclip load and play certain movie clips whenever a certain button is pressed. i am doing this in my video game, as when u press left, it will load the left walking animation and play it while it moves, then when u release the left arrow key, it will load the standing still animation.
any help would be appreciated!
Accessing Movieclips Within Other Movieclips?
Greetings,
I appreciate you taking the time to look at this problem i am having.
I am still transfering from AS2 to AS3 and right now i am having a very annoying problem.
THE STRUCTURE:
Maintimeline contains 2 buttons that i want to use to access children in a bunch of movieclips.
rectangle_mc has circle_mc circle_mc contains xx_mc xx_mc contains wtf_mc
placed on frame 1 on maintimeline
Why can't flash see my nested movieclips? I remember in AS2 you could go down the line:
_root.movieclipA.movieclipB.movieClipC.movieclipD. movieclipE.gotoAndPlay(frame#);
Any Help Appreciated Thanks,
Attach Code
stop();
function playTimeline (evt:MouseEvent):void {
this.rectangle_mc.gotoAndPlay(2);
}
start_btn.addEventListener (MouseEvent.MOUSE_DOWN, playTimeline);
/*This code errors out*/
function EndTimeline (evt:MouseEvent):void{
this.rectangle_mc.circle_mc.xx_mc.wtf_mc.gotoAndPlay(2);
}
stop_btn.addEventListener (MouseEvent.MOUSE_DOWN,EndTimeline);
Movieclips Talking To Movieclips?
Hi,
Probably a silly question (had a few late nights!!)...
Can I communicate between movieclips?
I have a movieclip containing some buttons but I would like the buttons to tell another loaded movieclip to do something?
Im not sure what to put before the gotoandplay option ie:
on(press){
......... gotoAndPlay("text");
}
etc
Thanks
Spence
Referencing Movieclips Within Movieclips
ok heres the problem:
I have a movieclip which is a button, and this button is inside another movie clip, and this movie clip is within the main movieclip, soo
mainMenu ----> subMenu ----> buttonMenu
how would i reference the button in buttonMenu so that when it is released it goes to requeid frame.
i tried:
_root.mainMenu.subMenu.buttonMenu.onRelease = function() {
required actions
};
but it doesn't work. I'm sure i'm missing something pretty simple but been looking at it for ages now and its just gone blurry.
I've assigned al lthe movieclips instance names.
Many Thanks
Sean
More Problems With Movieclips In Movieclips
I have the next code:
Im trying to make a preloader for the image that gets loaded in a movieclip called picholder,
Now the problem is that i get undefined back for the image ,
so i cannot preload what is not there hehe
and im not sure what im doing wrong .
In my other fla the image passes fine and the code is the same
trace(tes.picholder);
gives me back undefined
where tes is the movieclip i created for each item
picholder is the movieclip where the picture goes in.
(i have put stop() in there and taken it out to test but with no luck)
The code is
Code:
MovieClip.prototype.makeVisible = function() {
clearInterval(this.interval);
this._visible = true;
this.play()
};
function LoadPicInMovie (thepic ,wherein)
{
//wherein._alpha = 0;
trace (thepic);
trace (wherein);
var totalbytes = wherein.getBytesTotal();
var loadedbytes = wherein.getBytesLoaded();
var percentloaded = Math.ceil((loadedbytes/totalbytes)*100);
trace(percentloaded);
wherein.preloadertxt.text = percentloaded;
if (percentloaded == 100)
{
wherein.loadMovie(thepic);
}
}
function clearAll() {
for (var obj in moviecl) {
if (typeof moviecl[obj] == "movieclip") {
clearInterval(moviecl[obj].interval)
moviecl[obj].removeMovieClip();
}
}
}
function AttachMc(counter)
{
tes = GalleryContainer.attachMovie("Holder","item"+counter, counter);
return tes;
}
function List (howmany,Arr)
{
counter = 0;
item_spacing = 160;
luck = 0;
row = 0;
for (var g=0; g < howmany ; g++)
{
var tes = AttachMc(counter);
trace(tes);// fine
LoadPicInMovie(Arr["Clientimages"][g],tes.picholder);
trace(tes.picholder);// undefined
if (luck == 3)
{
row++;
luck=0;
}
tes._x = luck * item_spacing;
tes._y = 140 * row;
trace (counter);
tes.stop()
tes._visible = false;
tes.interval = setInterval(tes, "makeVisible", 500*g);
counter++;
luck++;
}
}
function PutInArray(my_xml)
{
/*
* This function reads the xml file into an array
*
*/
var item_count = 0;
// start with the first item in the XML
var items = my_xml.firstChild.firstChild.childNodes; // menu -> menuitems -> child nodes array
var total = items.length
// create arrays for the values
var TheClients:Array = new Array();
TheClients["Clientids"] = [];
TheClients["Clientnames"] = [];
TheClients["Clientdescriptions"] = [];
TheClients["Clientimages"] = [];
TheClients["Clientdates"] = [];
TheClients["Totaal"] = total;
for (var i=0; i< total; i++) {
// only continue if the type of this item is a squirrel
// create variables for our elements
var clientid = items[i].firstChild; // same as items[i].childNodes[0]
var clientname = items[i].childNodes[1]; // second child node
var clientdescription = items[i].childNodes[2];
var clientimage = items[i].childNodes[3];
var clientdate = items[i].childNodes[4];
// add to array
TheClients["Clientids"][i] = clientid.firstChild.nodeValue;
TheClients["Clientnames"][i] = clientname.firstChild.nodeValue;
TheClients["Clientdescriptions"][i] = clientdescription.firstChild.nodeValue;
TheClients["Clientimages"][i] = clientimage.firstChild.nodeValue;
TheClients["Clientdates"][i] = clientdate.firstChild.nodeValue;
item_count++;
}
return TheClients;
}
// start procedural code
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success){
if (success){
Client = PutInArray(my_xml);
List (9,Client);
trace(this);
} else{
trace('xml file not loaded');
}
}
my_xml.load("portfolio.xml");
stop();
Thanks in advance
Luck
Events On Movieclips Under Other Movieclips?
I have two movie clips added at runtime. For aesthetics, the one NOT listening for any mouse events has to be on top. I have a second clip that gets added beneath the first one; I'm trying to figure out how I can get the one "underneath" the first to listen for mouse events -- essentially, I want the "top" movieclip to be "invisible" to the mouse.
Both of these clips are on the same parent clip, if that makes any difference. Clear as mud? I'm sure this should be simple, but Flash has been beating me up all day and my brain is fried. Thanks for any help!
Movieclips Talking To Movieclips?
Hi,
Probably a silly question (had a few late nights!!)...
Can I communicate between movieclips?
I have a movieclip containing some buttons but I would like the buttons to tell another loaded movieclip to do something?
Im not sure what to put before the gotoandplay option ie:
on(press){
......... gotoAndPlay("text");
}
etc
Thanks
Spence
Transitions
ok.. i'm fairly new to flash, but am rapidly getting accustomed to it.
anyways - I'm interested in learning how to do transitions.
just for an example... say the user presses a button and a box fades in over the background, then some text fades in over the box.
for some reason, what seems like something fairly easy to achieve is freaking hard for me to figure out. I've gone through many a tuturial and they dont give great information about how an effect like this would be achieved in the scheme of a WHOLE flash site.
I would looooove some help
thanks!
TRANSITIONS
Ok i am fairly new with flash, but i need serious help with tranistions. I just don't understand them, and how to incorporate them into flash. i have created a site, but it is in serious need of transitions. HELP. Any resources would be helpful.
http://www.digital-domicile.net/home.html
thanks
Transitions Between Two Swf
Hello,
I am using FlashMX.
i've got two swf movies, and i want a transition go between the two.
and the transition is a blind closes and re-open, it closes like the intro of
http://www.tedbaker.co.uk
i.e.
When the user click a button,
1. swfA --- the blind closes above the swf
2. swfA changes to swfB (the blind is closed, so we can't see the changes from A to B)
3. the blind opens (we see swfB)
I get stuck in this movie transition problem for quite sometime,
how can i tell the movie to do the changes one by one, and after the blind closes, change the movies, and reopen the blind... ??
or
Is there some kinds of standard action script to perform this action??
Transitions....
Im sure this has been asked before....but I am forced to ask it again.
I will be using 2Advanced.com for an example in this post..(so please refrain from OFF TOPIC COMMENTS)
I curious as to how you get transitions from content to content (I assume they are using external.swfs for each button (right?)
the effect I am looking for is how to get an effect (tween..whatever) to be seen OVER the existing external.swf
Example: when you click on a button in 2A site...the "wall" tweens in 'OVER' the content...does the looping animation..then 'tweens' out..revealing the NEW content underneath. How are they doing this?
I have tried using swapDepth...but it SUCKS...and has a problem with making thngs run SLOW..and sometimes STOP. I also thought about the idea of having the 'tween' animationbe on another layer ABOVE a 'container' MC and have my external.swf's load into this 'container' MC...and once loaded..have it target the 'tween' clip..and start it tweening out (to reveal new content underneath it)...which would be fine... But then how would I have my preloader (which is in the external.swf) show the user how much time is left to load..if the 'tween' clip is ON TOP of the container MC (which the external.swf's will load into??)
More or less..how is 2A achieving this effect? Thanks...sorry for the idiot question....Im just very tired...
-whispers-
Transitions
Is it better to play a transition at the beginning of a swf file when loading in multiple sections? Or is it more efficient to create a MC and load that everytime you play a scene? Any suggestions or if there are other ways of doing this? thanks in advance.
Transitions
Is there a tutorial somewhere on creating transitions from one section in a site to another? I want each of the sections on my site to build when you enter them and break-down when you click on another section. I don't even know where to start, so if anyone knows of a tutorial or can tell me how to organize it, I would appreciate it.
|