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




OnEnterFrame() For Nested Clips Help



Good day! I was wondering if anyone could explain the following:

Inside an onEnterFrame() event handler, placed on the main movie timeline (represented by the global variable mainMovieTimeline), is a simple script that works out the percentage of the movie loaded and then displays the coresponding frame (between 1-100) in a preloader movie clip (called preloaderMain), which has been placed on level 1 in the Flash Player document stack, via the attachMovie() method.

The code works fine as it is, but I cannot understand why I cannot place the preloader code into an onEnterFrame() event handler for the preloader movie clip (preloaderMain), from the main timeline, with something along the lines of the following:

mainMovieTimeline.preloaderMain.onEnterFrame = function()
{
preloader code here
};


Here's the code that I have already. If anyone could explain the problem I'm having, it would be appreciated. Thanks in advance.

mainMovieTimeline.onEnterFrame = function()
{
if(percentageLoaded < 100)
{
loadedBytes = Math.round(this.getBytesLoaded() / 1024);
percentageLoaded = Math.round((loadedBytes / totalBytes) * 100);
mainMovieTimeline.preloaderMain.gotoAndStop(percen tageLoaded);
mainMovieTimeline.preloaderMain.percentageLoaded_t xt.text = percentageLoaded;
}
};



FlashKit > Flash Help > Flash ActionScript
Posted on: 02-26-2004, 01:01 PM


View Complete Forum Thread with Replies

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

Problem Sizing Buttons/clips In Nested Clips
Ok, please see the attached file. What I'm trying to do is create a vertical array of text clips nested in a single clip, then set that clip as the scrolContent for a scroll pane.

So far, I'm able to attach the text box movie clips in the parent clip, arrange them, and set their text values.

What i'm having trouble with is accessing that nested clip's functions, and more specifically, sizing a button in that clip to match the width of the scoll pane.

I know I must be missing something, but I've looked at this for hours. Any ideas? Thanks!

Nested Clips Having Different Scale To Timeline Clips?
I have placed some movie clips inside another clip & I’m using their _width & _height properties to dynamically set the width & height sizes of some other clips that I’m placing on the main timeline. So the new clips on the main timeline will have the same _width & _height properties as the nested clips.

Problem I have got, & this has been confirmed by the dimensions in the Property Inspector panel, is although the clip that I’m placing on the main time line looks about 20 times the size of the nested clip,
When you check both clips dimensions in the inspector panel they are actually both around the same size?

Why do nested clips seem to have a different scale to timeline clips?

To confirm that a picture paints a thousand words a demo fla is attached which shows & explains everything much better.

I’ am aware of the “global & local” coordinates system but thought this was just for _x & _y positions not size.

Nested Clips Targeting Other Clips On Root..
ok check this out guys.

3 frame movie

each frame has seperate clips

frame two has a animation clip nested inside another clip, so two clips up on frame two of root has navigation button "back"

i need to get back to root  frame 1 clip "intro" frame 250 of that clip

here is what i have on the button:

on (release) {
_root.intro.gotoAndPlay(250);
}

not working. Why?

Thanks in advance...

---------------------------------------------
www.orlandomediasolutions.com
www.mlstaffing.com
www.mwll.com

Nested Movie Clip Buttons? Event Bubbles OnEnterFrame Workaround Question...
yes i know about senoculars site and what it has to say about this...

in this case i do not have time to go through that and learn it properly so im looking to figure out an onEnterFrame solution

say you have an mc(mc1) with another mc(mc2) INSIDE mc1. Both have button functions, and because AS2 doesn't allow both functions to work properly at the same time i need to set it up so that if the mouse is in the area of the stage where mc1 lies it fires a rollout function...

here is what i have(forgive me if it's choppy, after all thats why i'm here!)...


Code:
stop();

rollover = function(){
gotoAndPlay("over");
}
rollout = function(){
gotoAndPlay("out");
}


mc1.onEnterFrame = function(){
if ((_xmouse<mc1._x + mc1._width)&&(_xmouse>mc1._x)&&(_ymouse>mc1._y)&&(_ymouse<mc1._y + mc1._height)){
rollover();
}else{
stop();
}
}

mc1.onEnterFrame = function(){
if ((_xmouse<mc1._x)&&(_xmouse>mc1._x + mc1._width)&&(_ymouse<mc1._y)&&(_ymouse>mc1._y + mc1._height)){
rollout();
}else{
stop();
}
}

Assigning OnEnterFrame To Array Of Clips
Hello,
I have a for loop inside a class. I add a number(12) of attached MovieClips to an array called textObjs_array. I am trying to get each of the MovieClips to responed to the onEnterFrame event. It obviously won't work the way I'm doing it. Can somone explain to me why it isn't working and what would be a better method of doing so.


