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




Keeping Child Movie Clips Looping



Let's say I have movie clip A which contains clips B. I want to tell B at some point to gotoAndPlay frame 'foo', and I know I can do this by the script a.b.gotoAndPlay("foo") somewhere on the parent timeline.

But A has several keyframes of animation that loop, and does this mean different instances of B for each?

What I get is B going to "foo" and starting to play that part but when A reaches the next keyframe of animation B jumps back to the start and resets to original frame.

I'd like B to keep looping it's new section of play regardless of what frame it's parent is on, can anyone help?



FlashKit > Flash Help > Flash MX
Posted on: 05-11-2003, 09:59 PM


View Complete Forum Thread with Replies

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

Looping Through Child Clips And Playing Each 1 At A Time?
Can someone help me with this? I have a custom class named Bubble (they're text bubbles) and I want to loop through all the Bubbles I have and have each one fade in, pause, and fade out. But there should never be more than 1 bubble on the stage!

The appear() function is part of the Bubble class and using tweens, each one fades in, waits 3 seconds and then fades out.

I have the following code:

Code:
function loopBubbles(bubbleLayer:Sprite, groupNo:Number):void {

for (i; i < bubbleLayer.numChildren; i++) {
var bubble:Bubble = bubbleLayer.getChildAt(i);

if (bubble._group == groupNo) {
bubble.appear();
//then until finished wait before continuing?
}
}
}
How do I make them appear one at a time? I know I could use a listener, but that just calls another function and throws me outside of my loop. Am I just setting this up all wrong?

I'd appreciate any help you can give, thanks!

Keeping An Imported Movie Clip From Looping
I am using Mx. I made a movie clip with basic motions and an extra actions layer with stop() at the last frame. I then imported that movie clip into a new movie of the same size and placed it on the stage with an instance name. The movie clip still loops, though. Am I overlooking something obvious, or is it more involved than that? Thanks to whomever can help me..

Keeping Movie Clips In Their Correct Place
I’m trying to create a flash activity for dyslexic students. I have two boxes (movie clips ) on the stage. At the top of the stage I have 12 words converted into buttons and then to movie clips. I know how to drag the words around the screen but my difficulty is trying to get the correct words into their respective boxesand staying there. I would like the incorrect words to return to their original position. Help would be much appreciated as I’m trying to do this for a college assignment.

Keeping Distance Between Movie Clips The Same When They Resize
Hello peoples,

I have two movie clips that increase in size when clicked on. I need to keep the same y distance between them when this happens. My ActionScript knowledge is awful!

I thought I could use this code (modified from this tut: http://board.flashkit.com/board/show...ce+movie+clips) for working out the distance between the two:

distY = Math.ceil(_root.clip1._y-_root.clip2._y);

but beyond that I'm completely stuck and I don't know if that'd be appropriate either.

Any help much appreciated! Thanks

Keeping Expanding Movie Clips Relative Distances Apart From Each Other
I have two movie clips that need to stay 10px apart when the first clip's height expands and contracts. So the second clip would be 'pushed down' when the first clip expands and move back into place when the first clip shrinks.

My ActionScript knowledge is pitiful and I'm really not sure how to approach this.

I've attached a file that will hopefully make what I want to achieve a bit clearer.

Any help would be much appreciated!

Cheers,

Joe

Child Movie Clips
Ok...I have a couple buttons that I want to load movie clips say box1.mc and box2.mc. How would I have "button 1" load box1.mc and when you click on "button 2" it would load box2.mc and have box 1.mc fade out and visa versa? I'm a newbie when it comes to this stuff, so details would be nice Thanks in advanced.

How Can I Remove All Child Movie Clips?
Hi guys.. I tried to search but the search doesnt seem to be working for me at the moment so guess i gotta make another pointless thread.

What I want to do is remove all child movies of a chosen movie. How can I do this?

thanks
-Geoff

edit: btw, i'm using Flash MX. (not 2004)

Iterating Through Child Movie Clips In AS3
I am working on migrating a very large Flash project from AS2 over to AS3, however I've hit a snag.

One of the effects within the project is an animated 3D 'ribbon' effect. It draws animated ribbons which fly around in 3D space and eventually land in a predefined stationary position (where multiple ribbons come together to form a line art drawing). In order to define the points for this final resting position, the effect requires small movieclip guides to be positioned at key points on the line (these guides are hidden at runtime, of course). In addition to providing an x,y coordinate for the ribbon to pass through, the scale of these clips represents the Z coordinate for the ribbon at that point, and the rotation helps determine the bezier control points which fall between the guide MCs.

Each drawing (collection of ribbons that form a single picture) contains dozens of ribbons and hundreds of guides. This method of using movieclips as guides is essential, as it is the only way to allow a designer to visually see where the ribbons will ultimately be drawn. Entering the x, y, z and rotation information manually per guide is simply not feasible.

To differentiate between the different guides, the MCs names were standardized to include the ribbon name and guide sequence. A simple example of this might be a smiley face. The ribbon that would draw the mouth might have 4 points. They would have to be named StartRibbonMouth, MouthGuide1, MouthGuide2, and EndRibbonMouth. That would create a ribbon named 'Mouth' with a start point, 2 points in the middle, and an end point. That, along with the previously mentioned rotation and scale data would be enough information to determine the final position of the ribbon (the animated paths are randomly generated at runtime).

The problem I am having is finding the guide clips by partial name in AS3. Since each ribbon has its own name, and each guide has a unique sequence number, I need to find the clips based on a partial name search (specifically the name's prefix). For example, first I scan for all guides that start with "StartRibbon" to get a list of ribbons contained in the parent movieclip. Then I use that list to find intermediary points (guides that start with the name of the ribbon) and then I find the end point (by the full name "EndRibbon" + the ribbon name).

In AS2 I had a function to return a reference to a clip based on the name prefix. It was essentially as follows:


Code:
for (var Item in Parent) {
if (typeof (Parent[Item]) == "movieclip") {
if (Parent[Item].name.substring(0, Prefix.length) == Prefix) {
return(Item);
}
}
}
Where Parent was a reference to the MC which contained the group of guide MCs to define all of the ribbons for a particular drawing.

In AS3 it is skipping the for loop completely. So far all I can find is a way to get the child MCs by full name, but no way to iterate through all of the child MCs and check each name against a substring.

Any ideas?

Parent/child Movie Clips
ok so i have a problem, i am relatively new to actionscript, my situation is:
1) i have all my actions in its own layer on the main timeline, so all is well there
2) i have a movie clip with a rollOver and rollOut events attached to it
3) inside the movie clip when the rollover happens and the movieclip stops at a certain frame, i have another movieclip that appears. the movie clip is a link to a website, it works properly on the main timeline but without the proper actionscript it of course will not work inside its parent movie clip

