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




How To Stop Mc In Attached Mc



In my presentation I attach a movie thus:

ActionScript Code:
// attach history section _root.attachMovie("old_Film", "film", 150);

"film" has a soundObj called VSound and a movieClip animation playing in it with instance name "effects_mc"

On the main time line I have a pause / play button in a movie clip. I can successfully target the audio in the movieClip "film" and stop it from playing. however, I can't seem to target a movieClip inside the attached movie and stop it using the movieClip.stop() command.


ActionScript Code:
on (release) {    myMusicPosition = _root.film.VSound.position/1000;    _root.film.VSound.stop();    _root.film.effects_mc.stop();   }

Is this the wrong syntax? How do you stop the mc playing inside the attached mc?



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 01-30-2006, 02:30 PM


View Complete Forum Thread with Replies

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

I Need Some Expert Help To Stop The Attached Slideshow On Certain Mouse Position
Hi,

I have attached an example of a slideshow that I'm using to import in .swf's and I would like some help adapting it.

Firstly I would like to know how to stop the slideshow when the mouse enters certain co-ordinates, (x between 0 + 700 & y between 0 + 480). I want the current image to remain static and to display some information.
To stop the movie I'd prefer not to use a button but in someway to have it related to the mouse co-ordinates, as the information will be displayed by a button rollover inside the .swf's.

Secondly, do any of you know how I could randomise the importation of the .swf's.

Finally, instead of imbedding the information inside the .swf's, would it be possible to import text from an XML file into the slideshow movie so that if you stopped on image048.swf it would know to display the text, 'this image was used in, etc...'.

I would be very grateful if anyone could help me on these as I've spent lots of days trying to figure it out by myself with no success.

Thankyou,

Lenny.

// I got the original slideshow script from here //
http://www.actionscript-toolbox.com/..._slideshow.php

Remove/stop An Attached Movie Clip From Duplicating
I’ve seen a bunch of code out there using attach movie clip to make effects like rain and snow. There problem is that every time I place it on a scene the actions continues through all the scenes and the whole document. I tried a few things to stop the action, removeMovieClip / ulooadMovie with no luck. Anyone know the solution?

I believe these two examples use the same script:

Snow Effect 1

Snow Effect 2

Thanks in advanced….

Action Works Attached To A Button But Not When Attached To A Frame
can anyone tell me why the following button script works:

on (release) {
_root.welder.eyes.gotoAndPlay(2);
_root.welder.gotoAndPlay(2);
}

but this virtually identical script won't work in a frame (on the same timeline as the button):

_root.welder.eyes.gotoAndPlay(2);
_root.welder.gotoAndPlay(2);

i've been pulling my hair out all day over this. i can't think of an explanation as to why the second example wouldn't work. its baffling to me.

Attached Sound To An Attached Container
I am trying to have sound play when the user rolls over an image with this code below:


Code:
container._visible = 0;
thumbsnr = 4;
for (var i = 1; i<=thumbsnr; i++) {
mc = this["mc_"+i];
mc.onRelease = function() {
container._visible =1;
container.attachMovie(this._name, clip, 1);
};
}
the script i am using for the sound is this:


Code:
s = new Sound();
s.attachSound("sound_1");
s.start();
i have done the linkage but it still doesn't seem to be working.

Working With Dynamically Attached Movies Inside Dynamically Attached Movies
I'm trying to work with a movie I dynamically attached inside of another movie, what is wrong with this code for setting the _x and _y of the inner most movie, and how do i fix it?


Code:

this[iButton].attachMovie("More","M"+iButton,1000+iButton);
this[iButton].["M"+iButton]._x = 10;
this[iButton].["M"+iButton]._y = 10;

Stop Actionscript Function At A Specific Frame (stop Looping)
I want to stop an effect at a specific frame but I dunno how.
Do I have to put something in the code?
I'm confused.
Or just tell me how to stop it from looping.
Edit:
Is it possible to attach this to a movie clip? Then i can stop it or use onEnterFrame and then escape();
I actually have no idea what I am talking about. /Edit

Here is one of the code I borrowed:

