Referencing of video clips on a class

Hello. I never ask for help, but this time I really need to do this since I can't find similar questions on the Internet.

I develop a hygrometer in Flash CS4. The hygrometer is currently a Clip on the stage with 16 video Clips on the inside with names of instance like segment01_mc, segment02_mc... segment16_mc. I'm doing a class for the hygrometer MC and I need to access the 'segment' of MC. But I can't find a solution.

Is it possible to reference the 'segment' video clips? How can I assign instance names to film clips "segment"?

Here is my current code of the hygrometer class:

package {}

Import fl.motion.Color;
Import fl.events.SliderEvent;
import flash.display.MovieClip;

Hygrometer/public class extends MovieClip {}
public void Hygrometer() {}
trace ("hygrometer created instance.");
}

public var hygrometerSegments:Array =]
This.segment01_mc, this.segment2_mc, this.segment3_mc, this.segment4_mc,
This.segment5_mc, this.segment6_mc, this.segment7_mc, this.segment8_mc,
This.segment9_mc, this.segment10_mc, this.segment11_mc, this.segment12_mc,
This.segment13_mc, this.segment14_mc, this.segment15_mc, this.segment16_mc
];

}
}

Here is a picture showing the structure of the hygrometer. The Green MC hygrometer and Red is the segment01_mc.

movieClipNames.PNG

Thanks in advance

are the children of segments of the hygrometer movieclip?

Tags: Adobe Animate