how do i fix this?

Deleting Child Movie Clips In Parent Movie Clip
ok so I when I click the bt1 I want it to make the home_text visible and remove all of the movie clips within the CreateXMLGallery function. But when I do gallery.removeMovieClip() it only deletes the gallery and none of the other movie clips that are created within the gallery. Any ideas why? here is the code.


HTML Code:
stop();
/***********Button Functions*************/
launch_mc._visible = false;
easeSpeed = 5;
slider_mc.onEnterFrame = function() {
this._x += (xMove1-this._x)/easeSpeed;
};
bt1.onRollOver = function() {
bt1.blendMode = "invert";
};
bt1.onRollOut = function() {
bt1.blendMode = "normal";
};
bt1.onPress = function() {
xMove = bt1._x;
};
bt1.onRelease = function() {
gallery.removeMovieClip();
home_txt._visible = true;
};
bt2.onRollOver = function() {
bt2.blendMode = "invert";
};
bt2.onRollOut = function() {
bt2.blendMode = "normal";
};
bt2.onPress = function() {
xMove = bt2._x;
};
bt2.onRelease = function() {
gallery.removeMovieClip();
home_txt._visible = false;
createXMLGallery(webXML);
};
bt3.onRollOver = function() {
bt3.blendMode = "invert";
};
bt3.onRollOut = function() {
bt3.blendMode = "normal";
};
bt3.onPress = function() {
xMove = bt3._x;
};
bt3.onRelease = function() {
gallery.removeMovieClip();
home_txt._visible = false;
createXMLGallery(interactiveXML);
};
bt4.onRollOver = function() {
bt4.blendMode = "invert";
};
bt4.onRollOut = function() {
bt4.blendMode = "normal";
};
bt4.onPress = function() {
xMove = bt4._x;
};
bt4.onRelease = function() {
gallery.removeMovieClip();
home_txt._visible = false;
createXMLGallery(avXML);
};
bt5.onRollOver = function() {
bt5.blendMode = "invert";
};
bt5.onRollOut = function() {
bt5.blendMode = "normal";
};
bt5.onPress = function() {
xMove = bt5._x;
};
bt5.onRelease = function() {
gallery.removeMovieClip();
home_txt._visible = false;
createXMLGallery(designXML);
};
/**********End Button Functions**********/
/**********Load XML files**********/
var webXML:XML = new XML();
webXML.ignoreWhite = true;
webXML.onLoad = function(success) {
if (success) {
//trace("web XML File Loaded");
}
};
webXML.load("web.xml");
var interactiveXML:XML = new XML();
interactiveXML.ignoreWhite = true;
interactiveXML.onLoad = function(success) {
if (success) {
//trace("interactive XML File Loaded");
}
};
interactiveXML.load("interactive.xml");
var avXML:XML = new XML();
avXML.ignoreWhite = true;
avXML.onLoad = function(success) {
if (success) {
//trace("audio video XML File Loaded");
}
};
avXML.load("audiovideo.xml");
var designXML:XML = new XML();
designXML.ignoreWhite = true;
designXML.onLoad = function(success) {
if (success) {
//trace("audio video XML File Loaded");
}
};
designXML.load("design.xml");
/**********XML files loaded**********/
/**********Create the Gallery*******/
function createXMLGallery(whichXML) {
var gallery:MovieClip = createEmptyMovieClip("gallery", getNextHighestDepth());
gallery._x = 70;
gallery._y = 170;
var numImages = whichXML.firstChild.childNodes.length;
var spacing:Number = 60;
var columns:Number = 3;
for (var i:Number = 0; i<numImages; i++) {
this.proj_name = whichXML.firstChild.childNodes[i].firstChild.firstChild.nodeValue;
this.proj_type = whichXML.firstChild.childNodes[i].firstChild.nextSibling.firstChild.nodeValue;
this.thumbHolder = whichXML.firstChild.childNodes[i].firstChild.nextSibling.nextSibling.firstChild.nodeValue;
this.picHolder = whichXML.firstChild.childNodes[i].firstChild.nextSibling.nextSibling.nextSibling.firstChild.nodeValue;
this.proj_media = whichXML.firstChild.childNodes[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nodeValue;
this.description = whichXML.firstChild.childNodes[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nodeValue;
this.proj_link = whichXML.firstChild.childNodes[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nodeValue;
this.thumbViewer = gallery.createEmptyMovieClip("thumb"+i, i);
this.thumbViewer._x = (i%columns)*spacing;
this.thumbViewer._y = Math.floor(i/columns)*spacing;
this.thumbLoader = this.thumbViewer.createEmptyMovieClip("thumbnail_image", getNextHighestDepth());
this.thumbViewer.description = this.description;
this.thumbViewer.picHolder = this.picHolder;
this.thumbViewer.proj_link = this.proj_link;
this.thumbViewer.proj_name = this.proj_name;
this.thumbViewer.proj_type = this.proj_type;
this.thumbViewer.proj_media = this.proj_media;
this.thumbViewer.whichXML = whichXML;
this.thumbLoader.loadMovie(this.thumbHolder);
this.thumbViewer.onRollOver = function() {
var proj_name = this.proj_name;
captionFN(true, proj_name, this);
this.onRollOut = function() {
captionFN(false);
};
};
this.thumbViewer.onRelease = function() {
launch_mc._visible = true;
var url = this.proj_link;
var type = this.proj_type;
var media = this.proj_media;
launch_mc.onRelease = function() {
if (type == "Website") {
getURL(url);
} else if (type == "Interactive") {
trace(url);
fscommand("exec", url);
} else if (type == "Design") {
var shade:MovieClip = createEmptyMovieClip("shade", getNextHighestDepth());
with (shade) {
beginFill(0xFFFFFF, 75);
moveTo(0, 0);
lineTo(Stage.width, 0);
lineTo(Stage.width, Stage.height);
lineTo(0, Stage.height);
lineTo(0, 0);
}
shade.useHandCursor = false;
shade.onRelease = function() {
trace("OUCH");
};
shade.onPress = function() {
trace("OUCH");
};
var imageViewer:MovieClip = attachMovie("imageviewer", "imageView", getNextHighestDepth());
imageView._x = Stage.width/2-imageViewer._width/2-10;
imageView._y = Stage.height/2-imageViewer._height/2;
var closeMovie:MovieClip = attachMovie("close", "closeMov", getNextHighestDepth());
closeMovie._x = 568;
closeMovie._y = 75;
closeMovie._width = 48;
closeMovie._height = 19;
closeMovie.onRollOver = function() {
this._alpha = 50;
};
closeMovie.onRollOut = function() {
this._alpha = 100;
};
closeMovie.onRelease = function() {
imageView.removeMovieClip();
closeMovie.removeMovieClip();
shade.removeMovieClip();
thumb.removeMovieClip();
};
var thumb:MovieClip = createEmptyMovieClip("thumb", getNextHighestDepth());
thumb.attachMovie(url, "urlofmovie", getNextHighestDepth());
thumb._x = Stage.width/2-thumb._width/2-10;
thumb._y = Stage.height/2-thumb._height/2;
} else if (type == "Video") {
fscommand("exec", url);
}
};
var thumbInfo:MovieClip = createEmptyMovieClip("thumbinfo", getNextHighestDepth());
//Description field attributes
createTextField("desc", getNextHighestDepth(), 555, 170, 200, 300);
desc.border = false;
desc.multiline = true;
desc.wordWrap = true;
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "Verdana";
my_fmt.size = 12;
my_fmt.align = "justify";
desc.text = this.description+"
Media: "+media;
desc.selectable = false;
desc.textColor = 0xffffff;
desc.setTextFormat(my_fmt);
//End description field attributes
thumbInfo.loadMovie(this.picHolder);
thumbInfo._x = 315;
thumbInfo._y = 200;
};
}
}
/**************End Gallery*******************/

Dynamically Duplication Movie And Its Child Movie Clips
Hi all,

I have a movie clip in my library. This movie clip contains other movie clip also.

Now I want to bring this movie clip to the stage. I have used attachmovie method to do this. Whatever the new name, I have assigned to the movie clip in the AttachMovie method works well. But the movie clips inside that movie clip doesn't have the name.

How to name the movie clip and all its child movie clip.

Thanx

Nag

Help Applying An Action To A Bunch Of Child Movie Clips
Hi folks,

I'm trying to build a dealer locator map. I figured it would take me a day to figure out, and I've been struggling with it for a week. I've got almost all of it done, but there's one thing I still can't get a handle on.

I've got an accordion component containing the list of dealers called "myAccordion". I'm loading an xml file in it like so:

var my_xml:XML = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success:Boolean) {
myLabel.text = this.firstChild.childNodes[0];
myTextArea.text = this.firstChild.childNodes[1];
myTextArea2.text = this.firstChild.childNodes[2];
myTextArea3.text = this.firstChild.childNodes[3];
myTextArea4.text = this.firstChild.childNodes[4];
};
my_xml.load("ny.xml");

Then I have a movieclip called "map". In it are 50 child movie clips (one for each state) which are named "NY" (for new york), "WA" (for washington), etc.

When someone clicks on a state, I need 2 things to happen:

1. change the color of the state
3. load an xml doc with the same name (wa.xml, ny.xml, etc.) into myAccordion

How do I apply an action to all of the children of the map that will do that?

Preloading Child Movie Clips Before Functions Can Be Called
okay, so I have a timeline with 2 frames, frame one loads the XML data into the app and advances to frame 2 when done.

Frame 2 has a movie clip on it which displays an image dynamically and resizes it, with preloader.

On the actions layer of frame 2 I have the following:

stop();
if(XMLfeed.image != null) {
imageClip.setImage(XMLfeed.image);
}

this doesn't work because the actionscript in imageClip hasn't loaded yet, so the function isn't available.

if I put in a 3rd frame and move the actionscript on frame 2 to frame 3, it works because imageClip is loaded on frame 2, but this is a kludge.

Any ideas on how to solve this?

thanks
Jacob

Page 2 - Preloading Child Movie Clips Before Functions Can Be Called
Okay, I think I found the "Best practices" solution, and it seems to work...

I export the clip for action script on the first frame from the library...

Then in the first frame of artist_image I have:

ArtistImage.init = function() {
var x = y;
etc. etc.
}

Object.registerObject("artist_image",ArtistImage);
ArtistImage.prototype = new MovieClip();

ArtistImage.prototype.setImage = function(imagename) {
//do it all here
}

This seems to work, and loads before the function call is made.

What do you think of this?

Keeping Track Of Child Objects Of Duplicated MC's
Hi,

I'm new at this forum but im hoping there's someone here who knows more about flash then me.
I'm building a map with mouse-over "targets" on it. When the user would move their mouse over a target point on the map a popup should appear with some text in it.

I currently have one popup constructed in an MC, the MC contains a simple basic popup construction that can be found in the many "how to make a dropdown menu in flash" tutorials scattered around the net.

I also have some actionscript reading from an XML file where to duplicate instances of this popup into the scene. The placement coordinates of the "targets" and their embedded popup menu as well as the text put in the popup are taken from the XML file.

Now to finish up this thing i would like to use an external CSS file to do the markup of the text put in the popups. and this is where im having a problem. All the tutorials on the web point the styleSheet property straighta the dynamictext object, but because in my case my Dynamic Text Objects are childs of my duplicated mc I have no idea how to assign them a name or keep track of them.

I have the following code to read the xml file and duplicate my targets over the map:


Quote:




// loading css file
var css:TextField.StyleSheet = new TextField.StyleSheet();
var cssPath = "location.css";
css.load(cssPath);
css.onLoad = function(cssloaded:Boolean) {if (cssloaded) {} // end if loaded css
else {output.text = "Error loading CSS file!";} // end if not loaded css} // end css onload function

// import the Delegate class
import mx.utils.Delegate;

// declare a new XML instance
var floatersxml:XML = new XML();

function onXmlLoaded(success:Boolean) {if (success) {// do whatever you want to do if the XML file was read successfully

// make a handle to the root node in the xml
var mainnode:XMLNode = floatersxml.firstChild;
update = mainnode.attributes.lastupdate;

// set up an array of all person nodes and create duplicates of the original floater
var floaternodes:Array = floatersxml.firstChild.childNodes;
for (var i:Number = 0; i < floaternodes.length; i++) {// duplicate movie clip of floater.
duplicateMovieClip(_root.origFloater_mc,"floater_m c_"+i,i); // duplicate is called _root.floater_btn_i where i is a number between 0 and floaternodes.length
// for each floater node:
var floaternode:XMLNode = floaternodes[i];
var path = _root["floater_mc_"+i]; // easier way to target floater_btn
path._x = floaternode.attributes.xpos; // own x-pos
path._y = floaternode.attributes.ypos; // own y-pos
path.targetTitle = "<p class='title'>"+floaternode.childNodes[0].firstChild+"</p>"; // add title text
path.targetDesc = "<p class='desc'>"+floaternode.childNodes[1].firstChild+"</p>"; // add desc text
path.popupgroup_mc.styleSheet = css; // add css
path.targetCount = floaternodes.length; // add total amount of floaters value} // end for loop} // end if xml loaded
else {// XML read error occurred
trace('error reading XML');}}

function init() {// ignore tabs, returns, and other whitespace between nodes
floatersxml.ignoreWhite = true;

// set the scope of the onLoad function to the main timeline, not peoplexml
floatersxml.onLoad = Delegate.create(this, onXmlLoaded);

// start loading the file
floatersxml.load("floaters.xml");}

init();




As u can see I've tried to assign a styleSheet property already, but it's not working.

The placement of the Dynamic Text Objects in the original MC (the one that gets duplicated) are as followed:


Quote:




_root.origFloater_mc.popupgroup_mc.title_txt

_root.origFloater_mc.popupgroup_mc.desc_txt




Here the popupgroup_mc represents the mc with the popup when an on (rollOver) is recognized on the "target" button object which also is located inside the "origFloater_mc".


Quote:




title_txt currently gets it's text from _parent.targetTitle

desc_txt currently gets it's text from _parent.targetDesc




as described in the code inserted above these targetTitle and targetDesc vars are located in the _root["floater_mc_"+i]'s (the duplicates)

Does anyone know how i can apply my styleSheet to the dynamic text objects inside my duplicates?

Action Script In Child Movie Clips, Instances, Symbols( Problem)
Hi,
Have come across a problem when trying to use action script in a movie clip symbol (created in the Library) and using an instance in a layer in the main move.

The action script which is in the movie clip instance seems to work differently to how it would if the exact same code was in a script layer in the main time line (or u could say that is doesn't work the the way it should).

I have 2 examples of this:

- XML.load(); loads but does not parse (ie load xml into DOM), yet returns success = true in the onLoad call back.


- scope of Array objects seems to be limited. That is an array (in this case containing the XML) is not accessible from the next frame. or rather does not exist in the next frame. Trying to assign this array to a globaly declared array results in a zero length array.


has anybody come across this before? if so is this a known problem or am i doing something wrong?

thanks

Changing Size Of Child Clips To Match Parent Movie Clip?
I have a program that is dynamically loading images into a nested movie clip. The Parent movie contains the two separate movies within it and images are to switch back and forth in them. I need to know how I can use action script to load these nested movies to the exact dimension of the parent movieclip.

Here is my code:

onClipEvent (load) {
StagePictures._lockroot = true;

e_mc.loadMovie(_root.PathText+_root.imageClips[0]);

}
onClipEvent (enterFrame) {
if (Key.isDown(a number)) {
if (Key.isDown(Key.something)) {
if (Key.isDown(a number)) {
_root.StagePictures.e_mc.createEmptyMovieClip("Sec ondClip" , 3);
_root.StagePictures.e_mc.SecondClip.loadMovie(_roo t.PathText+_root.imageClips[1]);
_root.ScoreBox.text = scvar+1;
_root.Command.text = _root.imageCommand[1];
_root.Response.text = "Correct!";
}
}
}
}

StagePictures is the parent clip, e_mc is a child, and SecondClip is a child within e_mc.

Both e_mc, and SecondClip are loading the dynamic images which are the paths labeled _root.PathText+_root.imageClips[0, and 1];

The size of the images need to be contained within the size of the parent clip of both called StagePictures.

How can I set the size of the two nested clips to match the parent?

Thanks,
sam

Create Container Movie Clip And Child Clips At Design Time?
It's always powerful and dynamic to use "createEmptyMovieClip" and "attachmovieclip" at run time. But how to create this relationship of clips at design time so that an empty movie clip can hold several child movie clips?

Thanks!

Looping Movie Clips.....
Hi
I hope someone can help me with my little problem. It may seem like piece of cake for some, but not to me...
I have a movieclip that I want to loop 3 times and then go to another frame in the main movie/scene. The main movie/scene has only 2 frames, the first where the mc is placed and the second will be a link. Im sure I can have that last frame inside the mc aswell...
Anything will work, as long as i can play the mc 3 times and the go to another frame, without having to duplicate alle the frames in the MC.

TIA

PMAndersen

Looping Movie Clips
I have a question... (suprise!).. I'll try not to make it too complicated.

In a main menu of my project I have four boxes that contain movie clips of images f ading in and out... theres 6 images for each box but when it's done I want it to start back at the begening again... should I place a gotoandplay(1) at the end of the movie clip? is that the proper way to do it?

and also... do I need to extend the frame # of the original menu to the same number the movie clip would extend to? it doesnt seem to play unless i do that? Am i doing something wrong?

I appreciate any replies,

Thanks.

Looping Movie Clips
How do you stop an imported movie clip from looping in the final published swf file? I have put stop actions on the first and last frames of the imported movie clip -- and replaced it in the final, but it still loops continuosly. Can someone help me with this?

Help With Looping Movie Clips
I hope someone can please help because i am useless with actionscript

I am trying to loop my movie clips which is only 95 frames. Every time I press the play button which starts the movie and simultaneously starts the music files, the movie clip and sound will start to play but when the movie clip reaches the last frame it will automatically go back to the home scene but the music will continue to play. The script that I am using follows:

on (release) {
gotoAndPlay ("liveband",1);
}
on (press) {

if (playing!=true) {
_root.zeroSound.start();
playing=true;
_root.myTextBox="Playing"
}
_root.zeroSound.onSoundComplete = function() {
_root.myTextBox="Complete"
playing=false
}
}

I need it to work so when I press the button the movie and sound will play, and when it gets to the last frame of the movie file, it will loop, and the movie clip will start again, and prevent it from going to the home scene.

Please Help

Thanks

Help Looping Movie Clips
http://resellerzoom.com/reseller-hosting.html

how did they keep this animation rotating forever?

how did they keep all the effects going so seemlessly.


Thanks

Help Looping Movie Clips
http://resellerzoom.com/reseller-hosting.html

how did they keep this animation rotating forever?

how did they keep all the effects going so seemlessly.


Thanks

Movie Clips Looping
Hi, I'm a newbie here! I've been teaching myself how to use Flash using the Flash MX Bible.

Here's my question:

I've got a movie clip on the main timeline that has a nested movie clip that has a nested movie clip. Right now movie clip #1 stops and goes to movie clip #2 which stops and goes to movie clip #3 which starts playing on a loop. The only actionscript I'm using is stop to keep #1 and #2 from playing on a loop. My client now wants the whole flash animation to play on a loop. I know how to keep things from looping, but not how to get all these movie clips to act as one movie clip that loops.

You guys are probably going....

Looping Movie Clips
Hi,

I am trying to load a movie from within a movie (basically a host movie that is made up of smaller movie clips- they all need to be independant of each other)

I am trying to get the main host movie to scroll down, looping through seamlessly to the start again  - I don't want a big gap between the end of the movie and the start of the next loop. (i.e. show each line of text 1 to 15 horiztontally three rows at a time. when row 15 gets to the middle row, row 1 needs to come into view in the bottom row) probably confusing the hell out of you now!

Any tips would be appreciated.

Lewis

Looping Movie Clips With A Set Variable
I always used the time line for this one, usually... but I was wondering how the heck do I tell flash that I only want the movieclip to loop seven times. or six, or five... I just want to figure this out. I know that this is childs play to you and I am in a worl of hurt here... could you please help me out?

Thank You!

Stopping Looping Movie Clips
How do you stop an imported movie clip from looping in the final published swf file? I have put stop actions on the first and last frames of the imported movie clip -- and replaced it in the final, but it still loops continuosly. Can someone please help me with this? Thanks.

[F8] Scrolling / Looping Movie Clips
This is the code that I have so far, the moveClipRight() function works fine. But I can't seem to get the moveClipLeft() function to work. It won't wrap the second movie around. I have gone through it a thousand times in my head trying to figure out what I am doing wrong and made little tweaks, but I can't seem to get it. I may be tracing to code incorrectly so if someone could go through the steps for me I would appreciate it, I put comments in as to how I think everything is going.


Code:
var digiSpeed:Number = 145;
var dpwidth:Number = digiPhotoMOV._width;
var endofLine:Number = mask_mc._x + mask_mc._width;
var startofLine:Number = mask_mc._x;
var interval:Number;

function moveClipRight() {
digiPhotoMOV._x += digiSpeed;
digiPhotoMOV2._x += digiSpeed;

//If the x pos of the first move passes the x position of the mask then
//move the first clip to the left of the second clip
if (digiPhotoMOV._x > startofLine) {
digiPhotoMOV._x = digiPhotoMOV2._x - dpwidth;
}
//If the second movie passes the x position of the mask then move it
//to the left of the first clip
else if (digiPhotoMOV2._x > startofLine) {
digiPhotoMOV2._x = digiPhotoMOV._x - dpwidth;
}
}

function moveClipLeft() {
digiPhotoMOV._x -= digiSpeed;
digiPhotoMOV2._x -= digiSpeed;

//If the first movie x positon passes the right side of the mask
//then move it to the right of the second movie
if (digiPhotoMOV._x < endofLine) {
digiPhotoMOV._x = digiPhotoMOV2._x + dpwidth;
}
//If the second movie x position passes the right side of the mask
//then move it to the right of the first movie
else if (digiPhotoMOV2._x <endofLine) {
digiPhotoMOV2._x = digiPhotoMOV._x + dpwidth;
}
}

movRight.onRollOver = function() {
interval = setInterval(this._parent,"moveClipRight",50);
}

movRight.onRollOut = function() {
clearInterval(interval);
}

movLeft.onRollOver = function() {
interval = setInterval(this._parent,"moveClipLeft",50);
}

movLeft.onRollOut = function() {
clearInterval(interval);
}
Thanks for taking your time to read this. I appreciate any help.

Loading Movie Clips One After Another, Then Looping
I created 3 movie clips inside my flash movie. It starts off with a white background. I need the 1st clip to play, then the 2nd one to play (on top of the 1st) after the 1st is completed, and then the 3rd clip to play (on top of the 2nd) after the 2nd clip is completed.

Each movie clip fades in so it is essential to have the clip fade in on top of the previous clip instead of a white bg.

And then I need it to loop, having the 1st clip play on top of the previous 3rd clip and so on...

Any actionscript advice would be greatly apprecaited, thank you!

Looping Though Existing Movie Clips
I don't know why I'm having such a hard time finding a definitive answer for this one.

I know how to use iteration to create movie clips on the fly in AS3, and then how to go back though and perform actions on them.

What I have here is a file where all the movie clips are already on the stage. Each clip is completely different due to design and some other considerations. The naming convention however is "mc1", "mc", etc...

In AS2, you could do something similar to this:


Code:
for (i:Number = 1; i <= 30; i++) {
eval("mc" + i).someProperty = whatever;
}


What is the equivalent of this in AS3? I really just need to be able to create the instance name of the clip in the loop using the iteration value. The instance names are already set on the clip in the property inspector.

I'm sure there's a really simple way of doing this that I'm overlooking.

Thanks!

[MX04] Looping Multiple Movie Clips
Hello all-

I am creating an ad/header graphic for a web site. I have 7 movie clips that I need to rotate through. They are pretty basic movie clips, picture fades in, text fades in, pauses for 15 seconds, then needs to move on to next movie clip. There's where my problem lies.

I have it set up on Scene 1, where I have movie clip 1 as a layer 1, movie clip 2 as layer 2, movie clip 3 as layer 3, etc. When I preview it, only movie clip 1 plays and then it repeats itself. It never makes it to the next movie clip. Is there some action script that I can put in to make it jump to the next movie clip? Is there an easier way to do this, or do I need to create one long movie clip that includes all 7 movies?

Thanks!

Kauzmo

Weird - Looping Through Movie Clips - Now And Again, One Isn't Detected?
I wondered if anyone had anyone ever encountered this problem.

Basically, the script is attaching a movie clip on spacebar press. Then a function loops through these clips, moving them.

But, the odd one, as you will see after playing for a bit (i suggest holding spacebar down and moving backwards-forwards allot) just stops, doesn't move and isn't detected anymore.

please see attached .swf

Question Involving Looping Movie Clips
The stage area is 300x200. I have a ball that moves around with the arrow keys. However, if the ball goes all the way to the right of the screen, i want it to appear on the left side, and if the ball goes on the left side i want it to appear on the right side. So i assigned the code to the ball:


Code:
onClipEvent(enterFrame){
if(Key.isDown(38)){
_root.ball2._y = _root.ball2._y - 5;
}
if(Key.isDown(40)){
_root.ball2._y = _root.ball2._y + 5;
}
if(Key.isDown(37)){
_root.ball2.gotoAndStop("left");
_root.ball2._x = _root.ball2._x - 5;
}
if(Key.isDown(39)){
_root.ball2.gotoAndStop("right");
_root.ball2._x = _root.ball2._x + 5;
}
if(this._x>300) {
//<=
this._x = this._x - 300; //<=
}
if(this._x<300){
this._x = this._x + 300;
}
}
However, it doesn't work. I've been experimenting with this for several hours now and i still can't figure it out

Captivate Movie Clips Looping In Flash
I've read the discussions on the forum, but nothing seems to be able to stop a captivate 2 movie clip from looping when brought into Flash. I exported the captivate movie with the default values, converted it to a movie clip in Flash8 so I could resize it, brought the movie clip into the Flash movie by dragging it to the stage. Everything looks great, but I can't stop the clip from looping. Stop commands placed within the movie clip seem to have no effect nor do commands put on the main timeline.

Thanks for the help.

How Can I Get Looping Movie Clips Reset Prematurely
i have a looping ( 10 frames) movie clip of some flowing gas through a pipe. during execuation, whenever another tween finishes around it (say, a shape tween for a mask), the gas loop starts from frame 1 again creating an annoying stutter. How do I keep that looping movie clip smooth?

I've noticed this problem a lot in other movie clip loops as well.

Looping Movie Clips And Rollver Question
Hello,

I'm thinking this is a lot easier than I making it but I'm hitting a wall.

I have a few movie clips that loop from point A to point B on the stage continuously. I want the movies to pause when rolled-over and possible execute a secondary animation and then continue on their path on the Roll-Out.

I can accomplish this through tweening directly on the timeline but I would like to do it through actionscripting for more control. Unfortunately, this is causing erratic results.

I can post the code but its basically a function with a transitions.Tween from point A to point B and a movieclip.onRollOver function.

Thanks for any help on this.

Looping Movie Clips With Dynamic Frame Rates
Hello-

I have a question. I am new to programming, Flash, and actionscript - so bear with me. I am trying to create a game with 3 different levels of difficulty. To do so, I need to create a movie clip with three different frame rates (essentially - three different movie clips). I got a great script somewhere to enable me to do this. It goes in the first frame of the movie clip whose frame rate is to be adjusted. Here it is:

 function timelineFaster() {
  nextFrame();
  updateAfterEvent();
}
var tweenFaster:Number = setInterval(timelineFaster, 42);


(The "42" in the last line can be adjusted to make the timeline go faster or slower). Anyway - my question/problem is this: When I put this code in the first frame of my movie clip, the movie clip no longer loops. Can anyone send me the code I need to add to this frame that will allow the movie clip to loop? I believe this is probably an easy fix, but as I said - I am a babe in the woods when it comes to Flash, actionscript, and programming. I hope someone can post/send the code I need to force my movie clip to loop. Thanks!

Monica

Keeping "state" With Many Movie Clips
In one frame (Frame A), I've dynamically attached many movie clips for a tile-based game. This happens in the init function of that frame. If I move to another frame (Frame B) temporarily (to display something else), it looks like I need to remove or unload all of the movie clips so that they don't show up on Frame B. Is that the only way to not have them show? The problem is that when I return to Frame A, I would like it to have the same state (positions of objects, etc.) as when I left it. What is the best way to accomplish this?

As an alternative, I suppose I could draw something on top of the screen (higher z order) and mask what is below and then remove what was draw on top when I'm finished with it. I would prefer to figure out a way to accomplish it the first way, though, because I can use this for other things as well.

Does anyone have any advice on this?

Thanks!

Keeping Swf File From Looping With Stop ()
Hi there. I’m working with a Flash movie (about 9 MB) and I want to keep the file from looping indefinitely. I’ve learned that I would need to insert a key frame at the end of the movie and after highlighting the new key frame insert stop () action script.

It does the trick and the movie won’t loop anymore.

But now the movie is twice the size, which entails a whole new set of issues.

Is there another way? Where did I go wrong? Why is that?

I’m obviously a novice when it comes to Flash and I’m learning as I go. So any ideas and pointers would be greatly appreciated. Thanks.

Help With Looping Movie Clips And Changing Dynamic Text Fields
I feel like an idiot because I can't figure this out. I'm fairly new to the more advanced actionscript. Here is my problem:

I have an array of text strings that I want to loop through, loading a movie clip with a dynamic text field that would change depending on the array element you are on. I can't figure out how to do this correctly - it is only showing the last element in the array. Here is my code.


name_text_array = ["First Name","Second Name","Third Name"];
_root.createEmptyMovieClip("my_mc",1);
my_mc._x = 200;
my_mc._y = 200;

for (i=0;i<name_text_array.length;i++) {
my_mc.attachMovie("nameclip","nameclip_mc",2);
trace(name_text_array[i]);
my_mc.nameclip_mc.name_text.text = name_text_array[i];
removeMovieClip("nameclip_mc");
}

In my library I have a movie called nameclip_mc, which has a dynamic text field named name_text.
I have the linkage set for the nameclip_mc to export to actionscript with the Identifier nameclip.

What I want to see is the movie clip loading with the word "First Name", then removed... then the movie clip loading again with the word "Second Name", and then lastly "Third Name". But instead I am just getting "Third Name". The trace does display all the names in the output window.

I feel like I am missing some key concept here! Please help because I need to make this prototype into a project for work.

Any help is appreciated!

Looping Movie Clips And Changing A Dynamic Text Field
I feel like an idiot and I can't find any documentation that can help me... here is my problem:

I have an array of text strings that I want to loop through, loading a movie clip with a dynamic text field that would change depending on the array element you are on. I can't figure out how to do this correctly - it is only showing the last element in the array. Here is my code.


name_text_array = ["First Name","Second Name","Third Name"];
_root.createEmptyMovieClip("my_mc",1);
my_mc._x = 200;
my_mc._y = 200;

for (i=0;i<name_text_array.length;i++) {
my_mc.attachMovie("nameclip","nameclip_mc",2);
trace(name_text_array[i]);
my_mc.nameclip_mc.name_text.text = name_text_array[i];
removeMovieClip("nameclip_mc");
}

In my library I have a movie called nameclip_mc, which has a dynamic text field named name_text.
I have the linkage set for the nameclip_mc to export to actionscript with the Identifier nameclip.

What I want to see is the movie clip loading with the word "First Name", then removed... then the movie clip loading again with the word "Second Name", and then lastly "Third Name". But instead I am just getting "Third Name". The trace does display all the names in the output window.

I feel like I am missing some key concept here! Please help because I need to make this prototype into a project for work. Once I figure out how to do this I think I can move on with my life

Any help is appreciated!

Keeping A Sound File Looping Between Scenes.
hello all,

I've got a sound clip that I'm using as background music. Just a loop. But I'm trying to get it to play regardless of the scene the user goes to. (i have 5 buttons going to 5 different scenes). I have no clue how to define this in actionscript or just using the interface because I don't know what commands, if any, override scene selections.

Thanks

AttachMovie - Looping Thru An Array To Attach 6 Movie Clips Into An Empty Clip
Heres my issue...

Im loading in 6 different external icon button images using an XML file into an movieclip. well now i dont want external images to load from an xml file, i want the images to be inside flash in the library. I gave them a linkage name and made an array of them called menuIcons.

how do i get my icon images to load into flash without loading external images from an xml file...

heres my code..


var xml:XML = new XML();
xml.ignoreWhite = true;

xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItem = nodes.length;
for (var i=0; i<numOfItem; i++)
{
menuIcons = ["healthySkin", "environMoist", "lowerSkin", "drySkin", "waterInfusion", "healthyCellular"];

var t = home.attachMovie("item", "item" + i, i + 1);
t.angle = i * ((Math.PI * 2)/numOfItem);t.onEnterFrame = mover;
t.nameClip = (nodes[i].attributes.nameClip);
t.content = (nodes[i].attributes.content);
t.icon.inner.loadMovie(nodes[i].attributes.image);t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
}
}

thanks

slalonde44

DuplicateMovieClip Not Copying "child" Movie Clips
I think I'm missing the boat here, what am I missing?!?!!

1) I have a container movie clip instance on the stage at design time.

2) At runtime a number of "child" movie clips are attached to the container clip instance.

3) I try to use the duplicateMovieClip method to duplicate the entire container clip instance.

4) Only the original container clip is duplicated. The movie clips that were attached to the container at runtime are NOT duplicated along with the container clip itself.

I'm sure I'm missing some basic concept here....so please...point me in the right direction!

Thanks!

Multiple Movie Clips Keep Looping On Main Stage When I Have A "Stop" Action In MC?
I've created a movie clip that has eight frames with a "stop" via actionscript in the last frame. In my main movie I have placed 11 instances to come in one "after" the other by varying each instance to it's own layer (11 layers) and placing each instance in the appropriate frame.
Example: instance one in frame one - layer one, instance two on layer two - frame two, instance three on layer three - frame three.

Problem: When I publish the file and open up the .swf the first instance comes in and stops. All the other instances come in but they all keep looping except the first instance in layer one frame one. When I move all the instances into frame one at the beginning of their layers the published swf file plays all instances at once and then stops just like I want.

Question: Why is it that the instances keep looping in different frames and not when they are in the first frame of their prospective layers? I want the instances to start one after the other and not all at once and then I want them to stop. I placed a "stop" action at the end of the MC?

All instances have not had any of their properties altered and are movie clips on the main scene. There is no added actionscripts anywhere else. I have attached the fla file which is really small of what I am trying to accomplish. Thanks in advance for all your help.

Multiple Movie Clips Keep Looping On Main Stage When I Have A "Stop" Action In MC?
I've created a movie clip that has eight frames with a "stop" via actionscript in the last frame. In my main movie I have placed 11 instances to come in one "after" the other by varying each instance to it's own layer (11 layers) and placing each instance in the appropriate frame.
Example: instance one in frame one - layer one, instance two on layer two - frame two, instance three on layer three - frame three.

Problem: When I publish the file and open up the .swf the first instance comes in and stops. All the other instances come in but they all keep looping except the first instance in layer one frame one. When I move all the instances into frame one at the beginning of their layers the published swf file plays all instances at once and then stops just like I want.

Question: Why is it that the instances keep looping in different frames and not when they are in the first frame of their prospective layers? I want the instances to start one after the other and not all at once and then I want them to stop. I placed a "stop" action at the end of the MC?

All instances have not had any of their properties altered and are movie clips on the main scene. There is no added actionscripts anywhere else. I have attached the fla file which is really small of what I am trying to accomplish. Thanks in advance for all your help.

How To Stop All Child Clips?
Hello,

I am using a button script to stop all movie clips in a scene:

on (release)
{
stopAllMovies(_root);

function stopAllMovies(movie:MovieClip):Void {
movie.stop();
for (var i:String in movie) {
if (movie[i] instanceof MovieClip) {
movie[i].stop();
stopAllMovies(movie[i]);
}
}
}
}

this works great, however, can anyone tell me how to script a "play" button that will start all the clips EXCEPT for _root? I want all the nested clips to continue playing if the user decides, however if it also plays the root then the parent begins playing, and that is bad!!!

thanks

Duplicating Child Clips
Please, please help!!

I'm trying to duplicate a movie clip that has several child clips, after I've rotated the child clips. My code:

ctrX = Stage.width/2;
ctrY = Stage.height/2;

button.onRelease = function() {
box.s1._rotation -= 45;
box.s2._rotation -= 45;
box.s3._rotation -= 45;

for (var i=1; i< 9; i++) {
var depth = (i-1)*4;
var rot = (i-1) * 45;
var dbox:MovieClip = box.duplicateMovieClip("box"+i,depth+1,{_x:ctrX, _y:ctrY, _rotation:rot});
var dmask:MovieClip = mask.duplicateMovieClip("mask"+i,depth+2,{_x:ctrX, _y:ctrY, _rotation:rot});
dbox.setMask(dmask);
}
}

The clips "box" and "mask" are in a single frame on the stage, as is button, and the clips s1,s2 and s3 are in a single frame in "box." There's no other code anywhere.

What I want to do is duplicate "box" after mainpulating its child clips. What I get is a duplicate of the original "box" each time I press the button. Can someone help?

BTW, the above stuff is a prototype, strictly to try to figure what in the hay is going on. My goal, eventually, is to populate the "box" with dynamic content, then duplicate it multple times.

Thanks,
dougt

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