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








Movieclips


TO WHOM IT MAY CONCERN:

I want to have a movieclip play when a button is pressed then
released. How can this be done?


Sincerely,


Kevin


Using Flash 5




KirupaForum > Flash > Flash 8 (and earlier) > Flash 5
Posted on: 01-22-2003, 04:53 PM


View Complete Forum Thread with Replies

Sponsored Links:

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;
}
}

View Replies !    View Related
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.

View Replies !    View Related
[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) 

View Replies !    View Related
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...

View Replies !    View Related
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

View Replies !    View Related
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

View Replies !    View Related
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!

View Replies !    View Related
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?

View Replies !    View Related
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)

View Replies !    View Related
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!

View Replies !    View Related
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.

View Replies !    View Related
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

View Replies !    View Related
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

View Replies !    View Related
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!

View Replies !    View Related
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)

View Replies !    View Related
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.

View Replies !    View Related
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!

View Replies !    View Related
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.

View Replies !    View Related
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!

View Replies !    View Related
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!?!

View Replies !    View Related
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?

View Replies !    View Related
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

View Replies !    View Related
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?

View Replies !    View Related
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

View Replies !    View Related
[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!

View Replies !    View Related
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();
}

View Replies !    View Related
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.

View Replies !    View Related
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!

View Replies !    View Related
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

View Replies !    View Related
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!

View Replies !    View Related
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);

View Replies !    View Related
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

View Replies !    View Related
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

View Replies !    View Related
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

View Replies !    View Related
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!

View Replies !    View Related
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

View Replies !    View Related
Images Inside MovieClips Inside MovieClips
Hi. I'm trying to create a virtual photo album that you can drag photos into and rearrange them etc. The plan is to have it load/saveable using XML

In my library I have two MovieClips called Page and Photo.

Page is supposed to be able to contain many Photos. A Photo is supposed to hold or be an image (a photo).

I have declared two classes, Page and Photo, which are linked to their respective MovieClips

Actionscript:

class Page extends MovieClip {

private var _photo1:MovieClip;

function Page(){}

public function addPhoto(){
attachMovie("Photo", "_photo1", getNextHighestDepth());
_photo1.loadPhoto("File0025.jpg");
}
}

Actionscript:

import mx.controls.Loader;

class Photo extends MovieClip {

private var _photoLoader:Loader;

function Photo(){}

function loadPhoto(url){
trace("Inside Photo trying to load " + url);
_photoLoader = new Loader();
_photoLoader.load(url);
}

public function onPress(){
this.startDrag();
}

public function onRelease(){
this.stopDrag();
}
}

However, I can't get an image to show. The Photos have to be draggable so they have to be MovieClips. I can't use loadMovie() because I have to abe to control the size of the image. I'm trying to use Loader but I can't get it to work.