Similar Questions

  • Add video clips similar to the step of the Document class

    Hello

    How do you add multiple clips of video similar to the step of the Document class?

    For example, I have four clips of different movie called ball0_mc until ball3_mc.

    Also, how can I add each video clip at random points in the settings of the scene?

    I know it should be easy enough but still new for ACE all pointers would be greatly appreciated. See you soon.

    you add them by using their class name.  If they don't have a class name, give them a:

    var b0:ball0_mc = new ball0_mc();

    addChild (b0);

    B0.x = Math.Random () *(stage.stageWidth-B0.Width);

    B0.y = Math.Random () *(stage.stageHeight-Bo.Height);

    Similarly, for the other instances of the class you want to add.

  • How can I list the instances of video clips if the clip that I am referencing is nested?

    Hello world

    It's me again and I am running into a problem. So I have this clip which is nested in several video clips. I mean Flash to perform an action when this clip from movie hits another video clip in the main timeline. It's just a collision for a game detection using the hitTestObject code. I was thinking of using MovieClip (root), but that won't work because it is so nested. Can someone help me? I would like to know if I need to explain more. Thank you!

    -DJ

    I didn't ' think I can help you without having to upload your file to see what you're doing and I don't download and fix the files unless I'm hired.

    Maybe someone else you download your fla and you help.

  • Video clips play in reverse in AS 3.0

    Hey all. I change all my files in AS 3.0 because of a few new elements, I would like to use in flash CS4.
    Here: http://www.iaw-atlanta.com/IvyLeague1-13-09.html I have the bottom navigation menu with 4 buttons. When the buttons are speckled on they go up and when they are mottled the film plays in reverse so they go down. Essentially in the clip, I stopped him, and the next frame gotoAndStop when the button is wriggle on and then have a script of saying things reverse when wriggle on. I know how to do this in AS 2.0, but how can I translate the script to 3.0?

    DjPhantasy5,

    > Ok thanks, I'll see what he also has to say as well.

    In fact, NedWebs pretty much nailed. :) The approach you have taken
    is an interesting question, because it evolves all the way back to Flash Player 5.
    has not yet supported the MovieClip.onEnterFrame event. Without
    event, you need something like your "controller" - a separate symbol
    a loop of timeline - to run the code that depends on the loops of the frame.

    Available from Flash Player 6, this event allows you to
    consolidate your code a bit by putting everything in a unique setting and avoiding
    the additional movie clip symbol. This does not mean that your approach is wrong, by
    any stretching. In fact, it's good to know your options, because if you always
    need to publish for Flash Player 5, you had probably better to use the installation program
    you took.

    I'll demonstrate onEnterFrame in just a bit, in case you want to take a
    Watch this.

    > There is no mention of _root in AS3, but you can use a
    > MovieClip (this.parent) (which replaces what _parent)
    (> used to do) to find something outside the immediate
    > movieclip.

    The term "parent" in this context, is technically a property of the
    The class MovieClip, which means all the clips in AS3 have access to the
    feature 'parent', which points to the timeline that contains the video
    in question. Buttons have also a property 'parent '. In AS2,
    property has done exactly the same thing, only it was preceded by an underscore.

    In fact, the proposed codification of the NedWebs works the same in your existin file.
    Instead:

    Your existing code...
    If {(_root.animation._currentframe>1)}
    _root. Animation.prevFrame ();
    this.gotoAndPlay (2)
    }

    If (_root.animation._currentframe<=1)>
    this.gotoAndStop (1);
    }

    ... you can use this:

    Alternative code...
    If {(_parent.animation._currentframe>1)}
    _parent. Animation.prevFrame ();
    gotoAndPlay (2)
    }

    If (_parent.animation._currentframe<=1)>
    gotoAndStop (1);
    }

    ... because this range - in other words, from this point of view - this
    MovieClip._parent property points to the same scenario as _root done.
    That changes, of course, based on how deeply nested the current scope are.
    The word 'this' in the code above is optional, because Flash understand
    What place you are in. From the point of view of the present code, _parent is
    interpreted as referring to chronology parent of the current, just as scope
    gotoAndPlay() is interpreted to the timeline of the current scope.
    You might precede either of those of 'this' or not.

    Many people will say that _root is probably best to avoid, only because
    It's a slippery slope. It does not always refer to the main timeline you
    think he does, according to whether or not your file SWF is loaded in another
    SWF when running. Meanwhile, _parent * always * refers to the immediately
    relative chronology.

    Then, when you look at this way, this perfectly valid AS2:

    If {(_parent.animation._currentframe>1)}

    ... is not very different at all from its counterpart of the AS3:

    If (MovieClip (parent).animation.currentFrame > 1) {}

    It would be nicer if you need convert the parent as a reference
    Movie clip here, but if you haven't, AS3 do not realize that the scope in
    This is a clip.

    > You can string them along like...
    > MovieClip (this.parent.parent)

    Exactly.

    > Your _currentframe in becomes the controller
    > currentFrame. That's all. The rest of what I have
    > saw will fly as is.

    Not quite. AS3 does not support on() or onClipEvent(), functions
    you will not be able to reach your management code for the button. Instead,.
    you will have to put in a keyframe - you can also do with AS2. There
    a good idea, anyway, because it allows to put all your code in a
    place, making it easier to find.

    Here's a quick word on the direct attachment:

    http://www.quip.net/blog/2006/Flash/museum-pieces-on-and-onClipEvent

    To convert your existing AS3 FLA structure, you could, for example.
    follow these steps:

    animation.buttonMode = true;
    animation.addEventListener (MouseEvent.ROLL_OUT, outHandler);
    animation.addEventListener (MouseEvent.ROLL_OVER, overHandler);

    function outHandler(evt:MouseEvent):void {}
    controller.gotoAndPlay (2);
    };
    function overHandler(evt:MouseEvent):void {}
    controller.gotoAndPlay (4);
    };

    That supports the code on (rollout) and executed in your current
    Version. The first line (buttonMode) is necessary because I got rid of
    the symbol button and, instead, handlers directly associated with
    your movie clip. (Video clips manage events of type button, too, if you)
    do not need the button.) In AS3, event handling is very simple:
    you are referencing the object (here, animation), invoke its hereditary
    addEventListener() method, then passes two parameters: a) the event to
    Listening and (b) the function to execute when the event occurs.

    You can see that noted above. In AS2, there are several ways
    to handle events, including one () /onClipEvent (), so it is harder to know when
    to use what approach. For the buttons and video clips, the principle works the
    same I just showed, but the syntax is different.

    Let's take a look to reduce all this code using the
    onEnterFrame event. First of all, check out this AS2 version:

    animation.onRollOut = outHandler;
    animation.onRollOver = overHandler;

    function outHandler (): Void {}
    this.onEnterFrame = reversePlay;
    };
    function overHandler (): Void {}
    this.onEnterFrame = null;
    This.Play ();
    };
    function reversePlay (): Void {}
    this.prevFrame ();
    };

    This code would appear in box 1. You don't need the controller
    video clip. The movie clip contains more an orb button, because
    We use the animation itself as the 'button '. (You can still see what)
    a feature that any object is looking toward the top of its class. If you are dealing
    with a clip, see the MovieClip class. See the position properties
    to find out what features of the object, see methods to know
    what the object can do and see events to find out what the object can respond
    (to).

    In the code above, it is prepared quite easily. It is AS2,
    don't forget. We have two events, we are listening to: MovieClip.onRollOut and
    MovieClip.onRollOver. these events are set up for the animated film
    clip using the name of the instance and associated to custom match
    functions. The outHandler() function associates a different function to the
    MovieClip.onEnterFrame event of the animation clip. Very simply, it
    load of animation to make the custom function reversePlay() whenever
    He meets an onEnterFrame event. The overHandler() function that kills the
    Association of suppression outside and saying animation to play, via the
    MovieClip.play () method. Finally, the reversePlay() function simply calls
    MovieClip.prevFrame () on the movie clip.

    Here's the AS3 version:

    animation.buttonMode = true;
    animation.addEventListener (MouseEvent.ROLL_OUT, outHandler);
    animation.addEventListener (MouseEvent.ROLL_OVER, overHandler);

    function outHandler(evt:MouseEvent):void {}
    animation.addEventListener (Event.ENTER_FRAME, reversePlay);
    };
    function overHandler(evt:MouseEvent):void {}
    animation.removeEventListener (Event.ENTER_FRAME, reversePlay);
    Animation.Play ();
    };
    function reversePlay(evt:Event):void {}
    evt.target.prevFrame ();
    };

    It seems wordier, but if you look closely, you will see that there
    essentially the same thing. The main difference is the scope of operation in
    AS3. In AS2, there are many references to "it", because the event
    Manager operating in the same scope as the object to which the
    Association is formed. In AS3, the references are not to "that", but rather to
    the same movie clip by his * name *, because in AS3, the scope
    works in the same scenario in which the code is displayed (IE, in this)
    case, the main timeline).

    In the function reversePlay(), in order to emulate a 'this' kind of
    the installer, I refer to the parameter that is passed to the event handler all the
    functions in AS3. I happened to name "TTE" (for the event), but you can call
    it what you like. In the case of reversePlay(), the evt parameter refers to
    an instance of the event class, which has a property to target. The target
    property refers to the object that sent the event - is be
    animation, in this case. Then evt.target, in this context, refers to
    animation, that's what I call the MovieClip.prevFrame () method on.

    I downloaded some FLA files to my server. I keep them
    it for always... maybe a few weeks, from this post:

    http://www.quip.NET/RewindTestAS3.fla
    http://www.quip.NET/RewindTestAS3_new.fla
    http://www.quip.NET/RewindTestAS2_new.fla

    David Stiller
    Co-author, ActionScript 3.0 quick reference Guide
    http://tinyurl.com/2s28a5
    "Luck is the residue of good design."

  • Video clip of Drag AND change of cursor

    Is there another way to change the icon of the other than for startDrag/hidecursor use cursor? I have a SWF that uses stopDrags to another clip, and of course every time that the script stopDrag is called following the judgment of the cursor. Any ideas?

    bcmpro,

    > Is there another method of changing the cursor icon
    > other than using startDrag/hidecursor?

    Sure thing. It, just put the cursor x and is coordinated at
    the mouse on a kind of rehearsal loop, like MovieClip.onEnterFrame
    or setInterval() in ActionScript 2.0 or Event.ENTER_FRAME or the Timer class
    in ActionScript 3.0.

    > I have a SWF that uses stopDrags to another clip,.
    > and of course whenever the script stopDrag is called the
    > cursor stops after. Any ideas?

    Included; makes perfect sense. Here's a short article that shows my
    above the suggestion in a slightly different way. It is certainly more complex
    that you're asking for, but the same mechanism applies.

    http://www.quip.net/blog/2006/Flash/ActionScript-20/how-to-constrain-circle

    In this article, the loop of 'slide' is based on the
    MovieClip.onMouseMove events in ActionScript 2.0. The article goes into some
    detail explaining the process, but here is a quick example. What follows
    assumes that your video clip of "cursor" contains the instance name mcCursor.

    mcCursor.onEnterFrame = function (): Void {}
    This ._x = _root._xmouse;
    This ._y = _root._ymouse;
    }

    It's a simple MovieClip.onEnterFrame approach. A function is affected
    in the event the mcCursor clip MovieClip.onEnterFrame. The
    function sets the MovieClip._x and MovieClip._y of this clip properties
    in the corresponding properties of mouse from the main timeline. The main
    timeline (here referenced by _root) is, in fact, a clip, that's why
    a reference to it is supported by the properties of the MovieClip class.

    The previous example is as good as your framerate. In
    low-framerate movies, the "cursor" will be a little jitter. The setInterval()
    approach could better meet your needs, since setInterval() allows the
    function updateAfterEvent(), which updates the screen immediately, rather
    Once each image:

    setInterval)
    function (): Void {}
    mcCursor._x = _root._xmouse;
    mcCursor._y = _root._ymouse;
    updateAfterEvent();
    }, 33
    );

    The setInterval() function takes two parameters: a) a function of
    repetition and (b) the period of time in which to repeat (in this case, 33
    milliseconds).

    setInterval (functionToPerform, whenToPerform);

    In the light of the foregoing, the housing looks:

    function (): Void {}
    mcCursor._x = _root._xmouse;
    mcCursor._y = _root._ymouse;
    updateAfterEvent();
    }

    ... While the slot gets 33.

    David Stiller
    Co-author, Foundation Flash CS3 for designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

  • How to stop the code that adds video clips

    Hello

    I have a code simply adding video clips. Video clips are on the same time move along the stage.

    The first clip is already on the scene and the code should add three more. Clips of three film set with the instructions if are added correctly (for positions origX and origY).

    But after adding the three, he keeps adding them. And not at all defined first x and y, but x = 0 and y = 0.

    How can I stop it after you add the three?

    The code is in a separate class file.

    Thanks in advance!

    Duck/public class extends MovieClip

    {

    var origX: number;

    var origY: number;

    var i: int;

    var newDuck: party;

    public void Duck()

    {

    origX = this.x;

    origY = this.y;

    this.addEventListener (Event.ENTER_FRAME, moveDuck);

    }

    function moveDuck(event: Event): void

    {

    This.x += 0.25;

    If (this.x is origX + 50)

    {

    addDuck();

    }

    If (this.x is origX + 75)

    {

    addDuck();

    }

    If (this.x is origX + 100)

    {

    addDuck();

    }

    }

    function addDuck(): void

    {

    newDuck = new part();

    parent.addChild (newDuck);

    newDuck.scaleX = 0.55;

    newDuck.scaleY = newDuck.scaleX;

    newDuck.x = origX;

    newDuck.y = origY;

    }

    }

    You operate Duck() instanciates an enterFrame function that actually creates instances the duck on the scene. Once started, there is nothing to say things to stop creating new ducks. You can add a loop for which counts the number of ducks you want and then kills the enterframe function. I don't know why your x and y values are reset to 0.

  • Video clips fade

    Hello

    I have a bunch of clips in a picture. This table is in a loop by a timer.

    Chaque.5 of a second of the clips in the table is marked on the stage. Now, I need each fade gradually and also to make them walk across the stage.

    I used code snippets to try to write a fade in function, but the problem is that the heap fade at the same rate (for example, the first clip that apeared on stage would have the same alpha as the seconds 03:06)

    How can I change the code below so that each video clip could fade will benefit of its interventions at once (individually rather than the entire table) would start fading in only when it is placed on the stage.

    Here is my code so far:

    private var lettersL1:Array = [, the, f, f, f, g, h, i, i, n, n, n, o, o, o, o, s, s, t, t, t].

    lettersL1 [index] .addEventListener (Event.ENTER_FRAME, fl_FadeSymbolIn);

    function fl_FadeSymbolIn(event:Event)

    {

    lettersL1 [index] .alpha += 0.01;  lettersL1 is the name of the table

    If (lettersL1 .alpha [index] > = 1).

    {

    lettersL1 [index] .removeEventListener (Event.ENTER_FRAME, fl_FadeSymbolIn);

    }

    }

    addChild (lettersL1 [index]);

    Thank you

    Images of recommended

    Without seeing the rest of the code, it is one, but difficult to find certain aspects.  Why this table shows the objects is a question that I can't get my head around.  I don't know if the ENTER_FRAME is out of control in the way that you have to be implemented.  The function uses the value of index is another as the index value will change with your loop, not with every object in it.

    I suggest you try a different approach and examine using the Tween class to fade and move objects.  You can assign an interpolation for each and you do not need to have all kinds of ENTER_FRAME listeners getting assigned

  • Make a new instance of a symbol existing (video clip or graphic) using AS3

    I want to make a new instance of an existing design (video clip or graphic) when an object hits the side of the stage. I have the code to see if he hit the side of the stage, I just need to know how to make a new instance and bring up where the head-butted. I also want to be able to have several of these instances on the screen. Thank you in advance, I'm sure it's a fundamental thing, I'm just really new to Flash, then Yes.

    First create the symbol as a movieclip.  Then right click on the object in the library and select the link option.  In the Panel that opens select the export for actionscript option and then assign a class name for the symbol... say you name ImageMC (caps are usually used to begin class names).  Flash will provide an indication that he cannot find a class and it will create a when you compile.

    To add a new instance of the symbol to the stage you use...

    var imgMC:ImageMC = new ImageMC();

    imgMC.x =? ;

    imgMC.y =? ;

    addChild (imgMC);

    where x and y values (?) will be established based on all the information available to you about where the ball was when he hit the wall.

  • Permutation of position of list view for dynamic video clips

    Hi all

    I have a question that is difficult to explain. I have a class file that loads an external XML file, analyzes the main nodes in an array, and then creates a movie clip instance for each of the nodes, the text inside the movie clip based instance fields on the child nodes in the XML file.

    Each added movie clip instance dynamically has a built in clip that acts as a tab. I have update the dynamic text of this integrated clip, based on the name of each main XML node.

    Now, where I'm stuck, it's that I have attached an event listener to each clip tab which is created dynamically within the video clip. I want to do is when the user clicks on this tab have this movie clip will move to the top of the list of display on all other dynamically created movie clips. My problem is that I don't know how to get correct references.

    When I create movie clips dynamically I store objects in a table. The problem seems to be that the event is triggered for a clip inside the dynamic clip so I don't know how to reference the clip parent. Maybe it's something else, but I don't know how to refer to the main movie clips that I want to switch.

    I hope that makes sense. My main question is how can I use the swapChildren or setChild functions when you click the clip is in the clip I want to change in the display list as well as the fact that this clip is created dynamically.

    Any help or advice would be appreciated!

    Here is my code:

    {classes package

    flash.xml import. *;
    import flash.display. *;
    import flash.events. *;
    flash.net import. *;
    import flash.utils. *;
    import flash.text. *;

    public class estimatesheet extends Sprite {}

    public var allEstimateSheets:Array = new Array();
    public var allEstimateSheetsMC:Array = new Array();
    public var textFields:Array = new Array();
    public var startX:int = 5;
    public var startY: int = 5;
    public var field_increment:int = 15;
    public var bg_increment:int = 50;
    public var selected_tab:int = 0;

    public void estimatesheet (file:String) {}

    xmlLoader (file);

    }

    public void xmlLoader (file:String) {}
    var loader: URLLoader = new URLLoader();
    loader.dataFormat = URLLoaderDataFormat.TEXT;
    loader.addEventListener (Event.COMPLETE, handleComplete);
    Loader.Load (new URLRequest (file));
    }

    public void handleComplete(event:Event) {}
    try {}
    var allXml = new XML (event.target.data);

    addChild (container);

    Store each node parent to estimate leaf in the table
    for (var i = 0; i < allXml.children () .length (); i ++) {}
    allEstimateSheets.push (allXml.children ([i]));
    createSheet (allEstimateSheets [i], i);
    }

    } catch {(e:TypeError)}
    trace ("cannot parse for XML");
    trace (e.message);
    }
    }

    Create a timesheet for each node in the XML file
    public void createSheet (data: XML, sheet: int) {}

    Duplicate the clip estimateSheet for each node in the XML file
    var estimateSheetBg:EstimateSheet = new EstimateSheet();
    estimateSheetBg.x = 0;
    estimateSheetBg.y = 0;
    addChild (estimateSheetBg);
    allEstimateSheetsMC.push (estimateSheetBg);
    trace ("the sheet name:" + data.@name);
    allEstimateSheetsMC [plug].bg.tab.tab_name.text = data.@name;
    allEstimateSheetsMC (factsheet).bg.tab.addEventListener (MouseEvent.CLICK, tabClick);


    For each sheet in the first estimate sheets move the tab down
    if(Sheet>0) {}
    allEstimateSheetsMC (factsheet).bg.tab.y += 25;
    }

    Analyze the XML child nodes
    for (var i = 0; i < data.children () .length (); i ++) {}

    Create dynamic text fields
    var textFormat:TextFormat = new TextFormat ("Verdana", 11);
    var textField:TextField = new TextField();
    textField.setTextFormat (textFormat);
    textField.text = data.child (i) .@label;
    textField.border = false;

    textField.x = startX;
    textField.y = startY + field_increment;

    startY = startY + field_increment;

    allEstimateSheetsMC [sheet] .addChild (textField);

    textFields.push (textField);

    }

    }

    public void tabClick(event:MouseEvent):void {}

    This function to share footage, essentially taking the selected_tab and exchange it with the one that was clicked
    trace ("what is it?" + this.parent.name);

    container.swapChildren (allEstimateSheetsMC [selected_tab], this.parent);


    }

    }

    }

    "this" trace and see what it gives you...

    The "event.currentTarget" will identify the object with the event listener are entrusted to him.

    Try tracing...

    trace (this, event.currentTarget);

    and see if they look like the same object.

  • Collision detection / video clip after another

    I'm working on a shooting game space horizontal scrolling, and I hit a snag: the clip of rocket has two nested layers, for the ship itself and the other for a cycle of animation of the flames out by behind.  The ship loses health when it collides with an enemy ship, but given that the two bodies of the ship and the flames are part of the same clip, the ship, of course, also loses health when the flames hit an enemy ship.  What I'm trying to do, is change it so the fire will destroy the enemy ships, but the player loses all health.  My first inclination was to separate the flames in their own clip and simply attach the ship - that is to say, the clip of flames is basically apparent aboard the ship, on a layer below, but is controlled by a separate script as the ship itself.  The flames would be aligned with the ship, and when the ship is moving, the flames are moving.  Pretty simple.  So far, I have found no effective way to do this.  I tried alternatives (masking, etc, etc) nothing works.  I work in Flash 8, AS2.  Each video clip has its own class.  I can view the code if necessary.  Any advice, or simply a point in the right direction would be greatly appreciated.  Thank you!

    use:

    }
    If (this.hitTest (_root.ship.shipBody))
    {
    If (_root. Ship.Shield._visible is false)
    {
    _root. Ship.updateHealth (-20);
    }
    explode();
    }

    If (this.) HitTest (_root. Ship.shipFlames) {/ / assuming shipFlames is correct}

    explode();  Assuming you want the enemy to the discovery of the touch of flame

    }

  • Spawning of video Clips do not work in AS2

    Hello

    I did a preloader, and to make the bar appears sooner during the loading process, I made each video clip except the preloader files have "export in first frame disabled." Since I did it, my game no longer video clips. I had the enemy units encountered randomly the screen, and now nothing appears at all. What will solve it? If you need him. FLA or a screenshot, please let me know.

    MrA615.

    Click on file/publish settings/flash/at side of your actionscript code, combobox click settings.  There's a textinput for you enter the base to load classes.

  • Video Clips video clips

    OK, I ran into this so I guess I do not understand some foundation for the operation of AS3.

    So, I have a clip in the library (ClipA) - it is related to a class.

    A clamp inside there are 3 other video Clips (SubClip1, SubClip2, SubClip3).

    When I place ClipA onstage, I want to adjust the image each of the subelements are on.

    BUT, when I try to put an image in the ClipA class file I get an error like this:

    1061: call to a Stop method maybe not defined through a reference with static type flash.display:DisplayObject.

    If I do something like that, it works:

    this.getChildByName("SubClip1").x = 10;

    But this custom:

    this.getChildByName("SubClip1").gotoAndStop (10);

    What I don't understand? Why can't I adjust subclips?

    See if the following will work...

    MovieClip (getChildByName ("SubClip1")) .gotoAndStop (10);

  • video clip double

    Hi, here's the deal. I asked an equivalent of 'double movie clip' a long time ago, but I didn't use it if I knew that I was going to use it in the future. the answer I had at the time didn't work, I tried something else that I found in another forum, here is what I tried:

    Create a new empty flash project.

    in this regard, at firt I imported a bitmap into the stadium and after the converted video clip, called "model".

    what I believe should happen is that a duplicate of the clip should appear (0, 0). didn't work the first way so I tried the second way, I found in another forum. It's all the code in the movie:

    /*
    var classObj: Object = getDefinitionByName (getQualifiedClassName (this.template));

    var newClassObj = new (classObj);

    newClassObj.x = 150;
    newClassObj.y = 150;

    this.addChild (newClassObj);
    */


    var targetClass: Class = the object (model) .constructor;
    var duplicate: DisplayObject = new targetClass();

    duplicate. Visible = true;
    duplicate.x = 0;
    duplicate.y = 0;
    addChild (duplicate);

    things to / * / are first of all passing I got as an answer some time ago, things outside of the comments regarding the new way that I found in another forum. as I said before this should show onstage a duplicate of 'template', if it worked as planned. but he did not in all cases. any poinetrs? I also tried with a doodle instead fo a bitmap with the same result

    If you want to manually add the movieclip on the stage, you can simply assign a class id via the link option for the symbol (similar to the assignment of linkage of AS2 attachMovie) and just create a new instance of it. If you give a class id of MyTemplate, then all you need to do is to use

    var duplicate: MyTemplate = new MyTemplate();

    addChild (duplicate);

  • Dynamically place video clip on the corner and the overall position with a mouse click (button) that is always running.

    Anyone know the code to find the global positioning of the coordinates X and Y of a click of a button which turns constantly,
    then the code when you click the button, it displays a clip on the top-(position de x et y lorsque vous cliquez dessus) to the angle that you clicked (so the buttons are always rotating so others can click on them where they are)

    to explain the context, I am designing a model to the top of an interactive round table
    When someone approaches her and click on one of the buttons that move, it reads where the person has clicked on it and open a new box (video clip) where they have clicked on it (on the corner) so is not backwards if you're upstairs.

    I have included my .fla file that shows the four navigation buttons and a small diagram
    explain what I'm trying to do.

    you don't have a class named MethodAnimalMC.

  • Noob help: release of video Clips with buttons

    Hi guys,.

    I take an intro Flash and Action Script and for my last class, I need to create a portfolio that contains 5 unique buttons that trigger the 5 unique video clips. I have a hard time with this. I've been able to trigger the 1st clip with the first button (although I can't stop), but I can not trigger all the other films with any other button.

    Here is my code:

    Stop();
    chuck1_btn.addEventListener (MouseEvent.CLICK, regarderMovie);

    function playMovie(event:MouseEvent):void

    {
    spaceship_mc. Play();
    }

    chuck2_btn.addEventListener (MouseEvent.Click, playSaucers);


    function playSaucers(event:MouseEvent):void
    {
    saucers_mc. Play();
    }

    Nothing happens when I click on chuck2_btn when I test the movie. I think I need to create a variable or a class, but I'm not sure. I am a super noob with this stuff. Any thoughts? Thank you!

    Rick

    You should learn how to use the help documentation to find answers as how to use the visible property.  For the code you have shown earlier, here is what you can try setting 1 to replace.

    Stop();

    spaceship_mc. Visible = false;

    saucers_mc. Visible = false;

    slideshow_mc. Visible = false;

    chuck1_btn.addEventListener (MouseEvent.CLICK, regarderMovie);

    function playMovie(event:MouseEvent):void

    {

    spaceship_mc. Visible = true;

    saucers_mc. Visible = false;

    slideshow_mc. Visible = false;
    spaceship_mc. Play();
    }

    chuck2_btn.addEventListener (MouseEvent.Click, playSaucers);

    function playSaucers(event:MouseEvent):void
    {

    spaceship_mc. Visible = false;

    saucers_mc. Visible = true;

    slideshow_mc. Visible = false;
    saucers_mc. Play();
    }

    etc...

    It could be refined, as with a function that hides everything and use it every time before you do that you want to show visible.  You may find it necessary to include saying the films of gotoAndStop (1) as well.

    It's about as generous as I'll get.  It is important that you learn things, and give you a solution won't help to do so.

Maybe you are looking for