MovieClip.prototype.placeInSpace = function(id) {
var ratio = this.focaldistance / Math.sqrt(this[id].z * this[id].z);
this[id]._x = this[id].x * ratio;
this[id]._y = this[id].y * ratio;
this[id]._xscale = this[id]._yscale = 1000 / this[id].z;
}
MovieClip.prototype.randomPlace = function(id) {
var radius = this.rmin + (this.rmax - this.rmin) * Math.random();
var polar = 2 * Math.PI * Math.random();
this[id].x = radius * Math.cos(polar);
this[id].y = radius * Math.sin(polar);
this[id].z = this.zmin + (this.zmax - this.zmin) * Math.random();
}

Here's the other code cause I can use two in my movie:
function mover() {
// Move the particle over time
this._y += this.speed;
this._yscale += 10;
this.speed++;
if (this._y>500) {
this._y = 0;
this.speed = Math.random()*10;
this._yscale = 100;
}
}
function starField(x, y, n) {
// Generate a starfield of specified dimensions with n stars
for (var i = 0; i<n; i++) {
var star = this.createEmptyMovieClip("star"+i, i);
var dot = star.createEmptyMovieClip("dot", 0);
star._rotation = Math.random()*360;
star._x = x;
star._y = y;
dot.lineStyle(0, 0xFFFFFF, 100);
dot.moveTo(0, 10);
dot.lineTo(0, 15);
dot.onEnterFrame = mover;
dot.speed = Math.random()*10;
}
}
starField(275, 200, 100);

[F8] Movie Plays > Stop > Reverse > Stop > Play
I am fairly new to involved action scripting. I have successfully scoured flashkit threads for years to get my answers but this one has been driving me crazy for the past couple days. I have tried numerous solutions but none of them do exactly what I am trying to do.

I am creating an online portfolio that I want to control with two buttons that will play forward on release and stop at every piece unless the user is pressing and holding down - I also would like the scrolling animation to play in reverse on press and stop at every piece unless press and hold which happens to be skateboards in this section. I am posting the .fla for this section. This is what I have been able to accomplish so far. I moved everything into the main timeline from a movie clip because I could not get that to work at all. Should I move it back to movie clip? I also want it to stop at the first board.

here is the code I was able to peice together that just plays continously without stops.

Empty movie clip on second frame.

PHP Code:




onClipEvent (enterFrame)
{
    if (_root.goBack)
    {
        _root.prevFrame();
    }
    else
    {
        _root.nextFrame();
    }
    _root.frameNo = "Frame : " + _root._currentFrame;
}







Forward button.

PHP Code:




on (press)
{
    _root.goBack = false;
}







Reverse Button.

PHP Code:




on (press)
{
    _root.goBack = true;
}







I have only done basic stops; goToAndPLay, getURL and such I am a little out of my league here but I started the ball rolling and would like to make this work as I intended. Any help making this do anything close to what I am describing would be much appreciated

How To Make The Wings Of A Fly Stop When The Flash Movie Stop?
Hello,

I made a simple "Fly Flying" flash animation. The wings of the fly are moving up and down while the fly is flying from one location to the other. My problem is:

The wings of the fly are still moving up and down when the fly is landed on the ground. I tried to add a stop(); action script at the last frame. However the wings are still moving even the movie is stopped.

How can I make the wings stop moving when the flash movie is stop? Please download and take a look at my flash file (fly_flying.fla):

http://space.uwants.com/batch.download.php?aid=313219

Thanks and best regards

Alex

How Can I Stop Flash From Looping And Stop On The Last Frame
I am having a problem with looping. I created a flash file and published it. I only want it to play through once and stop on the last frame. I can't get it to stop, it keeps looping through and playing the movie.

I have tried to add a layer that has some script in it with a start and a last tag on frame 1 and frame 310 there is 315 frames total.

the action script was
<code>
// this was in the first frame
ifFrameLoaded ("last") {
gotoAndPlay("start");
}

//this was in the second frame
gotoAndPlay(1);

//this was in the last frame 315
stop ();
</code>

your help is greatly appreciated.

skj

Cannot Stop Movie Clip - This.stop() Confusion
Hello,

In my pong game when someone scores a goal I want the ball to pause in the middle of the screen, wait xx seconds and then randomly move.


Code:
// Return to kick off position
this.stop();
this._y = 325;
this._x = 275;
a = 0;
var myInterval = setInterval(this, "wait", 30*1000);
This calls function wait that simply uses this.play(); to allow the ball to move again.(See below)


Code:
onClipEvent (load) {
this.wait = function() {
this.play();
clearInterval(myInterval);
};
}
However I cant EVER get the ball symbol to stop no matter what I do.