for (var txtObj in this.textObjs_array) {
trace(txtObj.toString()); // returns 0 through 11
this.textObjs_array[txtObj].onEnterFrame = function() {
trace(txtObj.toString()); // always returns 0
}
}


Thanks in advance,
Todd

OnEnterFrame For Attached Movie Clips
I am dynamically creating clips from a library symbol and need to assign an onEnterFrame event to each clip as it's created but I'm having a lot of hassle!

The code (which is within a function, if that matters!) looks like so:


Code:
for (i=0; i<arrImages.length; i++) {

newPhone = phones.attachMovie("phone", "phone"+i, i);
newPhone.loadMovie("images/phones/"+popImages[i]);

newPhone.onEnterFrame = function() {
this.test += 1
trace(this.test);
}

}
The phones are being attached and the images are being loaded into them yet the onEnterFrame event doesn't seem to be occurring. Any idea why?

Maintaining Event Behavior For Movie Clips Nested In Movie Clips
Is there any way to maintain a clip's event callbacks when said clip is nested in a parent clip that has its own definitions for those callbacks?

In other words, if clip B has a definition for .onPress and clip A has a definition for .onPress, is there anyway to maintain clip B's definition if it is nested in clip A?

I have tried doing it by making clips into movie clip subclasses but it doesn't work... but how do components work then?

[F8] OnEnterFrame Not Working With Attached Movie Clips
I cannot get an onEnterFrame function that attaches a movie clip to allow a button inside the attached movie clip to work. It attaches the clip but does not allow functionality of the clip. When a button is on the stage to attach the clip it works fine. File is attached onEnterFrame function is commented out. Thanks

Nested Clips
I have a movie clip with a button nested in it. If I want the playhead to go to the main timeline and play a certain frame when the button is clicked, basically, how do I do it? The regular go to label doesn't work because the button is inside a movie clip and therefore on its own timeline. Anyone know what I mean?

-doc

Nested Clips- Please Help Me
can someone please help me? I am trying to get the _x and _y position of a nested clip relative to the main stage, not its parent.

I have a clip "box" and clip "box_corner" nested in it, and "box" moves around on the main timeline, but however I seem to reference it, I keep getting "box_corner"s position on "box" instead of on the main stage.

I would REALLY appreciate any help. Thanks.

Tinkertoy

Help With Nested Clips
OK i have this clip wich has a scrollpane inside ok? lets call it A
I load this clip (A) inside another (B) with loadmovie, then i load that clip (B) inside another (C) with loadmovie also. The problem is that when i do that and i use the scrollpane, a green rectangle appears arround the scrollpane, wich shouldn't off course, anyone know why this happens? thx a lot

[F8] Nested Clips
Hi there everyone, a simple question.... i hope...

I've got a clip with two nested clips, each on consecuitive frames.

On testing, I was expecting it to play the first nested clip in frame 1 then the second nested clip in frame2.

What actually happens is that it moves from frame 1 to 2 without playing the clips nested inside.

I presume I need to fiddle with action scripts, which I have been. I have tried play and stop combinations etc. The best I can do is get it to play the first nested clip but then it doesn't move onto the next frame.

Oh and I'm not sure whether to put the script in the frame or actually in the instance of the nested clip.

Geez I hope that makes sense! Anyone help me out? I've been banging my head against this for over an hour now!

AttachMovie Via Looping And Assigning OnEnterFrame Methods To The New Clips
I´m trying to attach movies from the library and also giving them an enterFrame function. It works well - BUT- the problem is that the function is working only for the last attached movie. I guess it has to do with the "i" variable. I want the onEnterFrame function to stick with the object itself. Have tried different solutions but I just can´t get my head around this. Any hints?

And the code.


ActionScript Code:
for(i=0;i<10;i++){
    attachMovie("linkage_id", "linkage_id"+i, 100+i);
    with(eval("linkage_id"+i)){
        _x = 10*i;
        _y = 10*i;
        reversed = false;
        onEnterFrame = function(){
            if(!reversed){
                nextFrame();
            }else{
                prevFrame();
            }
        }
    }
}

How To Hide Several Movie Clips On EnterFrame (or OnEnterFrame SwapDepth) AS2 CS3
Hi Guys,

I am new to AS2, so any hints would be appreciated. The movie I am doing uses Kirupa's rollover tutorial to roll an effect off a movie clip. As there are several of these on the page, I am also using swapdepth to put them on the top of the other clips when we are hovering over them. Otherwise the layer order messes things up.

The test file can be seen at www.greetingsfrombayer.com/new.

The (butchered) mc code is as follows:

---------------
stop();

this.onEnterFrame = function(){
if(rewind == true){ //if rewind switch is set to true play backwards
prevFrame(); // play backwards
}
}

