Referencing duplicated movie clips

I am using the following script to duplicate the movie clips
pixel.duplicateMovieClip("pixel"+i,
this.getNextHighestDepth(), {_x
, _y:m});
how can I get the x and y values for the duplicated clips, I
tried assigning a text box with variable xget an d wrote the
script:
xget = pixel+i._x
how should I be scripting this?

you could do something like:
xget = eval("pixel" + i +"._x");
-or-
xget = this["pixel" + i]._x;
Either one could work...

Similar Messages

  • How to detect  collssion for random or Duplicated movie clips

    Hey guys .. i am back with set of query..till now .. key
    press movement a rocket (mc) is moving left right up down in a
    defined stage area. and i am able to generate some fire balls
    randomize falling from top. this is just i am duplicating the movie
    clip(fireball_mc) .... now i want incase or when the rocket (mc)
    touch the fire ball programm shold detect the collsion and generate
    a score board. well for this i have tried a script for two movie
    clips ... wchich is working but ..i don know or i m not gettng the
    logic how to detect the collission for duplicated movie clips...
    well i m just giving the script for oinly 2 movie clips
    coliding...can any one tell me how to do it with randmize or
    duplkicated mcs??
    for 2 movie clip ...
    _root.mc1.onEnterFrame = function() {
    if(this.hitTest(_root.egg)) {
    _root.result="Oh no..... we are dead";
    } else {
    _root.result="we are going fine";
    (this is happening ..but let me know how can i get the same
    result for ranndom mcs)
    hope someone can help me out ...
    i appriciate ur valuable time to read this..
    thanking you

    Hey thx for ur suggestion...but as i said m very much new to
    actionscript (more designer) so i don have much idea... most of the
    things i m doing for this game i m going through lots of references
    then i tried to understand te codes m implmenting them to my
    need..can u explain me little more about arrays u haves asked for
    loops u asked me to use the hittest function..please /.. i will be
    greatfull to u... thx

  • Accessing an Array in a duplicated movie clip

    I have a movie clip that has a script declaration of:
    var myCGroup:Array = Array();
    in the first frame.
    (I've also tried var myCGroup:Array; var myCGroup:Array = new
    Array(); and var myCGroup:Array = []; )
    I duplicate this movie clip multiple times. I'm having
    trouble targeting the variable myCGroup from elsewhere in the
    timeline. Other non-array variables that are declared in the same
    place are fully accessible.
    The only code I've been able to write that writes to this
    variable is:
    eval(targetThumb).myCGroup = prodFlush[2].childNodes;
    which actually takes the childnodes and creates an array with
    them.
    However, reading them back out from a separate function later
    is impossible:
    trace("colors to target =====" +
    eval(masterProds[sm]).myCGroup);
    returns nothing. I can read and write to other variables from
    the same function using the same targeting.
    (yes, materProds[sm] == targetThumb)
    Also, the following code results in an undefined array:
    // for(cg=0;cg<cGroupArray.length;cg++){
    eval(targetThumb).myCGroup.push(cGroupArray[cg].firstChild.nodeValue);
    // trace("time: " + cg + " || adding this color group " +
    cGroupArray[cg].firstChild.nodeValue + " to product: "+ targetThumb
    + "===== " + eval(targetThumb).myCGroup)
    Is this a bug, or a documented local vs. global variable
    option that I'm unaware about regarding arrays?
    Any other thoughts? I'm at my wits end.
    Thanks in advance.
    -r

    question[i] =  questionSet.getString(i);Try:
    question[i] =  questionSet.getString(1);Or better still:
    question[i] =  questionSet.getString("QUESTION");or "ANSWER" for the anser record set.
    ResultSet.getString(int) looks up the value in a column (starting at index 1) in a result set.
    getString(String) looks up the value in a column by column name.

  • Referencing a movie clip by using a variable

    I have been using this line of code to fade in a movie clip:
    new Tween(background_mc, "_alpha", None.easeNone, 0, 100, .5, true);
    Now, I want to accomplish the same thing, only this time by using an element from an array (bg_array[currentSlideNumber]) that stores the instance name "background_mc"
    I've tried the following, but it doesn't work:
    new Tween(bg_array[currentSlideNumber], "_alpha", None.easeNone, 0, 100, .5, true);
    What am I doing wrong?
    Thanks

    You are telling flash to look inside that array and tween the _alpha property of the string -- because instance names are strings -- "background_mc" from 0 to 100. But generally speaking a string doesn't have an _alpha property.
    What you really want to do is tell flash, look inside this array find the string then use that string to look inside another array -- the array of all objects on some timeline -- to find a clip and then tween its _alpha property. That sounds like a lot, but it only adds a little bit to your code.
    new Tween(this[bg_array[currentSlideNumber]], "_alpha", None.easeNone, 0, 100, .5, true);
    I'm assuming the code is on the same timeline as background_mc?
    Annother approach would be to store instance references instead of the names. I'm not sure how you are creating the background, but instead of putting the name into the array, put a reference. So if you were using attachMovie you could do something like this.
    var bg_array:Array=new Array()
    var tempVar:MovieClip=this.attachMovie("background","background_mc",100);
    bg_array.push(tempVar);
    Finally, and not to anything you've asked about, but don't you find the suffixes annoying? Why, bg_array and background_mc? If you type your variables you will still get code completion and you will have less to type and your code won't be so long. I just find that having to type those underscores and all makes me likely to make mistakes and makes it much harder to read the code. Just a thought.

  • Duplicating Movie Clips

    Hello,
    I this is probably a very simple thing to do but I cant find
    anything which seems to a duplicate movie clip and maybe this
    function has been completely removed and not recreated at all
    within the new AS3 where it was available in AS2.
    I am wondering if someone can help me with this.
    I have attached a snippet of my code below which defines what
    I am attempting, any help would be appreciated.
    Basically all I want to do is duplicate a movieclip in a for
    loop and have them placed side by side with each other.
    Here is my code:
    for (i=0; i<10; i++)
    addChild (_brick);
    _brick.x = brick.width * i;
    Many thanks in advance
    Lee

    Lee,
    You have to assign each new brick to an instance, then add
    that child to the stage. There may be a more proper coding way to
    do it, but based on your code, you would need to turn on linking of
    your brick movie clip and make sure it's named "_brick". Then, this
    should work.
    for (var i=0; i<10; i++) {
    var myBrick = new _brick();
    addChild(myBrick);
    myBrick.x = myBrick.width * i;
    }

  • Duplicating Movie clips:  Can't access duplicate's children

    This code had been working when I was using flex 3, but now with framework 4.1 I can't get this to work:
    var TargetClass:Class;
    var instance:MovieClip;
    var rv:TextField;
    TargetClass =  Object(baseSwf_mc.getChildByName(instanceName)).constructor;
    instance = new TargetClass();
    instance.x = baseSwf_mc.getChildByName(instanceName).x;
    instance.y = baseSwf_mc.getChildByName(instanceName).y;
    rv = TextField(instance.getChildByName("word"));
    rv.autoSize = TextFieldAutoSize.LEFT;  //on this line I get a null object reference error.  rv is undefined.
    when I debug, instance has 0 children, though the movieClip referred to by "baseSwf_mc.getChildByName(instanceName)" definatly has a child TextField with the instance name "word".  Any ideas why this wouldn't be working any more?
    Dan

    Yeah, there are many trailer links within iTunes that I still can't access and it's been months. Star Trek from Paramount is one example.
    The only way I can get around it is to see if trailers.apple.com has it and download it that way.
    I hope they fix it soon or hope that they are even aware of the problem ...

  • Dynamic text in looping movie clip

    Hi,
    I am looping a movie clip which has a dynamic text box. I
    need to call data from XML and place the same in the Dynamic text
    box as per the duplicated movie clip. how do i do that.
    Thanks,
    Ayush

    on (release) {
    _parent.frontFields.topTextArch.ph2TopTextBrush._visible =
    false;
    That is the script attached to my button. I can see the text
    flash for a second when I push the button but it does'nt go away
    because the looping movie clip just continually goes back to the
    first frame and makes the ph2TopTextBrush text field visible again.
    I think I know what your saying. Your saying to attach a
    script to the first frame of the looping movie clip that would
    check to see which of the 3 dynamic text fields are visible. That
    would be perfect but I'm not sure how to do it.
    What would the script that I place on my button look like?
    What would the script in the first frame of the looping movie clip
    look like?

  • Referencing HTML page from within a movie clip

    Hi
    Hope someone can help with this.
    I have a simple horizontal scrolling gallery of 24 thumbnails
    in Flash, the thumbnail images are loaded into the boxes using
    actionscript. I would like each thumbnail to link to a html page of
    my choice. There is a movie clip instance called panel with the 24
    buttons inside it and on the first button as a test I've placed the
    following action script:
    on (release) {
    getURL("team.html","_self");
    When testing this movie from within Flash (CTRL, ENT) the
    button links to the html file (which is in the same folder as the
    SWF) with no problem. The problem is when I preview the page in a
    browser and try to click on the first button nothing is happening.
    I've tried it in both IE7 and Firefox with the same result.
    The flash thumbnail clip is placed as a flash object into a
    html page using dreamweaver.
    I'm sure this is something simple such as navigating the
    timeline but I've tried a few things like _root. but still no joy.
    Hope someone can help.
    Thanks, Jo

    Try
    on (release) {
    getURL("
    http://site.com/team.html","_self");
    }

  • Referencing movie clips

    Help me, I'm completely stuck.
    All I want to do is make a button when pressed, change the
    frame of another movie clip at the same hierarchy as it (the button
    and clip have the same parent clip).
    I've tried this and it doesn't work:
    _parent.pdf2.gotoAndPlay(2);
    pdf2 is the name of the clip I want to change.
    Any help is apprecieated.

    if your button is on the same timeline as pdf2 use:

  • How to _root in as3 (buttons in movie clip referencing to main timeline)

    Hi, I created buttons within a movie clip that i placed in the main timeline.I am  a novice to as3. I just wanted the button to go to the frame label of the main timeline. i used to do this with _root in the old flash. how do i do this?
    thumb02_btn.addEventListener(MouseEvent.CLICK, buttonClicked);
    function buttonClicked(event:MouseEvent):void
        gotoAndPlay("slide2");

    Thanks for the quick reply!
    somehow i must be doing something wrong though. It's not working...
    I added a stop to the "slide02" labeled section of the main timeline.
    and I also added a stop to the beginning and end of the movieclip. Am I doing something wrong? attached is my file....thanks!!
    stop();
    thumb02_btn.addEventListener(MouseEvent.CLICK, buttonClicked);
    function buttonClicked(event:MouseEvent):void
        MovieClip(this.root).gotoAndPlay("slide2");
    stop();

  • Needs help adding images to movie clips and referencing the frames

    i havent started with a blank, script made movie clip.
    I want to add frames from action script 2, and be able to
    reference/show the induividual frames for a video game and not a
    movie. I dont realy need animation, i just need certain frames to
    show, that i want to load load(from a non script made movie clip
    with one loaded frame(bitmap data).

    you can't add frames to a movieclip using actionscript. so,
    if that's what you're trying to do you'll need to find some other
    way to accomplish your goal.

  • Stopping and Playing a series of movie clips

    I am looking to make a showreel of a series of movie clips that reside on a single frame each in the main timeline.
    I have been searching google and Adobe forums for a solution with Action Script 3 but have yet to find one that works as described. I feel as though the scripts I am finding are partial and not complete examples because the script fails due to functions/variables/events/etc being duplicated or not found/referenced.
    What I need to happen is:
    movieClipA plays
         when movieClipA finishes
              goto MovieClipB
    movieClipB plays
         when movieClipA finishes
              goto MovieClipC
    movieClipC plays
         when movieClipC finishes
              goto MovieClipA (I am having most trouble with the loop back)
    Most of the time when the script works in the various ways I have scripted it, it will either flicker between the frames or play the first one then loops the seconds one or play both but not loop back. And sometimes (when I have used an event listener) it crashes the preview probably due to an infinate loop in the syntax I guess.
    It would be very helpful if you could break up the code into where each script is required to be keyed.
    Any help would be greatly appreciated!

    Figures.. I just found the post on the forums that answered my question.
    I have on the last frame of each MC - MovieClip(parent).nextFrame();
    Then in the main timeline I have - stop();
    I then have a frame after the last MC which says gotoAndPlay(1);
    This works
    If you would still like to show me another solution, atleast then I know two ways how to do the same thing

  • Yellow triangle and a grayed out movie clip

    Hi, I created a project in iMovie 08, kind of elaborate for me, with several movie clips, each with a transition, and background music from iTunes through out the majority of the 3 minute and 30 second final project. Initially, all was well and the project played perfectly. A couple of days later when I went into iMovie 08 to enhance the project, several clips were grayed out and had a yellow triangle in the clip. Placing the cursor over the clip resulted in the clip "coming to life" that is revealing the clip but the clip was not visible in the browser and the grayed out clips were not visible if I played the project in full screen mode. If I published the project to the web, the grayed out clips would not show (the video portion); the audio which was part of the whole project would play. I do not think I moved any clips to a different location although I certainly added other clips to iPhoto and then to iMovie. I just finished the lynda.com training on iMovie 08 which was just released and I got no help from that training on the yellow triangle problem. Any help or ideas would be appreciated. Thank you.

    Great news! After some browsing around, I located the problem, and now my movie project is fixed!
    As it turns out, videos that are located in iPhoto are referenced based on the Event that they belong to, which means that if you change the name of the Event that the picture belongs to then iMovie will no longer be able to find your picture. (This is also why the clips appear in the lower section of iMovie, because they are still there, just in a renamed or merged event.)
    I was able to fix the problem very easily by renaming my event back to the original name, and then after closing and restarting iMovie all the nasty little yellow triangles were gone and all my clips were back as if they'd never left.
    This may or may not help, but for me, to make sure that I got the event name correct, I found the movie file (which was in "Movies/iMovie Projects") and then right mouse clicked and selected "Show Package Contents" so that I could see what was in my project, and then opened the "Project" file, which had the names listed in it. Hope that helps!
    Trigby

  • Flash CS4 Link to a Movie Clip from inside another Movie Clip

    I am working on a Flash CS4 project which has 5 buttons with 5 corresponding movie clips all on the main timeline. Everything in functional so far.
    My problem is this: I want to be able to mouse click on a particular word in the text inside movie clip 4 ("mc4") and have it link to movie clip 3 ("mc3") (on the main timeline).
    I've tried many things, and I can't get it working.
    I have tried to highlight the word then link it to "mc3" in the properties panel where it says link (I successfully linked to an email address and to an outside website in other parts of the project)....
    I tried to link it in the properties panel to "mc3", I tried & "parent.mc3", "root.mc3";
    Linking it this ways seems to be the simplest, logical thing to do, but I don't know what kind of prefix it needs.
    Then, I tried making the word (inside mc4) an invisible button (button6) then linking it to the mc3, with it's actionscript in the main timeline with the other button functions.
    I tried duplicating mc3 and duplicating invisible button 3 and moving it's hotspot to over the word.
    I tried putting a copy of mc3 and the button inside mc4, with the actionscript also inside mc4.
    I tried duplicating mc3 and calling it mc6, and putting that inside mc4, with the actions back on the main timeline, and tried again with the actions inside mc4.
    I tried with mc6 and invisible button 6 on the main timeline, but that doesn't seem possible.
    I tried using this code from Adobe Actionscript 3.0:
    button6.addEventListener(MouseEvent.CLICK, startMovie);
    function startMovie(e:MouseEvent):void
            this.play(&quot;mc6&quot;); [and I also tried with &quot;mc3&quot;]
    Nothing works!! Please, I would appreciate any suggestions!!
    Thanks,
    Suzanne

    If I limit my attention to the second sentence of your posting, then I suggest the following (borrowing from the rest of your posting)...
    If that invisible button6 is inside MC3 (on MC3's main timeline), atop the word you are trying to link to the movieclip, and you just want to make mc4 play by clicking that invisible button6, then assign the following code to the button6 inside MC3...
    button6.addEventListener(MouseEvent.CLICK, startMovie);
    function startMovie(e:MouseEvent):void
            MovieClip(this.parent).MC4.play();
    If I missed, then I missed following your explanation.

  • Target a movie clip inside a movie clip

    When I go to the symbol editing mode on the first movie clip, I drag the instance of my 2nd movie clip to the stage. I then am duplicating my work, (it is over lapping) not sure what I am doing wrong here? and I am finding that my child movie clip is taking on the parent movie clip properties. How do I stop this from happening? I thought they are to remain independent? Any help is greatly appreciated. TY.

    Will the child timeline be independent of the parent timeline. My pend_mc is the child and has taken on the hand_mc properties. Also why is there brackets around some and not the others? Thank you so much for your time.

Maybe you are looking for

  • Date characterstics?

    Hi all, If u have different date fields in the cube delivery date actual delivery date goods issue date delivery at warehouse and they have taken as characterstics? how they should be mapped in cube?

  • Error when updating Idocs in Source System

    Hi All, We did a recent copy from QAS to DEV,after which am unable to run my process chains ,the load status still showin yellow signal,whereas job is getting finished but am unable to load datas to the targets. Am getting the following error message

  • BOM with Same Parent Number But Different WH

    Hello fellow SAP B1ers! I have a question and hope someone can help.  This point has us scratching our heads on how to do this. A customer has two warehouses (WH 1 and a newly-built WH5) producing the same product (Product A) but at different costs p

  • How do I make a Custom DataTip with Custom ItemRenderer

    I can't seem to find any documentation or examples of displaying a dataTip (similar to those used with charting) with my custom itemRenderer (mxml component). This is for use in a dataGridColumn. I Could someone give me an example? The closest I've b

  • Can I talk to a real person?  it is complicated.

    long story...but i have a "new" iphone 4 and synced photos.  it came up on iphone under albulms as "photo library" and "pictures from."  Problem #1: duplicate photos & problem #2 - cannot delete them! i sent to settings and general  and usage & delet