Ive included all the code attached to the clipevent for the ball below.
Im thinking it must be due to the nested loops or somethings, very very confused


Code:
onClipEvent (load) {
this.wait = function() {
this.play();
clearInterval(myInterval);
};
}
onClipEvent (enterFrame) {
//Kick Off, play whistle and select random direction from 4 diagonals
if (a == 0) {
_root.kickoffwhistle.start();
//Use variable to ensure random numbers are generated only once per game
var randNumber1:Number = Math.pow(-1, Math.floor(Math.random()*2));
//-1 ^1 or ^2 = 1 or -1
var randNumber2:Number = Math.pow(-1, Math.floor(Math.random()*2));
//move it on the y axis at -1 or 1 & //move it on the x axis at -1 or 1
this._y += this.randNumber1;
this._x += this.randNumber2;
++a;
//set a trigger to increment so only actioned once.
}
if (randNumber1>0) {
this._y += this.yspeed;
//move it on the y axis at the set speed
} else {
this._y -= this.yspeed;
//move it on the y axis at the set speed
}
if (randNumber2>0) {
this._x += this.xspeed;
//move it on the x axis at the set speed
} else {
this._x -= this.xspeed;
//move it on the x axis at the set speed
}
// Ball(this) collides with PL1 and ball travelling upwards then deflect off randomly {
if (this.hitTest(_root.P1footballman) && this.yspeed<0) {
// Define boundaries for collision detection
var pl1bounds:Object = _root.P1footballman.getpl1bounds(_root);
this._x = Math.round(Math.random()*(pl1bounds.xMax-pl1bounds.xMin))+pl1bounds.xMin;
//Revert direction of ball by using formula below
this.yspeed = this.yspeed*-1;
//Randomly play miss sound effect if ball in goal area
if (this._x>133 && this._x<450) {
var result = Math.round(Math.random()*2);
if (result == 0) {
_root.MissedGoal.start();
}
}
//play football kick & header sound
_root.footballkickorheader.start();
}
if (this.hitTest(_root.cpu) && this.yspeed>0) {
var cpubounds:Object = _root.P1footballman.getcpubounds(_root);
this._x = Math.round(Math.random()*(cpubounds.xMax-pl1bounds.xMin))+cpubounds.xMin;
this.yspeed = this.yspeed*-1;
if (this._x>133 && this._x<450) {
var result = Math.round(Math.random()*2);
if (result == 0) {
_root.MissedGoal.start();
}
}
//play football kick & header sound
_root.footballkickorheader.start();
}
//Roatation properties of the ball
i = getProperty(this, _rotation);
setProperty(this, _rotation, i+5);
//Rotate ball i degees per frame
_this.rotation = i;
//Player Scores routine
//If ball object is beyond defined CPU goal area
if (this._y<75 && this._x>133 && this._x<450) {
_root.goalcry.start();
_root.P1footballman.score++;
//add1 to the cpu score
_root.playertxt = 'PLY: '+_root.P1footballman.score;
//Play start whistle for KICKOFF
_root.kickoffwhistle.start();
//Return to kick off position
this._y = 315;
this._x = 275;
a = 0;
//Stop ball in correct position
this.stop();
//5 seconds then calls function "wait" to use this.play() to move ball
var myInterval = setInterval(this, "wait", 5*1000);
}
//CPU Scores routine
//If ball object is beyond defined Player goal area
if (this._y>470 && this._x>133 && this._x<450) {
_root.goalcry.start();
_root.cpu.score++;
//add1 to the cpu score
_root.cputxt = 'CPU: '+_root.cpu.score;
//Play start whistle for KICKOFF
_root.kickoffwhistle.start();
// Return to kick off position
this.stop();
this._y = 325;
this._x = 275;
a = 0;
var myInterval = setInterval(this, "wait", 30*1000);
}
if (this._x>620 || this._x<5) {
this.xspeed = this.xspeed*-1;
//if it hits an edge inverse the xspeed
_root.bounce.start();
//Play bounce side effect
}
if (this._y>470 || this._y<75) {
this.yspeed = this.yspeed*-1;
//if it hits the top or bottom of pitch inverse the yspeed
_root.bounce.start();
//Play bounce side effect
}
}

How To Stop MC At Same Time As Sound Stop?
Hi and thanx for u trieing to help me.
I have used this code to play a sound from the library.

with (song_link) {
sound1 = new Sound(song_link);
sound1.attachSound("inga");
sound1.setVolume(100);
sound1.start(0, 0);
}