this.onRollOver = function(){
rewind = false; //set variable (or switch) that decides wether ot not to play backwards...
play(); // play this movie clip.. (grow the button(tween));
_root.x +=2; // this moved the movie clip to the top, to get out of the way of the others
this.swapDepths(_root.x);
}

this.onRollOut = function(){
rewind = true; //set or rewind switch to true so it will play backwards...
_root.x -= 3; // puts it back down onto it's level again
this.swapDepths(_root.x);
}

this.onRelease = function(){
getURL("http://www.animalhealth.bayerhealthcare.com","_blank");
}

---------------

The issue is that I have a closing image that comes on about a minute into the animation. (The movie pauses on frame 1 for 60 secs then moves on) But if a user is still hovering over one off the movie clips it keeps that movie clip on top, over the animation, which of course looks stupid.

So I either need to have an onEnterFrame (or alternative) that will delete all of the little movie clip rollovers, or will bring the final large movie clip to the top when it starts, whatever the user is hovering on. Any ideas would be really appreciated as this is the last little bit of the job to finish.

And if you do visit the test site, sorry about the music. The animation at the end fades in after 60 sec.

I am using CS3, with AS2.

Cheers,

Will

PRELOADER FOR NESTED CLIPS
All tutorials I find for preloaders talk about the "getframes" command, which doesn't help with the kind of movies i'm desiging–they're all movie clips within movie clips. So what's the trick? Any assistance would be greatly appreciated. Thank you.

Preloader In Nested Clips
I've got the preloader below woking in my main movie, and I have my main movie loading a nested clip using loadMovie("work.swf", _root.workClip);

I've slightly changed the variables in the preloader in the nested clip, and am loading other nested clips within that movie. None of the loaders work in any of the nested clips and I've tried using _parent.procent to make it work, but it doesn't.

Preloader script (for main...this works fine):

onClipEvent (enterFrame) {
_root.procent = int(_root.getBytesLoaded()*100/_root.getBytesTotal());
mc_bar._width = _root.procent;
}

and

if (_root.procent<97) {
gotoAndPlay(1);
} else if (_root.procent>97) {
gotoAndPlay(3);
}

Preloader script (for nested clip...doesn't work):

onClipEvent (enterFrame) {
_parent.procent = int(this.getBytesLoaded()*100/this.getBytesTotal());
mc_bar._width = _parent.procent;
}

and

if (_parent.procent<97) {
gotoAndPlay(1);
} else if (_parent.procent>97) {
gotoAndPlay(3);
}

HELP!!!

TIA

Nested Clips, What Am I Doing Wrong... See Fla
hey,
i thought i had everyhting under control with these nested clips...

but see for yourselves, the attached fla. file...

if i move over the blue button movie cip with instance name EEN has to play starting in frame 2., but nothing happens...

WHAT AM I DOING WRONG?

greetz
melvin

GotoAndPlay From Nested Clips
There was a thread a few days ago on this issue, but I have another question about it. I am using scenes in my movie. I need to link from nested movie clips to later scenes in the main timeline. I know you can't use the "scene" argument with gotoAndPlay from within a nested clip, but I was under the impression that you could direct the playhead to a labeled frame on the main timeline from a nested clip. However, I don't seem to be able to get that to work. I haven't posted the script example, but I was wondering if there is something general that I should know?

Nested Movie Clips Help
Flashkit member Garbage originally helped me with this menu system. Since then I've added a menu item and now it has developed a funky problem. I've been going over and over this thing for two days and I can't see why this is happening.
http://synap-sys.com/submenu.html
here's the problem: every combination of menu choices works fine until you try to go from an open 'service' menu to an open 'civic' menu. You click on 's' service menu appears, you click on 'c' and the service menu retracts like it should but the 'civic' menu never opens up, and it also disables all the other buttons. The 'civic' menu works fine until you try to choose it after the 'service'
Man, I can't figure it out.
Someone please help!
I've included the .fla if anybody wants to take a look at the Script (originally written by Garbage,thanks)

Thanks
Adam

Nested Movie Clips
FLASH 5:-

I have an MC nested within another MC.

MC1 is on the stage and MC2 is nested within MC1.

Now I have 2 buttons on stage that on (rollover) display both MC1 and MC2.

However, button 1 on (press) makes MC2 goto nextFrame whereas button 2 makes MC2 goto prevFrame. This works fine until I roll out.

After rolling out and rolling over either button again MC2 has gone back to the 1st frame.

Is there anyway I can make the nested MC not return to the 1st frame ?

MC2 contains 10 frames and each frame has a STOP(); action attached.

Thanks

Stopping All Nested Clips At Once
Is there a way to put a button on one layer and then have everything in the timeline stop (and also play)? this includes all nested movie clips. do I have to reference each one seperately?

Also, what is the syntax ... I can't seems to get it right. thanks for any help.

Accessing Nested Clips
This is the easiest thing in the world, but I can't seem to get it working. I'm trying to migrate a video player from AS 3.0 BACK to AS 2.0. Right now, I've got a lot of it working and it shouldn't be to big a task, but I'm having an issue with one part of it.

If anyone has ever seen a youtube video embedded in another page besides youtube, then you've seen the volume slider that I'm making. Basically, you roll over the speaker icon and the volume slider glides out from that and then you can click on the slider and drag it to where you want it. This is where my problem is.

Here is the layout of the clips (instance names):

PHP Code:




"volume_mc" (speaker icon)    |__"volumeSlide" (clip nested inside volume_mc that contains the slider)                |__"volumeSlider" (the actual slider nested inside volumeSlide)







on my volume_mc clip, it actually has a rollover timeline animation that slides the volumeSlide clip out and then stops. The problem is, that NOTHING is registering. I tried using the following code in the main timeline:


PHP Code:




//original codethis.volume_mc.volumeSlide.volumeSlider.onPress = function(){    trace("volumeSlider");    this.startDrag(false,2.6,9.6,2.6,31.6);}this.volume_mc.volumeSlide.volumeSlider.onReleaseOutside = this.volume_mc.volumeSlide.volumeSlider.onRelease = function(){    stopDrag();}//then tried this though I didn't really think it should make a differencevolume_mc.volumeSlide.volumeSlider.onPress = function(){    trace("volumeSlider");    this.startDrag(false,2.6,9.6,2.6,31.6);}volume_mc.volumeSlide.volumeSlider.onReleaseOutside = volume_mc.volumeSlide.volumeSlider.onRelease = function(){    stopDrag();}//then I just put these in there to see what happened.  The only one I got a trace statement from is the first one no matter WHAT I rolled over:this.volume_mc.onRollOver = function(){    this.gotoAndPlay(2);    trace("volume_mc rollover");}volume_mc.volumeSlide.onRollOver = function(){    trace("volume_mc.volumeSlide rollover");}volume_mc.volumeSlide.volumeSlider.onRollOver = function(){    trace("volume_mc.volumeSlide.volumeSlider rollover");}








Could someone please give me an idea of what's going wrong?

LoadMovie, Nested Clips
I've read every thread I could find on this topic, as well as all existing documentation on loadMovie, but nothing seems to help! I'm loading an external swf into an empty MC on stage called thumbs_home.


Code:
thumbs_home.loadMovie("scrollingwindow2.swf", "tree_thumbs");
thumbs_home._x = 50;
thumbs_home._y = 0;
The .swf shows up and any attributes assigned to "thumbs_home" appear, but if I insert "tree_thumbs" as the path, it's like it doesn't exist.

I have general_th as an instance name of an mc on the stage in the first frame of "scrollingwindow2.swf". I need to use some actions on the mcs inside th_general but nothing I do works. For simplicity I'm just trying to get a response from th_general.


I've tried


Code:
thumbs_home.th_general._alpha = 40;
and inserting _root, _parent, _this, _level0 in front, and using thumbs_home.tree_thumbs or just tree_thumbs to see if the target is a factor. Spelling is checked. I'm using Flash 8.

(I'm able to target nested clips using attachMovie, but for this one I'd rather use an external swf.)

Much obliged for any suggestions or links to material I may have overlooked

Problems With Nested Clips
I am having major functionality problems with nested MCs in Flash 8. Everything I read on the web seems to address this issue for people who need the nested MC to reference the root timeline. What I want is for a keypress to activate something within the nested MC. It is really pretty simple. I have an invisible button within the nested MC, and it should move the nested MC to a different frame.

This is one of the buttons (below, sorry I don't know how to make the code show up in a box). "Innerhead" is the name of specific frame I am targeting. I had previously set it up with just the number of the frame, and began labelling the frames in an attmpt to solve this problem


on (release,keyPress"k") {
gotoAndPlay(innerhead3);
}


Also, I had a collision-detection based function that stopped working when I nested the clip. It is designed to act as a boundary for a pair of eyeballs so you can move them around with arrow keys -- basically this is an eye-socket for a head in this animation. Since I nested the head MC (so I could add dynamic scaling to it, and make it so the head could fly around) the eye sockets dont' work anymore.


onClipEvent (enterFrame) {
a=0;
b=0
c=0
d=0
{
if (this.hitTest(downwall))
a = myspeed; }
{
if (eyes2.hitTest(upwall))
b = myspeed; }
{
if (this.hitTest(innerhead.leftwall))
c = myspeed; }

if (this.hitTest(rightwall)) {
d = myspeed; }
// Controls Speed
mySpeed = 2;

if (Key.isDown(Key.SPACE)) {
mySpeed = 10;
}
if (Key.isDown(Key.LEFT)) {
_x-=mySpeed-c;
}
if (Key.isDown(Key.RIGHT)) {
_x+=mySpeed-d;
}
if (Key.isDown(Key.UP)) {
_y-=mySpeed-b;
}
if (Key.isDown(Key.DOWN)) {
_y+=mySpeed-a;
}
}


I am pretty new to actionscript, but I thought this issue might be more complex than the usual Beginner area post.

Thanks for any help you can offer!

Audio On/off In Nested Clips?
I've got a shell.swf file that loads lots of pageXX.swf files into page_mc movieclip. Each pageXX.swf file calls external audio using the following convention.


Code:
music = new Sound(this);
music.onLoad = function(success:Boolean) {
if (success) {
playing = true;
}
}
music.loadSound("audio/mod2_050.mp3", true);
I tried using the following in shell.swf to turn the sound volume off, and it works great...until you go to the next page, then the audio for the new page starts playing.


Code:
if (this._parent.page_mc.music.getVolume() == 0) {
this._parent.page_mc.music.setVolume(100);
} else {
this._parent.page_mc.music.setVolume(0);
}
Is there a way I can toggle the volume on/off without having to change the code in every page?

Thanks!!

Nested Movie Clips?
OK here's the deal I have a movie clip acting as a 3 state button (3 frames: over, off, down) nested on the second frame of a movie clip.

The idea is the outer movie clip shows something, when you rollover it it goes to the second frame that has the 3 state button, which should react to the mouse rollover and click

My code is in the root time line. "mac" is the parent MC on the root time line, "mm4v" is the child movie clip on the second frame.

The first part (green) works, the second par (red) dose not.
any ideas why?

mac.onRollOver = function() {
mac.gotoAndStop("over");
};

mac.mm4v.onRollOver = function() {
trace ("good")
mac.mm4v.gotoAndStop("over");
};

Help Needed With Nested Clips
Hi,
How do I make the playhead STOP in a certain keyframe that contains a nested movie clip and WAIT till the clip has finished playing, and then JUMP to the next keyframe, which, in its turn, contains another nested clip to be played???
Thanks in advance!

Nested Clips And LocalToGlobal
Hi,

I am trying something involving scaling and changing the _x and _y positions of a movieclip. Those things are simple, but I'm trying something a bit different and have gotten stuck.

Here's the structure:
One swf. One MC called mapzoom. Nested inside mapzoom is mappan. There are north, south, east, west, scale+ and scale- buttons on the main level.

The north, south, east, and west buttons pan the mapzoom.mappan MC by changing their _x and _y. The scale buttons zoom the mapzoom MC.

I intend to have the MCs larger than the stage and pan and zoom under a smaller masked area. So I need to constrain the MCs edges to the edges of the masked area regardless of how it's been zoomed or panned. BUT...here's where I got stuck.

Using localToGlobal, I've changed the mapzoom.mappan coordinates to the global coordinates. Each time I move this MC, for example: north, I increment the _y and increase the localToGlobal object's point by the same amount to reflect the change. Before it moves, it tests to see if the object's y point is at the top edge of the masked area (y=0). This works great until I zoom, which scales the mapzoom MC, the one that holds the mapzoom.mappan MC. I am not sure how to get the object's localToGlobal y point to reflect the new Y position once it's scaled. It doesn't update on its own. Therefore, my test to see if the MC's edge has reached the masked area's edge doesn't work.

Does anyone see a structure flaw or know some way to update the object's y point after scaling the parent MC? The reason I built it with the pan clip inside the zoom clip is that it will always appear to be zooming from the middle of the masked area, no matter how far the inside clip has been panned. That's an important thing to this movie.

Here's the code:

localToGlobal code on _root.mapzoom:

Code:
onClipEvent (load) {
_root.oPanPoints = new Object();
_root.oPanPoints.x = this.mappan._x;
_root.oPanPoints.y = this.mappan._y;
// apply loc2glob to this mc
this.localToGlobal(_root.oPanPoints);
}
TO ZOOM _root.mapzoom:


Code:
incr = 5;
function zoomIn(){
if (mapzoom._xscale < maxZoom){
mapzoom._xscale += incr;
mapzoom._yscale += incr;
}
// oPanPoints.y does not change, even though the mc holding it has scaled
}
TO PAN _root.mapzoom.mappan:

Code:
incr = 5;
function panNorth(){
// keep the y from going greater than 0
// this works great until the zoom mc holding the pan mc is scaled
if (oPanPoints.y < 0){
mapzoom.mappan._y += incr;
oPanPoints.y = oPanPoints.y += incr;
}
}
I realize I didn't scale mapzoom.mappan directly, I only scaled the mapzoom MC. But wouldn't that change the _y of the inside MC (mappan)? If not, this whole idea probably will not work for me!

Many many thanks if anyone has some ideas I can try. I am trying to get this solved as soon as I can because I need to finish up a project that relies upon it. Help is very appreciated.

Thanks
Jessica

-->> If needed, I'll post the example.

Nested Movie Clips And As3
hi wondered if someone could help me as this problemo is really slowing me down an dmy head hurts:|

in this instance what i want to do is load in an image into a movieclip that I have already created (by hand if u will ) and place don the stage. The main clip i have placed on the stage is called port and this is the code i am using to load it in.

function showMainImage(event:MouseEvent):void {
var mainLdr:Loader = new Loader();
mainLdr.load(new URLRequest("images/" + event.currentTarget.imagePath));
port.addChild(mainLdr);
port.mainLdr.x = 2
port.mainLdr.y = 2
bitmap.visible = true;

}

the bit that throws up and error seems to be the two lines that try and position the clip. I get the following as an error message:

TypeError: Error #1010: A term is undefined and has no properties.
at AS3_main_fla::MainTimeline/showMainImage()

its really got me stumped this one and in this respec tlife used to be much easier with as2:) but i know the benefits are there so i will stop whining.

can anyone help me please? a crate of belgian beer is in it if u live close by;)

