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


ActionScript 3.0 :: Creating Multiple, Adjustable, Instances Of A Movie Clip?

I've done some basic flash for my college course and i'm moving onto advanced flash and Actionscript. For this, i'm trying to build a "construction game".

What I have is objects on the right side, and I want to be able to drag out copies of those objects onto the left and have the size and rotation of each object adjustable...

So say click and drag on a circle, it puts a copy of the circle where I place it on the left. I can then drag that circle around, scale it or rotate it, or if I decide I don't want it at all, drag it onto a recycle bin icon and have it removed.

I'd like to be able to make as many copies of that circle as allowed (so maybe a limit of 10?), and have each one adjustable when you "select" it...

View 1 Replies (Posted: 02-21-2011, 06:41 PM)

Sponsored Links:

Related Forum Messages For Flash category:
ActionScript 2.0 :: Creating Instances Of Nested Movie Clip?
I have a movie clip 'sliderMc' which contains two other clips 'slider' and 'groove'. I've used actionscript to make the 'slider' clip move along the 'groove' and display the value of the at each point in a text field. The idea is to have a slider object that i can use multiple times. I want a situation whereby I can create instances of 'sliderMc' so that I'll be able to move the slider on the individual clips and have each slider update different variables which would then be sent to an XML file or php. Im able tp talk back and forth between php and xml with no problem; The issue I'm facing is that after creating multiple instances of 'sliderMc', I'm not able to give the 'slider' and 'groove' movie clips different instance names without changing the instance names of all other 'slider' and 'groove' instances of 'sliderMc'. Which in turn makes it difficult to distinguish between the different sliders in actionscript.

Posted: 02-12-2009, 03:53 AM

View 0 Replies!   View Related
Flash :: Multiple Instances Of A Movie Clip?
I'm creating an XML custom card game and am at the point of building the deck and making them draggable so the user can drag and drop them on top of another to build the deck and put multiple instances of the movie clip that resides in the library, I just cannot figure out a way to make each one of the cards draggable. What currently is happening is the card on top of the deck is the only one that will drag, even if I click on the card below it. I have researched setChildIndex(), but I don't think I am using it correctly.

Another issue I'm having is when the user clicks the click_btn (named for testing only) to build the deck it takes a while to build it, can that be sped up any? Then once the user clicks the first card to drag it there is another long wait?