and when the sound stops i would like to stop a MC that loops.

if there is any way to have an if command in the MC that waits for a variable to be sended and then stops.

or to set some kind of countdown when u start to play the sound that tells the MC to stop.

i would be very glad if u could help me!

Stop Movie - Don't Stop Sound
Hello,
I'm making a intro for somebody's site. The intro plays a loop. At the last frame I made a stop script. But I want to the muis (a loop) to play on and on. So the music won't stop when the movie stops.
Can somebody help me?
Tnx & greetz, Big_Boss_Man

Stop Sounds When Stop Film
Hi. When I open my flash movie in the Flash Player (I have MX) and play it, it works fine. But if I make a breake (stop the playback), the film stops, but the sound still goes on. I have seen animations where sounds and the movie stop if I stop the film. How can I do it. Thx, leu

If I Stop The Sound I Want To Play It From Where Is Stop :)
hi all

i want a button if i cilck on it the sound will stop and another button if i click on it the sound will continue from where it is stoped is it possible in flash or not

and the sound where is the best place i place it ( movie clip - main frame - action ????


thanks

if any one can give me an open file to be clear or the code

How Can I Stop THIS Movie? This.stop() Does No Work?
I try to stop a small movieclip writing

onclipEvent(Enterframe){

if(_root.myvar==1){
this.stop();
//this._visible=false
}

}


It becomes invisible if I use the second line. But it does not stop if I use the first line.

What's the problem??

Thanks

Strange Bug....won't Stop At Stop Action
My movie isn't stopping when there is a stop action. I don't know if its a bug in my site or if its a bug with flash MX. Here is the file home.fla. The error occurs when you click on one of the buttons under the Profile heading. If you look at the Profile Scene you'll see I have stop actions placed at the end of each labeled section. For some reason the philosophy section keeps repeating itself and won't stop even though there is a stop action. Can some please take a look and let me know what I can to fix this. Thanks!!

Movie Won't Stop On Stop Command ?
Hello again. I have a movieclip following a motion guide. At the end of the guide, a window comes up with some text. On this frame, on it's own seperate layer, I have a stop command. What is suppossed to happen is after reading the text, you click on the window, it dissappears, and the movieclip follows another motion guide. For some reason though, when I output the FLA, it blows right past the stop command. I have tried making the stop command multiple frames, and I have double checked that there is no other command overriding the stop on that frame. I have no clue. Any ideas? Thanks,

(I would post the file, but it's so large it's killing my G5)

Movieclip Won't Stop On Stop Command?
Inside a movieclip (track) I have a ball on a motion path. At the end of the first motion path, a box comes up and the movie is suppossed to stop on it. For some reason, it keeps going right on to the next motion path. The stop is on it's own layer, and the weird thing is, there are two other stop commands on the same layer, at the beginning and the end of the movie, which both work. I have tried everything I know. Please help. Thanks,

-A

_root.stop Doesnt Really Stop
Hey guys,

I have a pretty complex game im working on..and when you win the game, it sends you to the 4th frame on the root timeline.

This shows the win message and such...however, it keeps automatically sending them from the 4th back to the 3rd frame. I have been searching thru the flash for hours to find something that is doing this, but there is nothing!

Is there a way to like override all other things and have a FULL stop?

I cleared the intervals (but none of them have anything to do with changing frames) but nothing works.

Any help would be amazing. Sorry I can't post the example, as its a HUGE complex flash file.

I pretty much am looking for something similar to _root.stop that actually stops EVERYTHING.

Thanks!

Goto And Stop Doesnt Stop?
hi there..
i have stupid problem again..
thats very basic and i dont knwo what the hell is wrong and its driving me crazy!
ok here it is.. im using

on (release) {
gotoAndStop("main");
}

it goes back to main labeled frame stops around 3 sec.. then plays the whole movie.. again! and again!
i changed it to frame number like

on (release) {
gotoAndStop(45);
}

still same! even there is a stop(); action on frame 45(main)
what is that?!
what am i doing wrong?

thanks..

Stop Scene Loop Without Stop();
I have an interactive flash application that I'm building, but it's gotten kinda large (~200k) because of one large png file. So, I want to build a preloader for it, but I seem to have some difficulty getting it to a) stop looping back to scene 1, or b) look good if I use stop();