Question: What is the best way to allow my Page obj to have draggable images (which I'm trying to do as Photo objects)? I figured it has to use a Loader component.

Advice?

View Replies !    View Related
Run 2 Movieclips
ok here is my problem...it is simple i don't know why i can't figure it out ! When i click on a button i need my movie to run 2 movie clips, but i totaly forget how to use the _root. command. Could somebody please help me . Thanks for your time .

View Replies !    View Related
Run 2 Movieclips
ok here is my problem...it is simple i don't know why i can't figure it out ! When i click on a button i need my movie to run 2 movie clips, but i totaly forget how to use the _root. command. Could somebody please help me . Thanks for your time .

View Replies !    View Related
Movieclips....
Hey

How do you make a movie clip work when you push a botton?

I know that you have to make the movie clip stop on frame 1 but how do you make it go to frame 2 by pushing a botton in the actualy movie?

Thanks

[Edited by And1 on 12-16-2001 at 05:45 PM]

View Replies !    View Related
Movieclips That Look Around
Imagine a space in which say 20-25 movie clips are moving around a stage. I would like to give a movieclip the ability to "know" whether another clip of a certain type is within a given range. Ideally if there were more than one clip in the range I would like it to identify the closest clip. I am thinking of doing this with a 100% transparent circle movieclip laid ontop of my sensing clip. Any ideas on how to handle this "seeing clip" would be appreciated.

View Replies !    View Related
Movieclips
hello everyone.

I am having trouble positioning my loaded movies.

1. When I load an attached movie from my library, how do I syntax the x and y values in order to place it on my stage?
which catagory do i go to? ie. objects,properties etc.

2. when loading an external .swf into a movieclip, how do I position the movie inside the mc?

any help on either one fo these would be GREATLY appreciated. thanks in advance.

View Replies !    View Related
Movieclips
HI, i made a movie clip and put two buttons on the main scene. well, i wanted to assign actions to one button that on roll on the movieclip should play,i did that.and the second action to the same button that on roll out the movie clip should stop at the current frame it is playing,i did that too. thirdly, i wanted to assign it with the action that when i roll on the second time it should play from the frame it had stopped it. I dont know the script. help me.

Now for the other button, i wanted that the movieclip should go backwards and also it should also go back from the current frame where it had been stopped by the first button.

Requiring Urgent Help

View Replies !    View Related
MovieClips Always Above
On bottom layer "stars" I have 3 MovieClips leading by Action script.
Over layer "stars" I have layer that contains tween animation of full size rectangle from alpha= 0 to alpha=100 (because I need get movieclips unvisible), but playing MovieClips are visible always above.
Exist some way to do it? Levels?
Thanks

View Replies !    View Related
Movieclips
i want to import a separate flash movie into a movieclip and i want to place the movieclip at certain x y coordinates. I cant use .attachmovie and use a separate flash movie ... it doesnt work . and when i use the loadmovie command it loads the movie but not in my current movie! its pissing me off....

View Replies !    View Related
Many MovieClips
Before I do it the hard way... can anybody tell me:

I have a mc on _root level, it has a linkage name like clip1.

this clip has this code on frame 1

this.createEmptyMovieClip("myjpg", 1);
myjpg.loadjpg(_root.File[0], "hhh1");
myjpg._x = -(_root.pageWi/2);
myjpg._y = -(_root.pageHi/2);


It loads _root.File[0] via a loadjpg fx that I have made and then gives x and y some values.

Then lets say I want 20 of these clips, - but clip2 should have some code like this:

this.createEmptyMovieClip("myjpg2", 1);
myjpg.loadjpg2(_root.File[1], "hhh2");
myjpg2._x = -(_root.pageWi/2);
myjpg2._y = -(_root.pageHi/2);


and a linkage name like clip2

and the same with clip3.... etc.

So do I have to make 20 clips and give them linkage name via 'hardcode' or is there some clever way that actionscript can helt me so I can create them in a more dynamic way?


later on I have this code

createEmptyMovieClip("test", 4);
test.attachMovie("clip1", "newClip", 1);

Where I use the linkage name clip1 to attach a clip to my new test clip, - can I do this in another way, - I mean get the same effect but in a way so that I dont have to use the linkage name???




Best regards

Godowsky

View Replies !    View Related
Using Movieclips
Hi im new with flash and programing so please dont lose your tempers.

I want to make a start frame with different buttons and then after pressing a button it goes and plays the movieclip i made. I get the play movie part to work but i cant get it to return to the initial frame after playing how would i do this. As simple as possible please, so that i can understand it. and if anyone can give me a tip about a god online help with using movieclips in movies.

View Replies !    View Related
A Lot Of Movieclips?
Hi guys,
a general question about the structure of the flash sites:
is it better to use a lot of movieclips and control them by actionscript (for example each section one movieclip symbol) or the best way is put every tweening, images and text on the main timeline?

Sorry for my english, i hope that the question is clear.
Thanx,
Noir

View Replies !    View Related
Movieclips
ok... im kind of stuck...
i have 2 movieclips on the main timeline... the first one is named "one" the other is "two"... well what i would like to do is if "one" is stopped at a labeled frame "pause" when the user clicks the button in "two" I'd like that click to tell "one" to gotoandplay a different frame in "one"
i hope this made sense... i also hope that someone can help me cause im confused... im not sure if i should be using else or else if or if LOL

View Replies !    View Related
Movieclips
Hi,

Confused with my last message but hoping someone could help me with the FLA file. If 1 buttond is clicked it opens one menu (via a movieclip), if another is pressed it does the same for another movieclip.


What i want to know is when the main movie is published what code do i use to make the first button animate and display its information on loading of the first frame.

Thus loading the homepage instantly wen movie loads.


K

View Replies !    View Related
Movieclips, Help
this is what i got:
I've got 4 MC's on a background image. I want the 4 MC's as navigation on a simple flash website.
So I want to use the MC's as buttons, when I click on one of them the animation goes to another scene and continues.

I know it's easy to do this with just simple buttons, but I want to use movieclips because they have a rollout animation and i dont know if that is possible with a simple button.

So is it possible to use the MC's the way I want to?

hope someone can help me...

View Replies !    View Related
Help Again On Movieclips
I am making a media kit CD...

Main page has navigation. I hit Navigation item one and it goes to frame 2 where movieclip (A) loads...

movieclips A plays whichlooks like a TV with steps... each step talks about somethign and this is where I and get to frame 20 and it loads
movie clip b in the first step on top of movieclipA, play and then unload and
automatically now go to load movieclip C on the second step, play and turn unload and then Movieclips D and unload...

MY question: How do I say, in movieclip B at the last frame, unload and go back to movieclip A and continue with frame 21?

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved