Multiple ActionScript on the same flash document

Hi, everyone. I am very new in flash, and espcially in actionscript.
I have been able to insert the template of snow with the action layer that comes with it. Using these layers alone with the rest of the project. Everything works fine. But when I create other keyframes with action of blinking stars on the same project. Even if they are on the same action layer or on differents layers, the actionscripts of the blinking stars work, but the one with the snow doesn’t work anymore.
I put my actions script below, can someone help me with this problem.
SNOW
// Number of symbols to add.
const NUM_SYMBOLS:uint = 75;
var symbolsArray:Array = [];
var idx:uint;
var flake:Snow;
for (idx = 0; idx < NUM_SYMBOLS; idx++) {
    flake = new Snow();
    addChild(flake);
    symbolsArray.push(flake);
    // Call randomInterval() after 0 to a given ms.
    setTimeout(randomInterval, int(Math.random() * 10000), flake);
function randomInterval(target:Snow):void {
    // Set the current Snow instance's x and y property
          target.x = Math.random()* 550-50;
    target.y = -Math.random() * 200;
          //randomly scale the x and y
          var ranScale:Number = Math.random() * 3;
          target.scaleX = ranScale;
           target.scaleY = ranScale;
          var tween:String;
          // ranScale is between 0.0 and 1.0
          if (ranScale < 1) {
                    tween = "slow";
          // ranScale is between 1.0 and 2.0
          } else if (ranScale < 2) {
                    tween = "medium";
          // ranScale is between 2.0 and 3.0
          } else {
                    tween = "fast";
    //assign tween nested in myClip
          myClip[tween].addTarget(target);
BLINKING STARS
for (var m =0;m<50;m++) {
star1_mc.duplicateMovieClip("star1_mc"+m,m,{_x:Math.random()*350,_y:Math.random()*150});
root["star1_mc"+m].gotoAndPlay(random(30));
Thanks in advance

you cannot use identical function names.  once a (anonymous) function is defined in a frame, it exists for as long as your swf is open whether the frame that contains its code is played or not.
so, remove functions (eg, randomInterval) that have already been defined.  you should be seeing error messages telling you that you have duplicate functions.

Similar Messages

  • Multiple Instances of the Same Excel Document in 'Alt-Tab' List

    So I am having a very weird problem, and I can't seem to find an answer anywhere. I was recently given a new laptop at work with Windows 7 and Office 2010. It has worked pretty well so far, but recently I have been noticing something very strange. While
    this problem is quite small, due to how I use windows and my habits of alt-tabbing between multiple documents throughout the day, it is causing a serious problem.
    This typically only happens when I have multiple excel documents open, and am tabbing between them or other documents or windows. For example, I have ClientList.xlsx open and need to cut and paste a cell from it to FinalReview.xlsx. I have 'ClientList' open
    and just clicked Control+C to copy a cell. I click on 'Alt-tab' and while the icon in the alt tab list appears to change, I am taken immediately back to the same document. What is happening is that there are actually two separate copies of 'ClientList'
    in my alt tab list. If I press and hold 'Alt' and then hit 'tab' twice, I can pull up the other excel file, 'FinalReview'.
    At any point in time, I can click on the 'Alt' button to see the list and see three Excel icons. There will be one large excel icon with the name 'Microsoft Excel - ClientList.xlsx', and then right next to it will be two smaller looking excel icons with
    the names 'ClientList.xlsx' and 'FinalReview.xlsx' respectively.
    Has anyone seen anything like this before? I have spend hours searching for a resolution on the internet, as well as calling my work's tech support line and have not found anything remotely close to this as even being an issue.
    Thanks in advance for your help.

    Hi,
    First, I would like to verify whether this issue only occurred with Excel? Have you checked the Excel settings? You can perform a
    system restore to see how it works.
    In addition, I suggest you try the following:
    1. Test the issue in Clean Boot and
    Safe Mode
    2. Create a new user to test if this issue still exists.
    Thanks,
    Vincent Wang
    TechNet Community Support
    Mate, did you even bother to read the question? To mark your response as the answer is a complete load of garbage - you haven't even bothered to respond to the actual question. The correct answer is below from B.W._.
    No wonder anyone wanting decent responses uses stack overflow instead of these ridiculous forums...

  • How do I print multiple copies of the same InDesign document on 1 page?

    I made a sign that is 7"w x 3"h and I would like to print 3 on a page. Can I do in InDesign? Adobe Acrobat. I found a feed from 2008, but was hoping that something had changed.
    Thank you.

    If you're looking for automated "n-Up" functionality, I don't think you'll find it in InDesign or Acrobat.
    All I can suggest is start a new InDesign document and place 3 copies of your sign on the page. Print.

  • Under Options , Applications There are multiple entries for the same item (Acrobat Document). how can I delete the duplicates?

    Under Options, Applications there are multiple entries for the same item. (Adobe Acrobat) . Three show Adobe Acrobat Reader 9.3 and the other shows (ask) or (save file) with no ability to select Acrobat Reader . Is there a way to edit this list to remove the duplicates and
    the incorrect entry? Adobe installed a very quick update today.

    They are all different. Hover your mouse pointer over each of the "Content Type" descriptions and you should see a "tooltip" to see that each has a different description.
    You need to update your plugins. It is important to keep them updated due to continuing security fixes and improvements in those plug-ins:
    * Adobe Shockwave for Director Netscape plug-in, version 11.5 (you '''<u>may</u>''' need to update)
    * Shockwave Flash 10.1 r53
    * Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
    #Check your plugin versions: http://www.mozilla.com/en-US/plugincheck/
    #*'''Note: plugin check page does not have information on all plugin versions'''
    #'''Update Shockwave for Director'''
    #*NOTE: this is not the same as Shockwave Flash; this installs the Shockwave Player.
    #*Use Firefox to download and SAVE the installer to your hard drive from the link in the article below (Desktop is a good place so you can find it).
    #*When the download is complete, exit Firefox (File > Exit)
    #*locate and double-click in the installer you just downloaded, let the install complete.
    #*Restart Firefox and check your plugins again.
    #*'''<u>Download link and more information</u>''': http://support.mozilla.com/en-US/kb/Using+the+Shockwave+plugin+with+Firefox
    #'''Update Shockwave Flash'''
    #*Use Firefox to Download and SAVE to your hard drive from the link in article below
    #*SAVE to your Desktop so you can find it
    #*After download completes, close Firefox
    #*Click on the file you just downloaded and install
    #**Note: Vista and Win7 users may need to right-click the installer downloaded and choose "Run as Administrator"
    #**Note: Most browsers other than IE will also get updated with this one download
    #**Note: To update IE, same procedure '''<u>but use IE</u>''' to go: http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_ax.exe
    #*After installation, restart Firefox and check your version again.
    #*'''<u>Download link and other information</u>''': https://support.mozilla.com/en-US/kb/Managing+the+Flash+plugin#Updating_Flash
    #* Also see: http://support.mozilla.com/en-US/kb/Installing+the+Flash+plugin
    #* Also see (if needed): http://kb2.adobe.com/cps/191/tn_19166.html#main_Uninstall
    #'''Update Java:'''
    #* Download and update instructions: https://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox

  • Open multiple occurances of the same document

    We are running reader 9.1.1 and need to be able to open multipe occurances of the same document. Yes, I know how to open the same document multiple time with <window><new window> the problem with this is editing a form in one window changes it in all windows. I need to ope independant occurances or the same form. Can this be done? The /n switch will not work for this either! Hope somebody has an idea.

    Simple solution, yes. Unfortunatly its not that simple... Having multiple copies of the same document posses issues when updating the document. This doucument is updated almost daily and is distibuted to many users across a network... Having to have users open multiple copies of the document creates many logistical and use issues.

  • [svn] 949: Bug: BLZ-96 - When sending a HttpService request from ActionScript with multiple headers with the same name , it causes a ClassCastException in the server

    Revision: 949
    Author: [email protected]
    Date: 2008-03-27 07:12:59 -0700 (Thu, 27 Mar 2008)
    Log Message:
    Bug: BLZ-96 - When sending a HttpService request from ActionScript with multiple headers with the same name, it causes a ClassCastException in the server
    QA: Yes - try again with legacy-collection true and false.
    Doc: No
    Checkintests: Pass
    Details: Another try in fixing this bug. When legacy-collection is false, Actionscript Array on the client becomes Java Array on the server and my fix yesterday assumed this case. However, when legacy-collection is true, Actionscript Array becomes Java ArrayList on the server. So added code to handle this case.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-96
    Modified Paths:
    blazeds/branches/3.0.x/modules/proxy/src/java/flex/messaging/services/http/proxy/RequestF ilter.java

    Hi all!
    Just to post the solution to this if anyone ever runs accross this thread...
    For some reason i had it bad the first time, don't have time right now to see why but here is what worked for me:
    HashMap primaryFile = new HashMap();
    primaryFile.put("fileContent", bFile);
    primaryFile.put("fileName", uploadedFile.getFilename());
    operationBinding.getParamsMap().put("primaryFile", primaryFile);
    HashMap customDocMetadata = new HashMap();
    HashMap [] properties = new HashMap[1];
    HashMap customMetadataPropertyRoom = new HashMap();
    customMetadataPropertyRoom.put("name", "xRoom");
    customMetadataPropertyRoom.put("value", "SOME ROOM");
    properties[0] = customMetadataPropertyRoom;
    customDocMetadata.put("property", properties);
    operationBinding.getParamsMap().put("CustomDocMetaData", customDocMetadata);
    Basically an unbounded wsdl type is an array of objects (HashMaps), makes sense, i thought i had it like this before, must have messed up somewhere...
    Good luck all!

  • [svn] 931: Bug: BLZ-96 - When sending a HttpService request from ActionScript with multiple headers with the same name , it causes a ClassCastException in the server

    Revision: 931
    Author: [email protected]
    Date: 2008-03-26 11:31:01 -0700 (Wed, 26 Mar 2008)
    Log Message:
    Bug: BLZ-96 - When sending a HttpService request from ActionScript with multiple headers with the same name, it causes a ClassCastException in the server
    QA: Yes - we need automated tests for this basic case.
    Doc: No
    Checkintests: Pass
    Details: RequestFilter was not handling multiple headers with the same name properly.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-96
    Modified Paths:
    blazeds/branches/3.0.x/modules/proxy/src/java/flex/messaging/services/http/proxy/RequestF ilter.java

    Hi all!
    Just to post the solution to this if anyone ever runs accross this thread...
    For some reason i had it bad the first time, don't have time right now to see why but here is what worked for me:
    HashMap primaryFile = new HashMap();
    primaryFile.put("fileContent", bFile);
    primaryFile.put("fileName", uploadedFile.getFilename());
    operationBinding.getParamsMap().put("primaryFile", primaryFile);
    HashMap customDocMetadata = new HashMap();
    HashMap [] properties = new HashMap[1];
    HashMap customMetadataPropertyRoom = new HashMap();
    customMetadataPropertyRoom.put("name", "xRoom");
    customMetadataPropertyRoom.put("value", "SOME ROOM");
    properties[0] = customMetadataPropertyRoom;
    customDocMetadata.put("property", properties);
    operationBinding.getParamsMap().put("CustomDocMetaData", customDocMetadata);
    Basically an unbounded wsdl type is an array of objects (HashMaps), makes sense, i thought i had it like this before, must have messed up somewhere...
    Good luck all!

  • INDD CS6 multiplies tab of the same document

    When i start up Indesign CS6 on my macbook pro, sometimes it opens up automatically an infinite number of tab/ window of the same last document i've worked,
    INDD keeps opening new tabs non stop, until i force to quit.
    I made a screen cap on :
    http://s28.postimg.org/qw9kblyx9/Capture_d_e_cran_2014_09_12_a_10_57_03.png
    Does any one have the same problem?
    http://www.pinterest.com/pin/create/extension/

    THer are two folders that hold the prefs (and the recovery folder is next to one of the prefs files) and the paths can be found at Replace Your Preferences
    Note that these folders are HIDDEN in recent versions of OS X, so if you don't know how to access hidden user library folders see Access hidden user library files | Mac OS 10.7 and later

  • Sharing one iTunes library across multiple accounts on the same Mac

    Hello, I've poked around at some of the posts dealing with sharing one iTunes music library across multiple accounts on the same Mac but it seems like this can only be done if the libary is moved to a shared folder. I realize this can be done but I was trying to share it the way it is described in a post on Apple support (See link below.). That post seemed to imply that you don't have to move the library from its original location (owned by account A, e.g.), rather just make a couple preference changes in the accounts, use fast user switching and voila. That doesn't seem to work. So my question is this: Is the only way to share one iTunes music library across multiple accounts on the same Mac to move it to a shared folder? I'm running 10.4.8 on an Intel iMac. Thanks in advance!
    http://docs.info.apple.com/article.html?artnum=93195

    After reading this and several other related threads, I am becoming thoroughly confused about all of this. I have a situation similar to the one that pokerpal described in the post dated January 7 at 8:06 pm, except that the music files on my system are located on an external hard drive. Everything else is pretty much the same though - I am the admin user (and the main iTunes user and maintainer) and my girlfriend is a standard user who has no music in her own iTunes library. She can see and listen to and make playlists from and sync her iPod with the music in this library from her account, and I can do the same thing, independent of her, from my account. And if I make a change to information within a song, she doesn't see it, and vice versa, and I understand that. What I don't understand is why when I add a song or an album to the music files by importing a CD or downloading something from the iTunes Music Store, she has no way of knowing that unless I tell her, and then she can add it to her library by using the "Add to Library" function. Is there no way of automatically updating her library files to add the new song(s)? We have almost 15,000 songs and videos in that library, and I don't even want to think about what might have to happen if the answer to my question is "no." Interestingly enough, if I put an update to a Word document in the same exact location (on the hard drive), we can update that and pass it back and forth all day - why is that such a difficult task for iTunes to accomplish?
    Sorry I went on so long, but this has been building up for some time, and none of the solutions I've read about here have really been of any help, so I'm a bit frustrated and, as I said at the beginning, confused.
    iMac G5, MacBook   Mac OS X (10.4.8)  

  • How can I have use the same div ID multiple times on the same page?

    Okay so a problem I encounter a lot is that often times I want to use the same div ID several times on the same page. An example of this is when I'm creating table like designs.
    Let's say for instance I create a div ID called 'product-container'. I want to use 'product-container' multiple times on the same page but if I do this it is improper XHTML and will throw errors in any XHTML validator (you are only allowed to use a div ID once on any XHTML page in order for it to be standards compliant).
    Now the first option is that I could define 'product-container' in my CSS style sheet multiple times by doing something like this...
    #product-container {
         width: 300px;
    #product-container-2 {
         width: 300px;
    #product-container-3 {
         width: 300px;
    #product-container-4 {
         width: 300px;
    What you will see there however is that it seems pointless to define the same ID numerous times over (just adding a number on the end) when each ID is the exact same thing and has the exact same attributes.
    Now what I have noticed is that there are some sites out there who manage to have the same ID appear several times in the code but add a number to it just like above. The difference is that they only have one definition for 'product-cointainer' in their CSS document but in their actual XHTML code they have IDs for 'product-container' but with numbers on the end like 2,3,4,5, etc. It's almost as if JavaScript or some other code is automatically appending a number on the end of the ID so the validator won't consider the markup to be invalid, but yet it knows that it's using the same 'product-container' style that is contained in the CSS style sheet.
    I hope I explained this correctly. I'm just hoping to find a way that I can put the same div ID on a page multiple times without having to define it over and over again in my CSS.
    Any help is much appreciated!

    Because it seems like by using a class you can't make this position as 
    well as you can by using an ID. Am I wrong?
    An ID name can be used only one time per page.  A class name can be used multiple times per page.
    .product {
    width: 300px;
    text-align:left;
    color: #FF0000
    border: 2px solid #666;
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • Multiple images of the same file on one page

    How do I create multiple images of the same file on one page? For example, I've got an image that I could fit 6 of on one page, and would like to print it that way instead of printing it on 6 individual pieces of paper.

    Are you attempting to do this in Adobe Workspaces? Or are you looking for software that will do it?
    If the former, you could insert the image into a Buzzword document six times. Not exactly elegant, but it might do the trick.

  • Run invoke-command on multiple machines at the same time

    Hey all so I read that if I store my New-pssession in a variable then used that in my invoke-command it would run all computers at the same time.
    $a = Get-Content "C:\Users\cody-horton\Desktop\list.txt"
    $session
    for($i=0;$i -lt $a.Length;$i++){
    if(!(Test-Connection -Cn $a[$i] -BufferSize 16 -Count 1 -ea 0 -quiet)){
    Write-Host $a[$i] -foregroundcolor red
    else{
    $session = New-PSSession $a[$i]
    Invoke-Command -Session $session -FilePath "\\My computer\C`$\Users\public\Documents\zip folder.ps1"
    What exactly am I doing wrong I just need to run this script on multiple machines at the same time.
    Thanks.
    Edit: Also what would be the best way to close all the sessions thanks.

    Hi there,
    So what I think you are doing wrong here is that you are overwriting the value in $Session everytime you executed code inside for loop. try the below:
    $a = Get-Content "C:\Users\cody-horton\Desktop\list.txt"
    $session = @() #define this as an array
    for($i=0;$i -lt $a.Length;$i++){
    if(!(Test-Connection -Cn $a[$i] -BufferSize 16 -Count 1 -ea 0 -quiet)){
    Write-Host $a[$i] -foregroundcolor red
    else{
    $session += New-PSSession $a[$i] #add the new session to the array, at the end it will be a collection of sessions
    Invoke-Command -Session $session -FilePath "\\My computer\C`$\Users\public\Documents\zip folder.ps1" #I think the above one won't work..first you need to copy the script locally on the machine and then execute it#Why this won't work because of Second-Hop Authentication
    Have put comments where I edited your code.
    Hope this helps
    Knowledge is Power{Shell}. http://dexterposh.blogspot.com/

  • Can I view the same pdf on multiple iPads at the same time with 1 iPad operating as the master (controlling page turns etc)?

    Would like to use 4nr iPads as an autocue system. Can I view the same pdf on multiple iPads at the same time with 1 iPad operating as the master (controlling page turns etc) and the others operating as slaves? Can this be done without the use of 3G or a remote Wifi hub? I would appreciate your input.................

    Open the document in Acrobat Reader and use the menu Window > New Window.

  • How  to fade groups of images or multiple images at the same time?

    I am creating a flash infographic, and want to fade images I have imported from Illustrator that are grouped. I would like to know how  to fade these groups and multiple images at the same time.
    Thanks!

    Use TweenMax for this.
    the syntax is like this:
    var arrayOfDisplayObjects:Array = new Array();
    //with arrayOfDisplayObjects.push(DisplayObject)
    //you can put any DisplayObject in the Array and when you want to fade them call this
    TweenMax.allTo(arrayOfDisplayObjects,1, { autoAlpha:0} );
    //to fade them in 1 second to alpha=0 and when reaching the zero make them invisible (to save processing power)

  • Stop opening multiple instances of the same application

    I am used to having graphic files on my desktop, when editing one I would simply right-click and pick "open with" > Photoshop (which is always open in its own desktop in my computer). Now out of the blue, if I do that, it loads another instance of Photoshop, which is certainly what I don't want. I can have 2, 3, 4 Photoshops running at the same time and editing the same image!
    Any idea how to solve this? I searched but all I could find is people wanting the opposite i.e. opening multiple instances of the same app.

    Your best bet to prevent this is to detach or unmount this drive; however, you can also try resetting your Mac's launch services, to have it re-scan only the Applications folders on your boot drive for programs to associate with documents and services you are using. Running the following command in the OS X Terminal will kill the current launch services database (its long, but copy and paste the entire line):
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill
    Following this, run the following command to seed the database with the apps you currently have installed:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -seed
    Note that these changes will only apply when opening documents that have not been specifically assigned to a program. If you find a specific document continues to open the program on the external drive, then you can get info on it and change the associated program in the "Open With" section of the info window. After doing this, you might need to re-run these commands above, as opening the program will register it with OS X's launch services and have it now be available for automatically handling other documents.

Maybe you are looking for

  • How do I get the Numbers application iOS 7.0.4 unstuck updating on iPad 2?

    How do I get the Numbers application unstuck in updating on iPad 2?   After the last update of iOS 7 it started acting up. Then weeks ago (in November) I opened the application right after iOS 7.0.4 update and while accessing a file it got stuck, som

  • G60t-200 CD/DVD drive won't read XP discs

    I recently re-installed Windows 7 Home Premium after I had a blue screen crash forcing me to re-format the hard drive on a g-60t-200. I've installed all the recommended Windows updates as well as all the HP updates for the g60t-200 model that I have

  • My Itouch keeps saying "connect to Itunes"

    I connected to itunes and updated itunes, and it said my itouch needed to be restored, but gives an error message when i try to do that. the ipouch wont get off the 'connect to itunes' scrren. the other night i charged it and it magically worked...fo

  • Lightroom CC issues

    I have installed Lightroom CC on a 2009 21.5" iMac running Yosemite, 16Gb RAM, NVIDIA GeForce 9400 256MB. I got past the initial installation issue by the suggested method but Lightroom crashes frequently. I have re-installed and this is still the ca

  • Firefox hello is not available im the Mobile version

    I am not able to find Firefox hello icon in the mobile version of Firefox browser. Is Firefox hello available for android? If so where to find the icon?