for some reason, the folowing scene's moving elements look crappy if I use stop(); in it's first frame in order to stop it from going back.

I don't want scene 1 to continuously reappear, but stop messes with the moving elements in scene 2.

Any novel suggestions? Thanks in advance for even reading this.

Goto And Stop Doesnt Stop?
hi there..
i have stupid problem again..
thats very basic and i dont knwo what the hell is wrong and its driving me crazy!
ok here it is.. im using

on (release) {
gotoAndStop("main");
}

it goes back to main labeled frame stops around 3 sec.. then plays the whole movie.. again! and again!
i changed it to frame number like

on (release) {
gotoAndStop(45);
}

still same! even there is a stop(); action on frame 45(main)
what is that?!
what am i doing wrong?

thanks..

This._Y Of An Attached MC, Just Can't Get It Right. Help Please
Hi,

I am quite new to Flash, although I know a bit of Lingo.
I have a major problem with my maths ), but still I am not going to give it up.
My problem is that I try to attach 2 different clips into a smart clip.And I want the drag bar to sit on top of the content window.

this is my script(in the frame 1 of the smart clip):

this.attachMovie("dragbar","drag",1);
this.attachMovie("content","window",2);
//posX,posY are variables sent from smart clip parameters
window._X=posX;
window._Y=posY;
drag._X=posX;
drag._Y=posY-window._height/2; (I assume that the X and Y coordinates are the center of the MC. this is where I get confused. Maybe is all wrong).

Any help would be much appreciated. If you can just explain to me this _X and _Y business cause I just don't get it from the book. Sorry. I know is a bit stupid.

Making A Stop Button, Or Telling A Button To Stop A Streaming Video
Hello,

I've searched the forums and tried to find an answer to this question, but most of the posts go unanswered or are way beyond my understanding.

I'm using a form based application in Flash professional 8.

I have a .flv video of a movie trailer that I created from Quicktime. I intend to stream this video.

I also have a button called "Trailer". When I click on the "Trailer" button, I see the .flv video I created along with the play/pause control skin that I added in the import video wizard. I press the play/pause button, and the movie plays.

This is as I had expected it to be.

Now, when I want to go to something different, for example clicking a "Photos" button that displays a slideshow, the video continues to play.

Is there a way I can tell the "Photos" button to stop the streaming video?

I've searched the forums, and found a few answers, but I don't really understand them. I added them to the script of the "Photos" button anyways to see if they did anything, and every time the video still kept playing.

Here's what I've tried so far:
------------------------------------------
button.onPress = function (){
player_mc.clearVideo();
}

Where player_mc is the instance name.
-------------------------------------------
Adding a stop component, but this isn't really what I want. I'd like the "Photos" button to stop the movie without the user having to hit a separate stop button.
-------------------------------------------
.stop() and ._visible=false;

I don't really understand this.
-------------------------------------------
removeMovieClip("component_mc");
-------------------------------------------
instance.stop()

From what I understand this is only for adding to a keyframe to stop a movie that's looping, and not for what I would like to do. Is that correct?
-------------------------------------------

I would greatly appreciate any help, not only just for me, but for any other newbie who may run into this problem.

Thanks!

Targeting Attached MCs, Please Help
hi

i have a move where i attach a movieclip multiple times, using this code:

on (release) {
// add this object to the list of chosen objects
_root.items.push("green");
name = items[j]+j;
_root.attachMovie(items[j], name, j+1);
_root[name]._x = (j+1)*50;
_root[name]._y = (j+1)*50;
_root[name+"x"] = _root[name]._x;
_root[name+"y"] = _root[name]._y;
_root[name+"rotation"] = _root[name]._rotation;
_root[name+"height"] = _root[name]._height;
_root[name+"width"] = _root[name]._width;
j++;
}

can anyone tell me how i can target the new clips on the stage without changing this code? i am having a hard time finding out the PATH to the attached clips. thanks!

justin

Attached Mcs Hog Load
hi

if you use attached internal mcs they completely hog the loading process loading before everything in the first frame and stopping any preloader even appearing until theyve loaded..

anyone come across this or found a solution

cheers

neil

Help With Attached Moives
I not to sure just how to explain the problem I am having
I am attaching a moive clip "window" and the script loops and
passes some verable from an array in to each window. the moive clip then attach more MC's to make up the buttons of the nav in each but I am have trouble given the button functionality.
help I can't work out what to do
here is a link to the fla
http://www.mac-10.net/new.fla
my coding is a bit poor.
I am very sorry if this doesn't make sense
if it doesn't take a look at the fla.