Document Class (
package library
import flash.display.*;[code].....

The xml file actually has 64 activity card entries and 41 event card entries, but I trimmed it down to make it easier.

Posted: Sep 14 11 at 16:15

View 1 Replies!   View Related
ActionScript 3.0 :: Create Multiple Instances Of This Movie Clip At Run Time?
I have created a movie clip which contains a button and a dynamic text field, instance name "anwTxt". In the dynamic text field I entered just the word "field" and set the the following in the properties window: multiline=true, wordwrap=true, font=16, font color=white.I then dynamically create multiple instances of this movie clip at run time, populating the text field from the contents of a user defined array. However if the text inserted from the array is to long it is simply cut off, instead of continuing on to a new line. Does anyone know why the field will not generate new lines, or have another solution to this issue?

Supporting info:

Code: Comments to explain
//inside a for loop[code]....

Using "holder2.anwTxt.multiline = true;" has no affect. If I attempt to alter the height or width of the textfield (ie.holder2. anwTxt. height = 400 I recieve the error "thats a read only property"

Posted: 08-03-2010, 01:46 PM

View 1 Replies!   View Related
ActionScript 3.0 :: Create Multiple / Limited Movie Clip Instances With A Button?
click btSpawnAdd 1 mcObject to the stage, with a limit of 5 maximum of that objectclick btDestroyRemove 1 mcObject from the stage until all are goneI assume you'd use classes and arrays to get this done? I've managed to get a button creating objects onto the stage by doing that, but I can't figure out how to set a maximum.The end goal is to create drag & drop objects by clicking a button, and then being able to drag those objects onto a "recycle bin" to remove one.

Posted: 04-02-2011, 05:43 AM

View 18 Replies!   View Related
ActionScript 3.0 :: Creating 'reflection' Of A Movie Clip By Dragging Multiple Movie Clips
how to imitate a reflection of a movie clip in a "mirror." I don't know if I should have the initial movie clip on custom cursor or have it set to drag... but either way I don't know how to make the second clip the "reflection follow along. Obviously it would need to follow at a slightly offset pattern so that you would be able to see both clips (or majority of them) at the same time. It's for a school project that is due at 9am tomorrow so time is of the essence!!

Posted: Apr 5, 2011 2:59 PM

View 4 Replies!   View Related
ActionScript 3.0 :: Creating Multiple Instances Of One Movieclip?
I'm having trouble creating multiple instances of one movieclip. I've got an array set up that loads photos into flash and places them in a grid (sort of). I want those photos to have outlines around them. So, i created an outline. Now, when i try to place it on all of the photos, it will run through them and only apply itself to the latest photo (one instance overwrites the others). How do i make multiples of the outline?

Posted: Feb 12, 2009 1:16 PM

View 1 Replies!   View Related
ActionScript 3.0 :: Creating Multiple Instances Of A Button With Dynamic Text
I'd like to create a Hangman game, only instead of having the player enter a letter, I'd like to have 26 clickable buttons on the screen. Now, I could make 26 symbols, but that seems ridiculous when I could create a class and just create 26 instances of letter_button, where I can just do something like letter_button.letter_id to get the value. That part's easy. The hard part is, uh. Well. 1- How do I create a button that will accept dynamic text? How do I add these buttons to the stage? Will parent.addChild(new letter_button(letter)) work? Or do I need something else?

Here's how far I've gotten in my solution, tell me if I'm barking up the wrong tree. To begin, I created a button called "Letter_Button". It has a text field on it called "letter_text". It's a MovieClip and it links to


Posted: 06-28-2011, 06:14 AM

View 3 Replies!   View Related
ActionScript 3.0 :: Flash - Creating Multiple Instances Of Code Generated Mc?
I need to generate multiple instances of a code generated movieclip. If I try:

var mc:MovieClip = new MovieClip();
var n:mc = new mc();


Posted: May 15th, 2010

View 4 Replies!   View Related
ActionScript 2.0 :: Error : Frame=1: Line 5: Clip Events Are Permitted Only For Movie Clip Instances?
i've tried placing the code in the actions pnel of the mc; on the mc at the main time line and in various other unspeakable places... but i always get the same error warning me that this code can only be used in movieclip instances and that my stupidity levels are reaching dangerous levels. (error: 'Symbol=stage_mc, Layer=actions, Frame=1: Line 5: Clip events are permitted only for movie clip instances


i fear somebody will reply to this with:'the code goes on the movieclip instance' which point i will take up a career in knitting (i knew i shouldn't have given up the course in the first place)

Posted: June 8th, 2002

View 12 Replies!   View Related
ActionScript 2.0 :: Clip Events Are Permitted Only For Movie Clip Instances?
clip events are permitted only for movie clip instances onClipEvent(enterFrame) {

i keep getting this output message --- can't figure out what it means.

Posted: September 8th, 2005

View 1 Replies!   View Related
ActionScript 2.0 :: User Adjustable Font Size In A Flash Movie?
how to make text in a flash movie that can be resized by the user? I see that this is possible in an HTML website and I'd like to have that option in a flash website I am making

Posted: April 24th, 2008

View 11 Replies!   View Related
ActionScript 3.0 :: Reference Instances From Movie Clips If The Movie Clip Referencing From Is Nested?
It's me again and I'm running into a problem. So, I have this movie clip that is nested inside multiple movie clips. I want to tell Flash to perform an action when that movie clip hits another movie clip in the main timeline. It's just collision detection for a game using the hitTestObject code. I was thinking of using MovieClip(root), but that won't work since it's nested so much.

Posted: Mar 23, 2010 10:00 PM

View 15 Replies!   View Related
ActionScript 2.0 :: Add Multiple Instances Of A Loaded Movie?
I have a placeholderMC and then two instances of that placeholderMC (both with different instance names) in a containerMC. This containerMC is then animated using tweens, not actionscript.

I need to be able to load a JPG, PNG or SWF file using AS2 into the placeholder from a server. At present, loading the movie requires a specific target path which will only load the movie into the one instance. Is there some way I can load the movie into the placeholder without being as explicit in the path, such that it will be loaded into BOTH instances of the placeholderMC in the containerMC?

In laymans terms... I am loading a graphic and using the second instance as a drop shadow reflection under the first. The reflection has a different instance name so that I can cacheAsBitmap and use a gradient on it as a mask at runtime, it is also flipped vertically, so that like a reflection it is upside down.

The other problem I am experiencing is that when the containerMC is removed from the stage during the animation, the movie is unloaded as well and needs to be reloaded if i require the containerMC again. Is there anyway around this or is that native behaviour to flash. Ideally I would like to only have to load the Placeholder images once at the start of the file and then have them available for use as and when they are needed throughout the movie... does this require them to be on the stage the entire time?

Posted: 02-04-2009, 05:39 AM

View 1 Replies!   View Related
ActionScript 2.0 :: Create Multiple Movie Instances?
I'm running into a roadblock with creating multiple instances of a movie clip. I'm trying to display a series of boxes across the bottom of the stage. The number of boxes are determined by _global.maxStep[_global.sectionNum]. I have a movie clip called StepBox that will serve as the template for each box. In the StepBox movie clip is a dynamic text box called stepNumText, which I want to set to the value of the counter. The problem I have is that I've only ever used attachMovie, but there is no movie for it to attach to. I tried using Content since that's the name of the layer this is in, but I know that doesn't make sense (and it doesn't work).

_global.updateBoxes = function() {
var curr_box;
for (i = 1; i <= _global.maxStep[_global.sectionNum]; i++) {[code].....

Posted: February 18th, 2006

View 3 Replies!   View Related
IDE :: Multiple Instances Of Movie Class With Same Variable Name
I am creating multiple instances of a movie class with the same variable name. The movie is then added random on the stage with a tween. On a mouse handler click, i want to remove the movie from the stage.

I am getting error -
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:isplayObjectContainer/removeChild()
at Untitled_fla::MainTimeline/removeBlock()

import gs.TweenLite;
import flash.utils.*;
var block:block_mc;
var myTimer:Timer = new Timer(1000, 15);
[Code] .....

Posted: September 3rd, 2009

View 4 Replies!   View Related
Using Movie Clip Instances In FOR Loops?
if there is a way to use movie clip instances with FOR loops (yeh I'm not skilled with OOP so I premade mc's instead using loadMovie :for example I made manual SwapDepth function between movieclips, I have hero1_mc, hero2_mc,...,hero6_mc and enemy1_mc,..., enemy12_mc. The code looks something like this:


if (_root.hero1_mc._y > _root.hero2_mc._y) {
tempDepth1 = _root.hero1_mc.getDepth();
tempDepth2 = _root.hero2_mc.getDepth();[code].....

...and so on, code works fine but if I were to write all compares manually it will be thousand lines of code to check each movie clip with each other.So I was wondering is there any way to put those movie clip instances hero1_mc, hero2_mc... into FOR loop like (code doesn't work, if there could be a way to replace numbers with variables):


for (i=1; i<18; i++) {
for (j=1; j<18; j++) {
if ("_root.hero"+i+"_mc" > "_root.hero"+j+"_mc") {

so I don't have to type all combinations D: so far I haven't found any way to do so, is there any way to make something similar with FOR loop and movie clips? I'm working on my project with AS2.

Posted: December 4th, 2009, 11:33 AM

View 1 Replies!   View Related
ActionScript 3.0 :: Movie Clip Instances And Filters?
I have a movie clip that is simply a rectangle with no stroke color and a fill color of red. I applied a glow filter with a green color and it glows. So far so good. I pulled another instance of the same MC and changed the instance's color to blue by changing the tint. Then I applied the green glow filter but the glow is blue and not green!

I pulled another instance of the MC and changed the instance's color to yellow by adjusting the Advanced effect from the properties of this instance. Then I applied the green glow filter but the glow is yellow and not green! Somehow when I change the instance's color through tint or advanced the glow filter does not work as expected. What is the proper way to change a MC's instance color and apply a filter to it?

Posted: Feb 5, 2009 4:05 PM

View 1 Replies!   View Related
ActionScript 2.0 :: Different Functions For Different Instances Of Movie Clip?
I want different instances of the same movie clip to have different functions.

First movie clip:

That works!


doesn't become a clickable movie clip.

Yes, I have given it the appropriate instance name. The above is the only code I have added so do I need something else to get the second bit to work?

Posted: 05-31-2011, 12:41 PM

View 4 Replies!   View Related
ActionScript 3.0 :: Create Instances Of A Movie Clip?
For example if I wanted to do something like make a function which is used to spawn multiple instances of an enemy movie clip.[code]do this a specified number of times.How would I go about doing something like this? And what is the syntax for referring to these generated movie clips from outside of the movie clip (so i could do things like remove them, change x/y,alpha, ect, individually)I really just don't have an intuition for how movie clips actually work in actionscript, and its been holding me back a great deal.

Posted: 07-14-2011, 08:58 PM

View 1 Replies!   View Related
ActionScript 2.0 :: Instances Of The Same Movie Clip On The Stage?
I've got a couple instances of the same movie clip on the stage. Via actionscript, I want to apply a tween to both instances. Then, when you click on the instance I want its tween to stop, but not affect the other instance. Does that make sense?


Posted: August 4th, 2006

View 3 Replies!   View Related
ActionScript 2.0 :: Swap Instances In A Movie Clip?
What my team is trying to do right now is build a game. It is a game where the user can build their own bike from different parts, and then test it in other challenges.

Right now I'm at the stage where they are building the bike. The first thing I'm trying to set up, is allow the user to push 3 different buttons that will change the appearance of the tires. I have the bike on a movie clip, then the tires on another movie clip within that, and then three different types of tire movie clips within that tires clip (make sense? bike>tires>3 tire clips). So I think the easiest thing would be is to somehow script each button on the root frame to just swap out the instance of the tire (the three types are: thick, aerodynamic, and trick).

Posted: April 20th, 2007

View 3 Replies!   View Related
ActionScript 2.0 :: Same Movie Clip - Different Instances - GetURL
I have a movie clip named "restlink." I drag it to frame one on layer "link," and give it an instance name of "link1." At frame 100, I create a keyframe on "link" layer, and change the instance name to "link2." In frame one of the "actions" layer, I enter the following:


Posted: February 11th, 2010

View 5 Replies!   View Related
Actionscript 2.0 :: "Clip Events Are Permitted Only For Movie Clip Instances"

look at the 5th image, that is the script, when i do the publish it gives me this error "Clip events are permitted only for movie clip instances"

Posted: Tue Apr 28, 2009 3:24 am

View 9 Replies!   View Related
ActionScript 3.0 :: Adding Thousands Of Instances Of A Movie Clip?
I am trying to add around 20,000 instances of a single small movie clip (HexTile) from the library into a container Sprite using actionscript. The problem is it loads immediately and it loads very slowly, so I would like to know if there is a way to preload it? The class that adds the movie clip library symbol (World) is not the document class, nor is it referenced from the document class. I have tried dragging an empty sprite linked to World, and I have tried exporting it to other frames as well is preloading it as it's own .swf...

Posted: Sep 17, 2008 11:18 PM

View 2 Replies!   View Related
Copyright 2005-08, All rights reserved