Need help! DuplicateMovieClip AS2: duplicates disappear when new duplicates are loaded... why?

Hi all

I apologize if this question has already been requested and replied, but I have yet to find so I am posting this in the hope of finding an answer.

I do a drag and drop using AS2 in Flash CS5 where mc elements are duplicated and enlarged from a menu of game and can be placed anywhere on the stage to create a custom robot.  Each Party (arm, head, feet, etc.) it's own mc with unique instance names.  I have the drag and drop part all understood, and I even work part duplicateMovieClip...

HOWEVER...

Whenever I have pass the frame class that an object has been duplicated, in another frame, then again, the clips disappear one by one if you try to create a new.  Each list of menu items are in their own frames (head, torso, arms, etc.).  That duplicates are made, they remain on stage no matter what framework you go to and can still be dagged autour, which is good, but as I said earlier, they disappear when you create a new duplicate.  Not all disappear at the same time, only more old created duplicates disappear as you bring new duplicates.

Why is this and how would it be fixxed?

Judging by my tracers, it seems to me that the depth is reset to 0 while the new framework is loading... I don't know how to get around this. Is it possible to add some sort of control looking for existing duplicates before you create a new?

Here is the code that I use for my parties (instance names are the only thing that changes) (I changed the name of the instance to mcname for simplicity)

This part is added only once.

var num:Number = 0;

var buttonID:MovieClip;

It is added for each object, but on the main timeline and no purpose and is added to executives that the objects reside in.

mcname.onPress = function() {}

buttonID = mcname.duplicateMovieClip ("mcname" + num, num ++);

trace (buttonID + "--a was created");

buttonID.startDrag ();

buttonID.onPress = function() {}

trace ("dragging currently-->" + this ._name);

this.startDrag ();

};

buttonID.onRelease = buttonID.onReleaseOutside = function () {}

this.stopDrag ();

};

};

mcname.onRelease = mcname.onReleaseOutside = function () {}

buttonID.stopDrag ();

buttonID._xscale = 150;

buttonID._yscale = 150;

};

It's probably as you say.  The value num is resetting when you re-enter the framework.  Try to use...

var num:Number;

if(num == null) {}
num = 0;
}

Tags: Adobe Animate