mac-10

Attached Sound
I'm trying to load a movie that contains an attached sound (so that I can adjust the volume and such). It seems that, when downloading the movie, it loads the attached sound first, then the preloading scene, then the main scene. Consequently, I see nothing as the sound is downloading, then the preloader zips by while it loads the little bit that's left of the main scene.

What can I do? Is there another way of controling volume besides attaching? Or, is there a way to changing the order of downloading? Or, is there a way of measuring the "bytesLoaded" of a linked asset?

Thanks-Regards,
Splatzz

OnRelease With Attached MCs
I am trying to put onRelease actions onto multiple attached MC's. I give each
attached clip the variable name imageItem. Farther down I call imageItem.onRelease. This only works for the last attached clip? I have done this before and it worked on all the clips. I am deperate, can anyone help??

This function is called multiple times from another function. I can add all the code if needed.

Thanks

(sorry, code tags don't seem to work?)


function populateImages() {
// number of items
if (imageCounter<imageLen && imageCounter<maxImages) {
// attach image container
imageItem = _root.attachMovie("image", "image"+imageCounter, imageCounter);
imageItem._alpha = 0;
imageItem._x = 10+Math.floor(imageCounter%5)*65;
imageItem._y = 10+Math.floor(imageCounter/5)*65;
image = navXML.firstChild.childNodes[XMLcounter].attributes.id;
// load image
_root["image"+imageCounter].loadMovie(image);
// attach loading bar
preloadbar = _root.attachMovie("loadbar", "loadbar"+imageCounter, imageCounter+1);
preloadbar._x = 10+Math.floor(imageCounter%5)*65;
preloadbar._y = 10+Math.floor(imageCounter/5)*65;
// loop loader()
this.onEnterFrame = loader;
} else {
butts();
}
// HERE'S THE PROBLEM!!!!!
imageItem.onRollOver = function() {
//imageSelected = this;
trace(this);
};
}

Preloader And Attached Mcs
Can anyone help me with this problem.

I have a movie that has 200 mcs that get imported at different
stages of the movie.

I would like to put a small animated preloader in the previous
scene that plays untill all of the movie has downloaded, (700k).

The problem is that when I test the movie it just loads the
whole movie before showing the animation.

Any ideas on how I could do it?

This is the code that I use, (the movie loops to this);

loadPercent = (Math.floor(_root.getBytesLoaded()/_root.getBytesTotal()*100)+"%");
loadBytes = (Math.round((_root.getBytesLoaded()/1024)*1000)/1000+" Kb de "+Math.round((_root.getBytesTotal()/1024)*1000)/1000+" Kb");
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
// Check for finished loading
loadPercent = "100%";
// If loaded, final update to fields
loadBytes = (Math.round((_root.getBytesLoaded()/1024)*1000)/1000+" Kb de "+Math.round((_root.getBytesTotal()/1024)*1000)/1000+" Kb");
// Where to go once your movie is loaded
gotoAndPlay("go");
}

Attached Fla For Some Clues
hi,
i have been trying to add an on handler to a button(in attached fla) that has some onClipEvent actions attached to it. however whenever i do, the current actions stop working. i want to have the button activate a load movie action or gotoAndPlay action or any other action that would open another movie/MC.

any help will be much appreciated.
thank you in anticipation
janice

The Id's Of Attached Movies
if u have a for loop attaching movies to say, _root, it would look like this:

for(i=0; i<something; i++){
_root.attachMovie("movie", "movie"+i, i)
}

however, if u have a nested loop looking like this:
for(i=0; i<something; i++){
for(j=0; j<something2; j++){
_root.attachMovie("movie", "movie"+i+j, i*j)
}
}

with the first loop, i is a unique number each time, so each mc attached has a unique id. however, in the second example, if something and something2 are the same array, or at least are arrays with the same length, i dont see how to create unique id's, since there will always be matching pairs of i and j, such as 2-1, and 1-2 and so on. my solution has been to use really large random numbers, but somtimes there are two conflicting mcs that delete each other. how could i generate a unique random number every time, or a unique id somehow? thank you, i await your replies

Duplicating Attached MC
Can i duplicate Attached MC??
I have this code but it doesn't seem to work

this.DMC2.attachMovie("kartaMC","kartaMC",1);

