Adding Movieclips from Library

Hi, I want to add 20 Moviclips at a time by Loop, from
Library. so can any body tell me how could it possible.
I can add one MovieClip just by as:
var mc:Movieclip = new MovieName();
But i need some string type method which can add multiple
MovieClips from Library at a time.
in AS2 there was a method for attchMovie, in which we can add
Linkage name with Name0, Name1, Name2 as 'Name'+i.....
So is it also possible in AS3 or not?

Hi NedWebs,
Atleast now i found the solution of adding multiple diffrent
MovieClips from Library by AS3 code:
Code is like this
package com{
import flash.display.*;
import flash.utils.*;
public class Main extends MovieClip {
public function Main() {
for (var i=0;i<3;i++) {
addMovieFromLibrary('Sample'+i);
function addMovieFromLibrary(mcIName:String) {
var tMC:Class = getDefinitionByName(mcIName) as Class;
var newMc:MovieClip = new tMC() as MovieClip;
newMc.x = 1+Math.random()*170;
addChild(newMc);
For above code you just need to place Smaple0, Sample1,
Sample2 in library.
Nothing is impossible :)

Similar Messages

  • Exporting and adding swatches from library

    Good Afternoon,
    I followed the tutorial at the below URL on creating your own customized swatches within your saved library and then adding them to your new site.  After adding them to the new site, they should automatically appear in the swatch window, however they are not showing up, can you please assist?
    http://helpx.adobe.com/muse/using/organizing-reusing-design-elements-using-library-panel.h tml#Creating custom swatches

    Upon investigating this further at my end, we found the issue was that I had created the rectangles in the source Muse file with custom colors - but DID NOT have those colors in the swatches panel. That caused the swatches to be not exported with the MULIB.
    Once I created swatches for my custom colors in the source Muse file and then exported rectangles with those color fills via Library, I was able to see the swatches added to my target Muse installation upon importing the MULIB.
    Let me know if your issue is similar. Also share the exact steps that you are following if your case is different.
    Cheers,
    Vikas

  • I have added music from my CD library to iTunes but now my iPod will not sync.  Message says not enough free space.  How can I sync only a portion of my library to my 8Gb Nano?

    I have added music from my CD library to iTunes on my PC.  I now have too many songs in my iTunes and I have insufficient space in my 8 Gb Nano.  I am unable to sync my iPod now.  How can I get my iPod to sync?  I only want a portion of my songs on the Nano.

    Hi wisemra,
    First, make sure your iTunes does not attempt to sync automatically. Open iTunes, and select Preferences under the iTunes menu item:
    Then, once you have hooked up your device and selected it, you should see the device Profile pages to the right. Select the Music tab:
    Once you get to the Music detail screen, you will see the option to "Sync Music". You can then select "Sync Entire Music Library" or you can select "Sync Selected Playlists, Artists, Albums, Genres". Click on the second one. Then, below, you can select which of your music from the library you want on your device:
    Your will show a list of your music. Mine doesn't because I sync with an iTunes library on different computer, but once you have selected the options I have shown you, you will see the music listed. Just pick what you want on your device and then click "Sync" at the bottom.
    Cheers,
    GB

  • Is it possible to call a movieClip from the Flash library using XML?

    Instead of using "test_1.swf" or "test_2.jpg" in the <IMAGE> tags shown below, we are wanting to call a movieClip from the same library as the .FLA via XML.
    Is this possible using XML and AS3?
    < ?xml version="1.0" encoding="UTF-8"?>
    < all>
         < GROUP>
              <IMAGE>test_1.swf</IMAGE>
              <QUESTION>Question example #1</QUESTION>
              <OPTION1>Option A example</OPTION1>
              <OPTION2>Option B example/OPTION2>
              <OPTION3>Option C example</OPTION3>
              <IMAGE>test_2.jpg</IMAGE> 
              <QUESTION>Question example #2</QUESTION>
              <OPTION1>Option A example</OPTION1>
              <OPTION2>Option B example/OPTION2>
              <OPTION3>Option C example</OPTION3>
         < /GROUP>
    < /all>

    data.xml:
    < ?xml version="1.0" encoding="UTF-8"?>
    < all>
         < GROUP>
              <IMAGE>MC1</IMAGE>
              <QUESTION>Question example #1</QUESTION>
              <OPTION1>Option A example</OPTION1>
              <OPTION2>Option B example/OPTION2>
              <OPTION3>Option C example</OPTION3>
              <IMAGE>MC2</IMAGE> 
              <QUESTION>Question example #2</QUESTION>
              <OPTION1>Option A example</OPTION1>
              <OPTION2>Option B example/OPTION2>
              <OPTION3>Option C example</OPTION3>
         < /GROUP>
    < /all>
    // a.s.
    var urlLoader:URLLoader=new URLLoader();
    urlLoader.addEventListener(Event.COMPLETE,completeF);
    urlLoader.load(new URLRequest("data.xml"));
    function completeF(e:Event):void{
    var xml:XML=XML(e.data);
    var instance:*=stringToClassInstanceF(xml.GROUP.IMAGE[0]);
    addChild(instance);
    function stringToClassInstanceF(s:String):*{
    var C:Class=Class(getDefinitionByName(s));
    return new C();

  • Randomly generating movieClips from the library onto the stage

    Hi
    I am trying to call objects from the library for a collection game.
    Having major issues with the best way to assign the good objects and the bad objects to later update a score.
    Can anyone help me with how i can first assign the movieClips from the library into a good and bad array and then after randomally fill the stage with them.
    Regards
    James

    again and always when testing in the ide, use the trace() function to debug your code:
    public function checkCollisions()
                                  for (var i:int = objects.length - 1; i >= 0; i--)
                                            if (Point.distance(new Point(gamesprite.car.x,gamesprite.car.y),new Point(objects[i].x,objects[i].y)) < pickupDistance)
                                                      if (objects[i].hitTestobjects(gamesprite.car))
                                                                if (objects[i].typestr == "good")
                                                                          score +=  10;
                                                                          trace(score);
                                                                else
                                                                          score -=  4;
                                                                          trace(score);
                                                                if (score < 0)
                                                                          score = 0;
                                                                scoreDisplay.text = String(score);
    trace(scoreDisplay.text);
                                                                removeChild(objects[i]);
                                                                objects.splice(i,1);
    if you don't see any trace() output, you can conclude that part of your code is not executing.  if see trace output, you can don't see the same value in scoreDisplay, you can conclude you're not seeing your scoreDisplay textfield.

  • Problem calling simplebutton from library

    Hi guys,
    I'd like to ask for your assistance. I have a problem calling
    SimpleButton from library. I already checked the Linkage:Export for
    actionscript but still an error appear "Call to a possibly
    undefined method OkBtn". I'm just wondering because this method
    works on my MovieClips except for SimpleButtons. Is there another
    way to call SimpleButtons?
    Here's my code calling MovieClip:
    var mc:MovieClip = new ourProduct();
    and same in calling my SimpleButton:
    var myOkBtn:SimpleButton = new OkBtn();
    please help.
    Thank you very much

    Hi again,
    Since I could not call my SimpleButton inside the library, I
    was thinking of putting my button inside the movieclip and call
    that clip inside my library.
    On my stage, I called
    underConstructionPane() movieclip. This
    underConstructionPane contains
    myOkBtn which previously I wanted to call but as a work
    around, I just put it inside
    underConstructionPane movieclip with instance name of
    okBtn. I added eventHandler on
    okBtn which supposed to call
    showHome() function outside
    underConstructionPane.
    showHome() was declared on the stage or root (I don't know
    the correct term. hehehe
    sorry.) but I don't know how to call that function.
    I tried this:
    var home = new showHome();
    but it won't work.
    Please help me
    Thank you.

  • A problem with Itunes and adding music to library

    I've been using my Ipod touch for about a month now (recently purchased). I first connected my Ipod to my laptop, because my desktop needed a format and reinstall of the OS, so I wanted to be slightly organized with it. I finally got around to formatting the desktop to WinXP pro, and have all my programs installed successfully.
    Here's the issue:
    With my laptop, I could start Itunes, and I did NOT have every song I have as my library, only a few songs that I personally selected and added to library (by clicking on "CTRL+Highligh" or File-->Add file to library). When I did that, I could hold down CTRL and highlight up to 15-20 songs at once, and have them show up in my library as added, then sync them to my Touch.
    Since coming to my desktop with my Ipod, and moving all my music from my laptop over to my desktops C: drive, I've hooked up my Ipod and (of course installed Itunes) authorized my desktop for my Touch.
    I begain selecting the music I wanted...My directory setup is as follows:
    My Music: folders inside of
    Itunes directory
    Mp3 Directory
    My Itunes settings are selected as My Music-->Itunes as the folder. I open Itunes, select add song to library, and it only allows me to highlight UP to 5 songs at once and add them. Any number between 1 and 5 songs will add to my library just fine. If i try to select over 5 songs, like 6-20 songs at once (using CTRL) it does nothing, and doesnt place any of the selected songs in my library. It will allow me to select individual songs just fine, and like I said, I can select UP TO 5 songs, highlighted with CTRL, and they show up just fine (all 5 songs will show in the library.)
    Any number of songs selected with CTRL over 5, does nothing.
    I dont understand why, when I used this very technique on my laptop, and I could select up to 30 songs at once (using ctrl+highlight) and they would ALL show up as they are supposed to. Everything is nearly the same on here, my settings are all pretty much the same as my laptop's settings were...anyone have any ideas? this has been bugging me all morning, and I've spent so much time fooling with it that I only have 56 songs out of 6,000 on my Ipod touch (I also decided to rid myself of music I didnt listen to and restored/formatted my ipod so I could start over)...I need more than 56 songs, but I dont want to do them 1 or 2 at a time, then go back and have to hit CTRL+O or File--->add file to library.
    What causes me to be limited to 5 or less songs per time to add to my library?

    Because I wasn't aware that the library could be "taken" from pc to pc. The processor on my desktop is also hyper-threaded, which simulates it having 2 processors..and moving file NAMES, not moving the files into the library is NOT a processor intensive function. It's actually just taking the file location - directory, and name, and making it show in the library..not moving the actual file itself and making a copy of it in the Itunes folder. I do NOT allow itunes to make copies of files that it keeps in the library (I uncheck allow Itunes to organize and make copies of files added to library).
    So adding to my library is as simple as making the library show the file name, and pointing to the location on disk, not actually making a copy of the file in the background and placing it into a folder inside the Itunes folder.
    Had I KNOWN I could take my library off the desktop and move it, I would've made it easier on myself, but I thought I posted that I just recently bought this Ipod touch (about a month ago).

  • I used scripting brigde to add a movie that has size bigger than 5GB, exactly after two minutes iTunes return a failed, but the processing of the file is actually added to iTunes Library successfully. The copying take more than 5 minutes to complete. Why?

    I used scripting brigde to add a movie that has size bigger than 5GB, exactly after two minutes iTunes return a failed, but the processing of the file is actually added to iTunes Library successfully. The copying take more than 5 minutes to complete. Why the iTunes Scripting Brigde returned failed when it is actually success? It occurred exactly 2 minutes after submit the request to Scripting Brigde. Is this 2 minutes related to the Apple Event time out? if it does, how do I get around this problem? thx

    I can tell you that this is some of the absolutely worst customer service I have ever dealt with. I found out from a store employee that when they are really busy with calls, they have third party companies taking overflow calls. One of those companies is Xerox. What can a Xerox call center rep possibly be able to authorize on a Verizon account?  I'm Sure there is a ton of misinformation out there due to this. They don't note the accounts properly or so everyone can see them. I have been transferred before and have asked if they work for Verizon or a third party also and was refused an answer so, apparently they aren't required to disclose that information. I spent a long time in the store on my last visit and it's not just customers that get the runaround. It happens to the store employees as well and it's beyond frustrating.

  • HT1391 how do I find free downloads that I have added to my library that are not showing up in the library on in icloud?

    How do I find free downloads that I hve added to my library that are not in my library or in icloud?

    Hi revsteph,
    If you have songs that you know you have purchased, but are not showing up in your iTunes Libarary, you may want to see if you can redownload them. You may find the following article helpful:
    Apple Support: Downloading past purchases from the App Store, iBookstore, and iTunes Store
    http://support.apple.com/kb/ht2519
    Cheers,
    - Brenden

  • Loading from library conflicts with loading external swf

    I'm very new to ActionScript, so this might be incredibly basic. However, I've Googled and read myself into a coma and I'm not finding a solution.
    I have a movie with 6 navigation buttons.  Four of them load external .swf slideshows, and they work fine - as each file loads, the previous one clears the stage, etc.  The other button that I currently have set up is loading, from the library, an image.  The problem I'm having is that the slideshows replace each other on the stage - they're not stacking, they're replacing - but when the user selects the button that loads the image, the image overlays the last-selected slideshow.  If the user selects the image first, the image is visible when two of the external files transition.  Because of that 6th button, which is not yet even started, it's not desirable to me to simply set up the single image as another external file; if it's at all possible, I need to be able to pull from a library file when I build that last button.
    What I'd like to do - because there is no logical order that the buttons should be selected in - is figure out how to tell every button to remove the image file on click.  I've tried using this in the four buttons that link to the slideshows, to deal with the image (that's the one called quoteImage):
         if(myLoader != null && contains(quoteImage)){
            myLoader.removeChild(quoteImage);
    which has the advantage of not giving me any errors, but doesn't actually fix my problem.  I've tried many, many other things, and I'm just really stumped on what exactly I need to do to make this work the way I want it to.  Based on the fact that the books and online resources I've been using don't really cover this specific example, I suspect it might be an incredibly idiot thing to do, but I'd really like it to work this way if that's possible.
    The code as it stands, with the global variables and the first two buttons (the next three are identical to the second button and the sixth button doesn't exist) looks like this:
    var myLoader:Loader=new Loader(); 
    var quoteImage:Bitmap;
    stop();
    // Loads quoteImage from library
    btnQuotes.addEventListener(MouseEvent.CLICK, showquote);
    function showquote(event:MouseEvent):void {
    var myBitmapDataObject:myBitmapData = new myBitmapData(500, 350);
    var quoteImage:Bitmap = new Bitmap(myBitmapDataObject);
    quoteImage.x=150;
    quoteImage.y=180;
    addChild(quoteImage);
    // Loads industrial.swf from external file
    btnIndustrial.addEventListener(MouseEvent.CLICK, showindustrialcontent);
    function showindustrialcontent(event:MouseEvent):void {
    var myURL:URLRequest=new URLRequest("industrial.swf");
    myLoader.x=150;
    myLoader.y=180;
    myLoader.load(myURL);
    addChild(myLoader);
    Help is very much appreciated.

    I see now how to import and display a library class object
    using:
    var MovieClipClass:Class =
    Class(loader.contentLoaderInfo.applicationDomain.getDefinition("myLibraryAsset"))
    var movieClip:Sprite = new MovieClipClass();
    addChild(movieClip)
    But this seems to only work for SWF's published for AS3 Flash
    Player 9.
    I need to do the same for SWF's published with AS2 Flash
    Player 7.
    Any ideas?

  • Adding music from cd

    adding music from cd

    Bought a new i mac, but it doesn't have facility for CD's as they're being phased out. I still have lots of CDs with music I love on them, so want to somehow get this music into my new i mac & into my i phone for my art workshops.
    My 'old' Macbook pro can take CD's but is unstable (on its 3rd HD! hence the new i mac purchase!) so I have been unwilling to build up my itunes library on the Macbook HD as I don't trust it.
    Any suggestions would be much appreciated (as we are getting tired of hearing the same old tunes on the iphone...)

  • Accessing Swatches from library

    Hi,
    I am creating a rectangle with VBscript and AI cs3
    Set rectPath = pathItemsRef.Rectangle(300,10 , 100, 100)
    and filling its color with swatch name as
    rectPath.FillColor = garmentDoc.Swatches("Offset Squares Pattern").Color
    and is working fine.
    Now my issue how to access a swatch from library items I have created my own swatches and save it in library name say "Animal" in this library there is a swatch name say "Cheetah" can anyone help me out in accessing this swatch from library with VBscript.
    Thanks
    Girish

    Upon investigating this further at my end, we found the issue was that I had created the rectangles in the source Muse file with custom colors - but DID NOT have those colors in the swatches panel. That caused the swatches to be not exported with the MULIB.
    Once I created swatches for my custom colors in the source Muse file and then exported rectangles with those color fills via Library, I was able to see the swatches added to my target Muse installation upon importing the MULIB.
    Let me know if your issue is similar. Also share the exact steps that you are following if your case is different.
    Cheers,
    Vikas

  • Problem adding songs to library

    First of all, a couple of weeks ago I got the dreaded "corrupt library file" error message. Tried everything I could to get it back with no luck. I finally decided that I would just start from scratch and re-add all of my music to the library, and in doing so, clean it up and get it all labeled correctly once and for all.
    Fast forward to today. First time after upgrading to 7.3, I open iTunes and proceed to Add to Library... Well, it let me add one song, no problem. Then I tried to add another, and nothing. Tried adding an album, and while it popped up a window saying it was processing the tracks, they didn't get added to the library. Keep in mind that all of the music I'm trying to add to the library is already in the iTunes music folder.
    What am I dong wrong?

    for some reason the edit function is not working - so i am going to reply to my own message...I jsut tried to click on some of the mps files in the media folder that I mention above ( but not showing in itunes) and they start to play in itunes.
    also error above - i am using vista.

  • Can't copy a song from library into playlist. Screen message says "song can't be found." I know it's there, how do I access it?.

    Can't copy a song from library into playlist. Screen message says "song can't be found." I know it's there, how do I access it?.

    I fixed this issue (with help from tech support) and it involved several things.
    After adding a song to iTunes, right-click on the song in iTunes and select "Update iTunes Match."
    OR go to the iTunes menu-->Store-->Update iTunes Match.
    Maybe that's the reason, it just hadn't updated to the cloud.
    OR maybe it's not a high-enough bitrate file.   This happens to me because most of my tunes are home-recorded.
    Sometimes converting to .mp3 or Create AAC version might work. (You do this with a right-click in iTunes, and then you will want to remove the original file from iTunes.)
    There is an iTunes Preferences setting, under General Preferences called Import Settings.  Try setting it to AAC Encoder and iTunes Plus.   That (I think) causes imports to be slightly better quality.
    Good luck!  The tech support person at Apple is requesting that a knowlege-base article be written about this.

  • Locking clips, adding slideshows from iphoto to imovie and reverting clips.

    I have a few questions about imovie HD 6.
    1. I am working on adding snips of video and pictures to my imovie project. However, I have several small clips that I want to add to a single audio clip. Is there a way to lock several video clips to my audio clip? It seems as though when I try to add another 'lock' the first one disappears. (I thought of maybe splitting the audio clip up. Is there an easier way that i'm not seeing?)
    2. Is there a way to keep the quality from an iphoto slideshow after importing it into imovie. Is it even possible to import an iphoto slideshow into imovie?
    3. I had a large 1 hour clip that I split up into 20 or 25 clips. I then added some effects to some of the clips. If I decide later that I do not want a particular effect and click the 'revert to original' button. Will it revert my entire 'library' of clips that I created back into the 1 hour clip I started with?
    Thanks,
    Elly

    1. The function locks an audio clip to a video clip, not a video clip to an audio clip. So, after locking an audio clip to a video clip, if you then lock the audio clip to another video clip it will unlock the first one. That's why you are observing that the lock disappears. If you lock the audio clip to the first video clip in a series, that will keep the audio clip in place for the entire series when you slide the first clip along the time line, pushing the other video clips ahead of it. I would not split up the audio clip into several pieces, unless you intend to move or change the sequence of the individual video clips.
    2. In iMovie playback, your iPhoto images are displayed in low resolution. Therefore, your iPhoto images always will look worse in iMovie playback. However, the display in your final product DVD will look much clearer than in iMovie playback. Yes, you can export an iPhoto slide show into iMovie. The best way that I have found is to use the iPhoto file menu to export the slideshow to your desk top as a full quality Quicktime Movie (File/Export/Full Quality) and then drag that Quicktime movie into your iMovie project as one long clip. You can also drag it directly into an iDVD project as a movie.
    3. The "revert" function will operate only on the split clip that you select to revert. The remaining split off clips will remain un-reverted. For example, if you split a clip into clips A, B, and C, and then revert clip A back to the original, clip A will revert back to the entire original clip that you had split into A, B, and C. (In your case, that would be the entire one hour clip that you started with, with no effects in it.) So clip A will now also include B and C and all other clips that you may have split from the original clip. But B and C also will still remain untouched as additional separate clips. That leaves you with having to re-edit clip A to avoid having repetitious clips. Rather than using the "revert to original" function to clear an effect from a clip, instead use the "clear" function. Each time that you use the "clear" function on a clip, it will remove the last added effect from the selected clip but will not effect any of the other clips.
    I hope that I have answered your questions. I suggest that you set up a small test iMovie project and experiment with the "revert" and "clear" functions.

Maybe you are looking for

  • Error while Retrieving view data  from database

    I am running an application ,in which I have used Apache Derby as a backend with the Hibernate mapping to achieve Object Oriented mapping. I have created one view from which I want to retrieve data. When I query the view as a VIEW, I am able to achie

  • Using a "Sum" Calculated Field on a "Count" query column?

    Here's my query using the Query Report Builder: SELECT Col1, COUNT(Col1) AS Count_Column FROM Table GROUP BY Col1 It generates a report that lists all the values of column "Col1" and how many times each value was used in Col1 For instance, if Col1 co

  • Same  Material with different itemcatagory groups

    We have 3rd party manufacturers that make product for company and sometimes they send the finished product back to company and other times they will drop ship it to one of our customers. this scenario we need to have the same material with different

  • Can applications on iphone and ipad

    I have bought some applications on my ipad some months ago and I have just bought an iphone5. But I have no all the applications of my ipad which have been transfered on my iphone...just some ones. Could you help me ?

  • Load balancing via CHOC12/STS3

    Hi, our customer has a connection between 2 x 12012 via the 4 embedded channels of CHOC12/STS3 module.As every subinterface has its own ip-subnet we have 4 equal paths to every destinations. Customer wants to configure dCEF per-packet load balancing