reagards

ade

Nested Movie Clips
hi,

I recently downloaded a flash template that was built on AS2 and have been trying to figure out how it works for a couple of weeks now (excuse my ignorance when it comes to AS). I have a question about nested Movie Clips. The way the template is constructed invovles a massive amount of nested movie clips and a large number of instances of each movie clip. The way i understand it is that if an instance of a movie clip is put on the stage and given an instance name, any modifications to that movie clip should be unique to that instance. However when i modify the colour of any of the movie clips i select, it changes the colour of all other instances.

Am i missing something obvious here??

Thanks in advance for your help

Kind Regards
Damien

Nested Movie Clips
If you have a movie clip inside a movie clip, and if you test the scene, and it's fine, but when you test the whole movie, the nested movie clip doesn't animate... what's the problem? Thanks for any help.

Sincerely,
Bry
kiddopail@hotmail.com

Please Help - Nested Movie Clips
Im working on a uni project and have his a brick wall

The project is a prototype PDA made up of a host movie (host.swf) which loads other swf's in to display on the screen.

My problem is with my menu.swf

For example i include some code

Code:
//clock section starts
createEmptyMovieClip("clock_container",1);
container._x = 225;
container._y = 100;
clock_menu_btn.onPress = function() {
loadMovie("clock.swf", "clock_container");
_root.music_container._visible=false
_root.shopping_container._visible=false
};
//clock section ends
I want the button when clicked to hide any other open movie clips.
It works fine when opened as menu.swf but if its nested in host.swf it doesn't work.