for(i=1;i<=30;i++)
{
duplicateMovieClip(this.DMC2,"kartaMC"+i,i);
}

or this

duplicateMovieClip(this.DMC2.kartaMC,"kartaMC"+i,i );

MC's don't appear. should i attach MCs for each Duplicated MC?

GetProperty Of Attached Jpg?
If I do createEmptyMovieClip and then attach a jpeg via loadMovie, is it possible to get the height and width?

Help...movie Attached
www.customfangrills.co.uk/webFlash2.swf

please ignor all design issues as this is a demo. just set up for technical reasons.

1.click on the buttons for each section in order from left to right, see how each new section (colour) sits on top.

2.now when you goto each section randomly the bg colour reverts back to the previous section. this is because all the animaiton is in one tmieline.

how can i create my desired effect .(1) each section coming in on top when navigation randomly.

load movie clip maybe??

please help me im stumped.

maybe sombody could do me a simple fla version of 3 colours for me to edit.

thanks.

Attached MC Disappears?
I have a movieClip which animate with a couple of Tweens

Each keyframe has the same variable name

I have place another movieClip, through attachMovielip(), into the animated movieClip.

The problem is that halfway through the animation the attached movieClip disappears. It is almost as if the variable name has changed or it is another MC in the animation. The link gets broken and I can find out why. I've checked the variables and it is definitly the same MC in tweened animation.

Any ideas?

Cheers

Help: Tooltip In A MC (.fla Attached)
The tooltip works when is in the _root... but it doesnt when i insert it in a MC... i have some problems with actionscript... so if any can help me...

Put Onclipevent On Attached Mc
hi!
it´s possible to insert an onclipevent on attached mc?
i´m attaching a mc from library to de main movie, and i want to call a onclipevent that run by that attached movie.... could i?
thanx

Why This 10k Fla(attached) Drop A 6M Swf?
in my flash7 , winxp , and how to handle this wired thing..thx..

Question.. Fla Attached......
I have the attached.. i need to know how to fix the following error. Whenever you point your mouse over the bottom left of the screen a text box pops up.... that text box should only pop up, however, when i point my mouse over the green guy standing above the center. I made it pop up, changing the character to a button, then creating a keyframe by double clicking it on the edit screen, then going to "over", and pasting the textbox there. however, as said before, it appears where it would normally show up by pointing my mouse to where it would be.

Swf Buffer...with Mp3 Attached
hey guys...well i posted here a bit ago a question on making an mp3 player. i got that all figured out and it works beautifully i might add...now...here's what i want. i have the mp3 player programed that when you press play it does loadMovieNum and then it simple loads an swf from another server online and attached to that swf file is the mp3. now...what i want is a way to BUFFER the song i'm playing. example, the files that contain the songs are, on average, about a megabyte...so for a 56k user you can imagine that'd take a bit and they currently have no idea how much longer they have to wait. what i want is a bar that will appear and start on the left side of the mp3 player and extend to the far right side meaning it's 100% done. about half way i want the song to start playing even though it's not completely loaded yet. is this possible streaming an swf instead of an actualy mp3, or would i have to chagen the foratm of my mp3 player? thanks for da help!

Help With Attached File
I am trying to create a swatch selector for a paint shop, and have a problem with my flash file (attached). I am trying to make it so that when one of the small color swatches are clicked, a larger version of the same swatch appears in the white space on the right of the layout. I have already converted the first small swatch to a button as I assumed that was needed for this. Is it also possible to select an image (say a crackle jpeg or something) and when that swaych/style is clicked that it shows on a layer OVER the basic color swatch on the right? Also, how do I make a reset button?

If someone could tell me or show me how to code this that would be awesome. I attached the file in Flash 7 format. Any help would be awesome.

The Big Q , Files Attached...
ok,,, movie "Testing" is loading "dc_sub"

why cant I see the type in the comboBox list when loaded.

HOWEVER,, u can see it when just looking at dc_sub because i embeded the fonts.... so is it a bug?

anyone know the answer?

feel free to use the coding if u need to know how to use combobox with xml

HELP I Can't Unload These Attached Mc's
howdy ~ trying to remove an attached mc once it plays for about 40 frames and just can't seem to do it! the mc's are loaded through linkage.

the code for load/initiation:


Code:
kNbrJumpers = 10;
kMinSpeed = 5;// minimum rise speed
kMaxSpeed = 30;// maximum rise speed
kMinSway = .0008; // minimum sway
kMaxSway = .0001; // maximum sway
kSwayAmplitude = 20;
scale = (random(50) + 70); //scale
kScale = 2;

SW = Stage.width;
SH = Stage.height;

moveJumper = function()
{
var a = this.phase + getTimer()*this.sway;
var sway = Math.sin(a);
this._x += sway;
this._rotation = sway*kSwayAmplitude;
this._y -= this.speed;
if (this._y < -this._height) {
this._y = SH+this._height;
this._x = SW+this._width;
}
}

for (i = 1; i <= kNbrJumper; ++i)
{
var mc = _root.attachMovie('jumpinggirl', 'jumpinggirl_' + i, i,
{_x:random(SW), _y:random(SH)});
mc._x = random(SW);
mc._y = random(SH);
mc._xscale = scale;
mc._yscale = scale;
mc.onEnterFrame = moveJumper;
mc._alpha = 20 + random(60);
mc.phase = Math.random()*2*Math.PI;
mc.speed = kMinSpeed + Math.random()*(kMaxSpeed - kMinSpeed);
mc.sway = kMinSway + Math.random()*(kMaxSway - kMinSway);
mc.gotoAndStop(random(3) + 1);
}


the code(s) for removal (none of which work, dammit!):


Code:
//script placed on timeline

_root.unloadMovie['jumpinggirl', 'jumpinggirl_' + loopCount]; //1st attempt

_root.unloadClip['jumpinggirl', 'jumpinggirl_' + loopCount]; //2nd attempt

_root.removeMovieClip['jumpinggirl', 'jumpinggirl_' + loopCount]; //3rd attempt

'jumpinggirl' + i.removeMovieClip(); //4th attempt


i know this is deceptively simple - doh

thx all

Masking An Attached Mc-how?
hi.
I need to put a mask over a MC I am attaching to scene 1 so that when the MC changes size it will not overflow the mask.

thx
shaf

Slide Bar Attached To MC
I have some pages that have areas outside the stage and I want to make a slide bar at the bottom so users can pan back and forth on the page to see it all. I think I have to convert the whole area to a movie clip (it contains buttons) and then attach it to a slider so that when you slide the bar to the left the movie clip slides (not jumps) right and vice versa. I have looked through many tutorials and message boards but most deal with scrolling text which I can’t use because it uses a text box and what I have can’t be put into a text box. Besides I want it to go right and left not up and down. Some mention a scrollpane but I don’t think Flash MX has this feature. Can anyone help?

Attached Sounds
Hi,

Using Flash MX v.7

I have an attached sound that plays during a specific .swf. Is there a way to get rid of that sound when the clip unloads without stopping all sounds?

Thanks in advance for reading this.

Deck

AS To Button Attached To DB For Var
I have a button on a flash file that I would like to populate it from the database using ASP page...here is the code


the button will have a mailto: for launching email contact to the person chosen in the database....

the db file:

strContactInfo = ContactInfo;

so the variable is set (strContactInfo - dynamic text field if needed)

var set up for pulling the info from database to populate the rest of the button code...

var theUrl = "mailto:"+ContactInfo;

here is the code on the button...

on (press) {
getURL(theUrl);
}

but it doesn't work, can someone help me? must be simple enough...

thanks...

Can't Remove Attached Mc
Hi guys i wonder if someone can tell me where i am going wrong.

I Have an mc in the libary, linkage is "del"
Here is the code i use to attach to the movie
code:
delbt.onPress = function () {
if (typeof(_root.del) == undefined) {
_root.attachMovie ("dele", "del", _root.getNextHighestDepth ());
_root['del']._x = 100;
_root['del']._y = 100;
_root['del'].deleText.text = "Are you sure you want to delete this news story, newsID:" + newsID + "?";
_root['del'].newsID = newsID;
} else {
_root['del']._x = 100;
_root['del']._y = 100;
_root['del'].deleText.text = "Are you sure you want to delete this news story, newsID:" + newsID + "?";
_root['del'].newsID = newsID;
}
};

This works fine to a point.
in the "del" mc i have a button to remove "del" mc if no longer required.
code:
on (release) {
unloadMovie(_root.del)
}

I discovered that this only remove the content and not the mc that holds it "del"
So i tried
code:
on (release) {
_root.del.removeMovieClip ();
}

But this does nothing.

Anyone.

thanks
Paul

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