Similar Questions

  • Need help to send email Notification when new assignment

    Hi all

    How can we send a notification email to lead existing or new lead alert, when a new task is assigned to no one in particular. Here in my number of n daily requirement of the tasks assigned to senior management. So, how can I send the same.

    Thanks in advance.

    Kind regards
    Ratan

    Hi Ratan,

    This is clearly not your question if you try to trigger the notification by email to the task or lead, but it is not serious. You will need to write a WF for the lead/task and trigger it when a new record is created and then in actions, select email notification.

    Good luck

  • I can't get the watermark disappears when I by a picture, why?

    I can't get the watermark disappears when I by a picture, why?

    Please refer to I downloaded my 10 free images and they all have the Adobe watermark on them, so I can't use them. Why do they have a watermark on them?

  • Is it safe uninstall the old service packs when new ones are installed?

    I have Microsoft's latest Pack Service, can I uninstall old Service Packs when news are installed?

    I have Microsoft's latest Pack Service, can I uninstall old Service Packs when news are installed?

    Do you see even registered?
     
    In general - you should leave well enough alone when it comes to patches.  Microsoft does a job just to install only the parts of a patch which aren't already in place - so, even if you started without service pack, got SP1, SP2 and SP3 as well as 100 + post-SP3 fixes - this is not as if the use of space was exactly cumulative...  The overlap himself would have worked.

  • Need to call the javascript function when the page is loaded

    Hello - I have a javascript function defined on Page 0 of my application. It is in the source of an unconditional
    region whose view point is after the header.

    I call successfully the function of event onchange on individual page elements. (The function
    sets the value of an element based on the value of another).

    But I also need to call the function when the page is loaded. The page is a form of data modification,
    so many values is filled when it is loaded, and I need the dependent values populated
    also.

    I tried to add the call to function in the following way. It is not at all get called (alerts are not forthcoming)
    and there is no error in the Firefox error console...
    - as an event onload in individual items
    -call directly to the edit HTML page header
    -call directly from the HTML body of the edit page (which, from what I've read, sounds
    as to execute onload and my page template doesn't have a defined substitution onload string).

    In these 2 cases, I simply call it like: jsLookupValue ($v ("P8_OBJECTTYPE_ID"), "objecttype_id", "P8_OBJECTTYPE_NAME", "objecttype_name", "hdb_objecttype");

    How can I do this?

    Thank you
    Carol

    If you define the function on the zero page and any page you should be able to call using something like:

    
    

    Have you tried to put just a statement alert() on the page in order to check that it runs just about anything?

  • Text glow effect disappears when the layers are placed in the text layer. Need help!

    Whenever I have add a layer of white or a white shape under my text layer, the glow on the text layer will show is no longer.  I can't get the glow on the text appears on a transparent background. I use Photoshop in CS3.

    Glow in the first photo, no glow in the second when white layer under the text layer.

    text with glow.jpg

    no glow over white layer.jpg

    Hello

    Default Outter Glow has the screen as it has blend mode. on a white background, you need to change to a different mix (normal color, more dark, multiply, or whatever you prefer, experience with some doubt)

    I suggest leaving the white background on all tweaking and if you need output, turn off the white layer before saving transparent

    Please post if this does not resolve the problem for you

  • I need help to remove duplicate files

    I have MANY files duplicate on my, new to me, the laptop. Including but not limited to photos and lower costs.  I would like to delete all the duplicate files and other unnecessary junk files and I could use some (a lot) of help. I'm not that effective with the numeracy skills so I need it set as simple as possible.  Thanks for any help you give.   Its a Dell computer inspiron laptop if that means something.

    Use Bing or Google to find 'duplicate file remover' or 'duplicate file finder' - there are several dozens of utilities that can do it for you.

  • Need help with uploading photos to the new macbook

    I just bought a macbook pro 13 inch and had all my old files saved on a WD My Passport for Mac external hard drive. When try to import my library of photos from the external hard drive to the macbook, I receive a message reading "none of these files can be imported into your photo library.

    I read that you are unable to import the whole photo library to another library of photos, but I don't know if I understand that correctly. in any case, can someone please walk me through how to fix this problem, because a lot of these photos are very important to me. In case this is useful, I was able to import more pictures of the new photo library (such as those that have been saved on the desktop, iCloud etc.)

    Sorry, but unless you detail we can without help

    What format is the WD MyPassport? What you have on it (your library of Photos or just Photos)?

    You import photos - you open and migrate the library

    What version of the OS and the Photos or iPhoto do you have on your old system?

    LN

  • Need help with iTunes duplicate Applescript.

    Hello

    I found this script that works great with iTunes automatically duplicates deleting. Something that I had wanted for a long time.

    I use Lion with the older version of ITunes, so I really need this script to work.

    It is an import script that helps me sync my music library to my home office with my nightclub iTunes library.   The only problem I have with this script is that it does not keep this last recorded double track.  I want to keep the last tracks because sometimes I replace a track with a better record of video or audio clip.  I would like to change this script to just base duplicates on the artist, Album artist, and name.   I hope that someone with apple great capabilities of script can check the script and help me adjust.  I tried to contact Randolf who created the script, but he did not.   Here is his magnificent scenario.   I'm sure that many people will find this useful.   I hope someone can help me.  I am very limited in my applescripting.

    -Ron

    _______________________________________________________________________________'

    Remove the Script duplicates ITunes

    (*

    This small script detects and removes duplicates in your iTunes library. Two tracks are considered duplicates if they share the same name of the track, the artist and the title of the album. If these 3 fields are the same, all the tracks except for one can be deleted. In addition, the game account and group entries are "merged."

    You can also use the account manager to remove duplicates in any other selection as the main library.

    You can enable or disable the registry deleted. Logging goes to the "logFile.txt" in your home folder.

    Any comment to

    Gmail.com

    *)

    property doLogging: false

    textlog property: missing value

    performance {}

    Tell application "iTunes" to the value plList library playlist 1

    hand (plList)

    end of race

    on hand (plList)

    -set up the recorder

    the value textlog makeFileLog (((chemin d'accès àle dossier de base) as String) & "logFile.txt")

    If doLogging logImportant then textlog ("start remove duplicates...")

    findDuplicates (plList)

    If doLogging logImportant then textlog ("completed the removal of duplicates...")

    end main

    on findDuplicates (plList)

    Tell application "iTunes".

    -find all artists

    the value artistList to the artist for each track of plList which the artist no lack of value

    Set actArtList to {}

    Repeat with an artistList in

    otherwise (actArtList contains (an AsString)) then copy (a string) to end of actArtList

    end repeat

    -find all the albums of a given artist

    Repeat with an actArtList in

    the value albList (album the album and each track of plList which the artist is a missing value)

    Set actAlbList to {}

    Repeat with al in albList

    If not (contains the actAlbList (al AsString)) then copy (al AsString) at the end of actAlbList

    end repeat

    -find all the titles with the artist one and al album

    Repeat with al in actAlbList

    the trList value (each track name of plList which the artist is an album is al and name no lack of value)

    Set actTrList to {}

    Repeat with tr in trList

    If not (contains the actTrList (tr AsString)) then copy (tr AsString) at the end of actTrList

    end repeat

    -manage these tracks

    Repeat with tr in actTrList

    the tracksWithThisComb value (all tracks of plList which the artist is an album is al and name is tr)

    If tracksWithThisComb > 1 then length

    My mergeTracks (tracksWithThisComb)

    Repeat with i of 2 all tracksWithThisComb

    the value of t to the point i of tracksWithThisComb

    If doLogging then

    the value of str (tr & "-" & al & "-" & a)

    Comment by TextLog ("Remove" & str)

    end if

    remove the t

    end repeat

    end if

    end repeat

    end repeat

    end repeat

    tell the end

    end findDuplicates

    on mergeTracks (possDupl)

    Tell application "iTunes".

    Set arrive in section 1 of the possDupl

    played playCount value number to arrive

    the grOfTrack group value to arrive

    "the gr value.

    the value compOfTrack compilation to arrive

    the value of comp «»

    -collect all of the information would

    Repeat with i of 2 all possDupl

    value tr to the point i of possDupl

    value played trPlCount number of tr

    If trPlCount > playCount then set playCount on trPlCount

    If (grOfTrack is equal to "") then

    the value trGroup grouping of tr

    If not (trGroup is equal to "") then the value gr trGroup

    end if

    If (compOfTrack is equal to "") then

    the value trComp compilation of tr

    otherwise (trComp is equal to "") then the comp trComp value

    end if

    end repeat

    game played count to arrive at playCount

    If (grOfTrack is equal to "") then set grouping of arrive in gr

    If (compOfTrack is equal to "") then set compilation to arrive in comp

    tell the end

    end mergeTracks

    on makeFileLog (\\server\share\file_path)

    script FileLog

    Category: "log file".

    property _linefeed: 10 characters id

    -Written records messages in a file encoded in UTF8 text

    on logMessage (the_text)

    the value of f to open for access file_path with write permission

    Try

    write (the_text & my _linefeed) f from folklore as 'class utf8 '.

    on error error_message number error_number

    Close access f

    error error_message number error_number

    try to end

    Close access f

    end logMessage

    on logImportant (the_text)

    logMessage ("*" & the_text & "*")

    end logImportant

    end of script

    end makeFileLog

    iMac, Mac OS X (10.7.3)

    < personal information under the direction of the host >

    iMac, Mac OS X (10.7.3), null

    Please... y at - there anyone out there that can help me?

    Ron

  • I need help to install CS4 on my new iMac.

    Migrated software, but when I try to open it I get a message from license has expired. However, there is no prompt to re - enter the serial number, and although I have the disks, I don't have a slot to insert. Thank you!

    Migration of Mac with Time Machine WILL NOT WORK with the Adobe program activations due to hidden registration files

    150:30 trouble https://helpx.adobe.com/x-productkb/global/error-licensing-stopped-mac-os.html license error

    If the above does not work, try the link below

    kglad links in response to #1 here can help https://forums.adobe.com/thread/2081216

    Install CS5 on Mac 10.11 https://forums.adobe.com/thread/2003455 can help (also for others than CS5)

    -also a TEMPORARY security change https://forums.adobe.com/thread/2039319

    -http://mac-how-to.wonderhowto.com/how-to/open-third-party-apps-from-unidentified-developer s-mac-os-x-0158095 /

    -the guardian https://support.apple.com/en-au/HT202491

    Even after all the above, Steve is OK... your OLD software may never run on a NEW Mac.

  • Need help with as2 as3 conversion. Please, I beg you.

    Could someone help me to convert as2 as3, please?

    Source code:

    _root.magnet = 500;
    _root.magic = 10;

    and

    onClipEvent (load)
    {
        homex = this._x;
        homey = this._y;
        forcex = 1;
        forcey = 1;
    }
    onClipEvent (enterFrame)
    {
        x0 = this._x;
        y0 = this._y;
        x1 = this._xmouse;
        y1 = this._ymouse;
        distancex = x1 - x0;
        distancey = y1 - y0;
        distance = Math.sqrt(distancex * distancex + distancey * distancey);
        powerx = this._x - distancex / distance * _root.magnet / distance;
        powery = this._y - distancey / distance * _root.magnet / distance;
        forcex = (forcex + (homex - x0) / 2) / _root.magic;
        forcey = (forcey + (homey - y0) / 2) / _root.magic;
        this._x = powerx + forcex;
        this._y = powery + forcey;
    }

    I am a newbie in flash so if anyone can help with this would be great.

    I really need to be done please help me.

    MovieClip(root).magnet = 500;MovieClip(root).magic = 10;
    

    and

    var homex:Number = yourmc.x;var homey:Number = yourmc.y;var forcex:Number = 1;var forcey:Number = 1;
    
    yourmc.addEventListener(Event.ENTER_FRAME, loopF);
    
    function loopF(e:Event){    var x0:Number = e.currentTarget.x;    var y0:Number = e.currentTarget.y;    var x1:Number = e.currentTarget.mouseX;    var y1:Number = e.currentTarget.mouseY;    var distancex:Number = x1 - x0;    var distancey:Number = y1 - y0;    var distance:Number = Math.sqrt(distancex * distancex + distancey * distancey);    var powerx:Number = e.currentTarget.x - distancex / distance * MovieClip(root).magnet/distance;    var powery:Number = e.currentTarget.y - distancey / distance * MovieClip(root).magnet/distance;    forcex = (forcex + (homex - x0) / 2) /MovieClip(root).magic;    forcey = (forcey + (homey - y0) / 2) / MovieClip(root).magic;    e.currentTarget.x = powerx + forcex;    e.currentTarget.y = powery + forcey;}
    
  • need help to specify the destination when the release of webhelp

    Hi, I'm under RH8 on Windows XP.  I've always published my project (Webhelp Pro) to a web server in the network, but somehow my destination server settings got wiped out.  However, when I tried to configure them again, the only option that is imparted to me under connection protocols is now Robohelp Server.  I used FTP the files on the network server.  Where is this option?  I don't have a Robohelp Server.  I have attached a screenshot.  I would be very happy to help with this problem.

    Thank you very much

    Emilyrobohelp.JPG

    Hi Emily.

    The dialog box you have provided part of the presentation of unique source of WebHelp Pro where you specify where you want your output published in the RoboHelp Server application. If you do not have this application installed, you can not use this provision of single source. I think that what you need, is the unique source of WebHelp schema that indeed offers you the ability to FTP the output to the desired location.

  • Need help! How to create a new page?

    Hello

    I'm in the middle of creating a business presentation and I need to chain it all carefully in adobe reader8, the problem is, I have no idea how to create new pages on this subject, and can therefore show coverage of said presentation. Help, please?

    Not possible with Adobe Reader.

  • I need help with security issues pass when I don't remember responses

    I bought a new phone and I was trying to buy some ringtones but its application to verify my info so he asks me my security questions the problem is I don't remember not answers, and when I tried to call customer servcie was closed

    You have to ask Apple to reset your security questions. To do this, click here and choose a method; If this page does not list one for your country or if you are unable to call, complete and submit this form.

    If they are closed, wait until they are open.

    (137812)

  • NEED HELP FAST - façade freezes when I run my program. I have all the events to the interaction of the façade. I don't have a chance to launch an event that I can't even click on anything whatsoever on the front panel?

    All,

    I'm pragmatic disabling most of the façade with a particular event. This freeze happened when I launched this event and then stopped the program in the middle of the event. While the program has been frozen at all times no matter how many times I turned on my computer and turned off and restarted labview. I tried with pragmatism, allowing some of these objects on the front façade of the loop of events without result. What else could it be? When I select the program stops at the structure of the event and is waiting for him. When I have a finite number of thread for the time terminal timeout the timeout event runs and then waits for the structure of the event and I'm still not allowed to do anything.

    Aaron

    Yenkip,

    OK, the moral of the story when programmatically disabling an object to front panel make sure you have the code that allows very early in the program, changing constantly in the middle of the program changes its active status. I tried enabling some of these objects, but not all. When I tried allowing each of them, I realized that everything in the deactivation of the tab control tab control disables not only the ability to change the tab control. IT WASN'T THE STRUCTURE OF THE EVENT. The guys help OR on the phone told me that the structure of the event was obviously the question. I'm fine now.

    Thank you

    Aaron

Maybe you are looking for

  • ThinkPad E330 BSOD

    A few months ago that I posted here on random BSOD, the slowness of extended priority response guaranteed when things go wrong. So to summarize, repeated BSOD, change of hard disk, the problem persists, has changed the map system. It took more than a

  • Active Directory - join the domain for multiple devices

    Hi all I need your expertise to advice me how join domain for multiple devices. Currently my organization have more than 10,000 computers are made up of Windows XP, 7, 8 and 10. We will deploy new Active Directory server in the data center. Currently

  • How to customize a VI and save

    I want to customize Auto Power Spectrum.vi and save the modified version.  I put Pwower Spectrum.vi Auto on my pattern, I double click to open it, then I start to change. When I click on file, "save under" is grayed out.  I do not want to save more t

  • Microsoft Wireless Multimedia Keyboard Mouse & 1. 0a, typing on computers in other rooms

    Original title: Microsoft Wireless Multimedia Keyboard & Mouse 1. 0a Our offices are using Microsoft Wireless Keyboard & Mouse multimedia 1. 0a. It works very well until recently, when a person entering a room the other rooms will pick up what is typ

  • Ripple Crash under Windows 7

    Hello everyone, I am new to the development of Blackberry web work, I tried to install ripple and web Blackberry works SDK. First time ripple emulator works fine, I shut down the emulator and start .it breaks down. What the problem completely shut do