Any ideas?

Thanks

Nested Movie Clips?
I don't know the correct name for this...but I'm using the 3d tutorial here for a pattern to make a cover flow gallery with dynamic images, the final project will pull the image location from an xml file...I know my navigation is working...

but the images aren't showing up, I hope this quote is enough to get an idea...




Quote:




for (i=0; i<=4; i++){
obj = theScene.createEmptyMovieClip("obj" + i, theScene.depth++);
var box = "obj" + i;
box.loadMovie("poster" + i + ".jpg");
obj.x = i * 225;
obj.z = 0;
obj.target = new Object();
obj.target.z = obj.z;
obj.onPress = selectObject;
obj.display = displayObject;
obj.type = 0;
obj.selNumber = objn++;
objectsInScene.push(obj);
trace(box);
trace("poster" + i + ".jpg");


}

Nested Movie Clips?
Hi All...

I have been working on an animation and I do not seem to be able to move on.

I am using AS2 and Flash 8.

What I would like to accomplish is have an animation I created of a number of balls vibrating and moving around, to play within a confined area. What I mean is that on my stage I have created a frame which I changed into a movie clip. Now what I would like to do is have my animation of the various balls stay within the frame. I tried to place the animations of the balls into the frame movie clips but no success. Any suggestions on how I could solve this dilemma?

Thanks

Brutium

Preloading Into Nested Clips
hey all,
i have been struggling with this for a long time and i haven't been able to come up with a solution.

i have a main movie (homepage.html). On that main movie i have a CONTAINER MC. Into the container MC i am loading VIDEO.SWF. This swf file has a slider navigation menu in it. Within this slider navigation menu, I have another movie clip container called talkingHead. when a user clicks on a button in the slider navigation I have a swf load into this talkingLight MC. I would like to preload the swf that is loading into this talkingLight MC. But my code doesn't seem to be working.
right now I have

ActionScript Code:
bytes_loaded = Math.round(_parent.container.mask2.general.talkingLight.getBytesLoaded());bytes_total = Math.round(_parent.container.mask2.general.talkingLight.getBytesTotal());getPercent = bytes_loaded/bytes_total;_parent.container.mask2.general.talkingLight.progressBar._width = getPercent*200;_parent.container.mask2.general.talkingLight.progressText = Math.round(getPercent*100)+"%";if (bytes_loaded == bytes_total) {    _parent.container.mask2.general.talkingLight.gotoAndPlay(3);}


what i am doing wrong????? is there some conflict cause of the slider menu system, or do masks affect your ability to preload (i highly doubt this is the problem)
hope you can help

cheers
Pithcell

Nested Movie Clips
If you have a movie clip inside a movie clip, and if you test the scene, and it's fine, but when you test the whole movie, the nested movie clip doesn't animate... what's the problem? Thanks for any help.

Sincerely,
Bry
kiddopail@hotmail.com

TabIndex And Nested Clips
If I set the tabIndex for buttons on the stage they work fine. If I put them inside a movie clip they do not. Anyone know about this?

Help W/ Nested Clips In Nav Menu
hi - I'm working on my first full flash site. I'm attempting to build the navigation which has 4 buttons. 3 of the buttons have sub menus that drop down when rolled over. (all of the "buttons" are mc's & not button symbols).

the Navigation menu mc is structured as follows:

menu
>sub1 > sbutton1
>sub2
>sub3

(eventually there will be buttons on all of the sub menus, but i'm just trying to get one to work for now).

in the main timeline i'm attempting to get an onRelease function to work like this:


Code:


menu.sub1.sbutton1.onRelease = function() {
trace("sbutton1 was pressed");
}



if i target the "sub1" mc the onRelease function works fine. but for the mc nested inside of "sub1" called "sbutton1" the function doesn't work. I've tried putting everything in the "sub1" mc on a single & on separate layers.... tried using a button symbol instead of a mc... also tried putting the onRelease function inside of the menu mc's timeline... nothing seems to work.

any ideas why? Could this be a depth issue?

I've attached a zip of the FLA file. Also if you spot anything else that could be done more efficiently then by all means lemme know.

thanks

Nested Movie Clips Coordinates
I have MC1 and MC2
MC2 is place inside MC1
I am having problems getting _root.mc1.mc2._x to respond correctly to the coordinate system for the main movie.
I'm not sure of the correlation.

Buttons Nested In Movie Clips
Hello, I need some help for a friend... We want to make buttons nested in a movieclip go to and play another frame/movieclip in on the main timeline. Do you target the instance on the main timeline? That is what i've been doing, it is not working.

I think the problem may be that she came to me last minute and i had only half hour to find the problem...

Any help would be great!

Nested Movie Clips/Buttons
This is hard to explain, but here goes...


On the main timeline, I have a movie clip. lets call

it "main". Inside that movie clip is another movie clip

let's call that one "clip2". Inside that movie clip

is a scroller movie clip. There is a button inside the scroller

that when you press it, I want to be able to call "clip 2"

and just have the playhead go to the next frame on "clip2"

I've attached a fla as an example (flash 5). I hope someone understands this and can help me.

Nested Dynamic Movie Clips
I'm loading movie clips dynamically into a movie.

What I would like to do is load sub-clips into previously loaded movie clips within my movie (ie: attach additional graphics to a graphic I loaded before). The reason I want sub-clips is that I'd like the sub-clips to update automatically as the original movie clip is updated, while maintaining their original offset.

This seems like it would be possible, and in fact, I can get it working with non-dynamic mcs.

Are there restrictions with dynamic clips that I am not aware of or is there another error in my code?

Thanks for your input,

sand858

Creating Nested Clips With CreateEmptyMovieClip
I'm trying to create one empty movie clip inside of another one, but it doesn't seem to be working. Here is the basic code:



for (i=0; i < 100; i++)
{


var ext = ["shell"+i];
var mct = ["interior"+i];

//create one blank clip inside of another one
_root.createEmptyMovieClip(ext, i+115);
_root.ext.createEmptyMovieClip(mct, i+15);

}

Nested Mov Clips And Main Timeline
Hi all,
I have 3 nested movie clips within the maintimeline. I am wondering what the code is that i use to return from one of the movie clips ti the maintimeline? I''ve tried at the end of my nested movieclip:

gotoandplay(_root.nameofframe);

but it doesn't work.

Thanx

[F8] Targeting Nested Clips In AttachMovie
Hello...

So I need some help. I have a photo gallery menu. It has 4 options. Each option contains a different amount of photos. I have a dynamic text box that shows the number of photos for that menu option and buttons that are SUPPOSED to advance the photos. I've grouped all these (the text field and buttons) into one movie clip. I want that movie clip to attach itself to each menu option upon the menu option being clicked. It attaches fine. The number of photos for the menu display correctly but the buttons (which are really movieclips with a _btn extension) don't work! I could really use a fresh pair of eyes. I am inserting what I have for this.

I've labled the linkage of the movieclip properly, as "navi." Everything is spelled right, I just don't get it. ...and like i said the dynamic text field is showing properly, so not sure why the same target isn't working for the buttons. Thanks in advance.


pos_txt = the dynamic text field

next_btn = the movieclip thats supposed to advance the gallery

previous_btn = the mc thats supposed to go backward in the gallery





init = function(){
digi_mc.moveY(102, 3);
installation_mc.moveY(129, 3);
photography_mc.moveY(156.3, 3);
photography_mc.attachMovie("navi", "nav_mc", 1);
}

init();


//////////////////////////this part works fine - pos_txt is being found////////

function picture_num() {
current_pos = p+1;
photography_mc.nav_mc.pos_txt.text = current_pos+" / "+total;
}





/////////this isn't working even though it's in the same place as pos_txt//////
photography_mc.nav_mc.previous_btn.onRelease = function() {
prevImage();
}
photography_mc.nav_mc.next_btn.onRelease = function() {
nextImage();
}
///////////////////////////////////////////////////////////////////////////////////



function nextImage() {
if (p<(total-1)) {
p++;
photo_mc.loadPhoto(image[p]);
desc_txt.text = description[p];
picture_num();
}
}
function prevImage() {
if (p>0) {
p--;
photo_mc.loadPhoto(image[p]);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
photo_mc.loadPhoto(image[0]);
desc_txt.text = description[p];
picture_num();
}

[f8] Point Hit Test On Nested Clips
hopefully this is a quick one,

I'm having problems performing a point hittest, in the statement:

target.hitTest(x, y, true);

if the target is a clip within a clip, do x and y have to be relevent to the parent of target?

I've tried calculating coordinates relative to various things but none seem to work correctly


thanks

Collisions From Nested Movie Clips
Dear all flash lovers,
I am in need of some help if possibel.
I have been playing with flash 8 and in the process of making a simple game.
but I have come across a problem with collisions that no one seems to have answered. well I have been looking all day and found nothing. I need 9 squares that move independently of each other, randomly. because of this |I have had to inbed all the variables into 1 movie clip. so that all i need is to copy that 1 movie clip 9 times without changing any code... so far so good, till I started setting up the collisions with the boundries and the other replicated squares.

Question:
I have a square(MC) that i need to detect when it collides with the boundries which are in the _root. The square is nested (inside a movie clip). and that movie clip is inside another. here is the simple code i am using to do this.


if (_root.b1.hitTest ( this._x, this._y, true) == true )
{
_parent.variables.COL1 = 1;

}
if (_root.b2.hitTest ( this._x, this._y, true) == true )
{
_parent.variables.COL1 = 2;
}
if (_root.b3.hitTest ( this._x, this._y, true) == true )
{
_parent.variables.COL1 = 3;
}
if (_root.b4.hitTest ( this._x, this._y, true) == true )
{
_parent.variables.COL1 = 4;
}

trace(_parent.variables.COL1);

but for some reason it will not play ball.
any help would be great as my mind is fried

kind regards
taz

[CS4] Live Preview Of Nested Clips?
Hello,

I was watching a demo video of Tweening in cs4 on the adobe site and i noticed that it looked like there was a live preview of a nested clip. There was a clip of a ball bouncing inside of a clip that made it move left to right. when the animation for the clip on the root level was scrubbed, the animation of the clip inside it played. Is this a new feature? I can't find it documented anywhere and have yet to find it in Flash myself.

Thanks
Cameron

Scrollbars Nested In Movie Clips[CS4] And AS3
I have developed a simple website for a college handup.
It has a main window and another window beside it, in which I have created a movie clip.
I want to use this movie clip as a window for a scrollbar.
I have nested my scroll bar within this window and it will not scroll.
I also keep getting this error:
TypeError: Error #1006: init is not a function.
at CiaraMADMT_fla::scrollwindow_6/frame1()

The scroll bar consists of one line of code:
sb.init(txt_mc, "easeOutBack",2,true,2);

I tried having the scrollbar on the main stage and not nested but it kept throwing out my other code completely.
I am starting to think that flash and AS3 secretly HATE me!

If anyone can help I would give them my firstborn

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