How? load imgaes into a movieclip

Hi,
I like to load some images into movieclip using actionscript. I am doing this because I use flex not flash. Does anybody know how it can be done?

No, that would end up loading over what you already load since you have only the one Loader.  A single Loader can only hold a single loaded file.  So in your loop you need to create new loaders for each image.  You would need to use something more like...
var myArray:Array = ["img1.jpgh","img2.jpg","img3.jpg","img4.jpgh","img5.jpg"];
var mc:MovieClip = new MovieClip();
for(var i=0; i<myArray.length; i++){
     var loadit:Loader = new Loader();
     loadit.load(new URLRequest(myArray[i]));
     mc.addChild(loadit);
addChild(mc);
The setInterval code you showed at the end will not work, mainly because the MovieClip you created dynamically does not have anything in frames that you could gotoAndPlay.

Similar Messages

  • Load SWF into empty movieClip?

    Hello,
    Could anyone please point me in the right direction to find
    out how to load an external SWF into an already existing movieClip
    instance that is already placed on the stage? This is the way I've
    always worked in AS2, but I can't find how to do it in AS3. Can
    anyone point me to an example where URLRequest works with a
    specified movieClip instance?
    Thank you!

    I understand why you might think I was ignoring your advice,
    but this isn't the case. You're expertise is much valued and
    respected.
    My purpose for continuing to experiment with loading into a
    movieClip was an attempt to find an easy way to layer the SWF
    behind other elements, but as you know, although it works for this
    purpose, it doesn't allow control of the loaded SWF from the main
    timeline. For others struggling to learn as I am, here's a link
    where I found the answer to my question above:
    http://www.hostingforum.ca/776586-as3-controlling-loaded-swf.html
    The transition to AS3 is not as easy for some as for others,
    and there are new concepts to understand.
    Don't know what "nvm" means... curious, but might be better
    off not knowing ;) Thanks again for all the help you offer to all
    of us who are struggling.

  • Loading video into existing movieclip

    Hi all,
    I am using the following code to load an external flv.
    var video:Video = new Video();
    addChild(video);
    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    ns.client = {onMetaData:ns_onMetaData, onCuePoint:ns_onCuePoint};
    function ns_onMetaData(item:Object):void {
    // video.width = 370;
    // video.height = 250;
    video.x = 525;
    video.y = 88;
    function ns_onCuePoint(item:Object):void {
    video.attachNetStream(ns);
    ns.play("sfmekransu.flv");
    But i want the movie to be loaded into my movie clip object that already created. How can i do it?

    Hi,
    add the video to your movieclip:
    movieclip.addChild(video);
    Warm Regards
    Deepanjan Das
    http://deepanjandas.wordpress.com/

  • How load text into dynamic text boxes from external file?

    hi all,
    my animation is very simple - a background image and 2 text boxes.  one of the textboxes shows a large word, which crossfades to another word, with a total of about 12 words (showing one at a time in different text boxes fading in & out in the same spot).
    i need a way to have the text be imported dynamically via xml or json (xml preferred).  this article is a good start, but i noticed he's putting all of the text into one box - i need separate strings put into separate boxes from the xml.
    Chris Gannon - Loading XML via AJAX into Adobe Edge
    he uses
    var outputField = $(this.lookupSelector(“xmlOutput”));
    for his text box.  what would be the best way to revise this code to include all my individual strings to be loaded into my individual text boxes?  thinking an array might work, but my js skills are limited.
    any other suggestions or tutorials you could point me to would be appreciated.
    thanks!!

    thanks joel_pau !
    this is helpful in seeing how the array is created, but after giving it a go I became a little confused.
    i wound up trying it again based on the example i linked out to previously, but it's not adding the text from my xml file when previewing.
    here's the code i'm using in edge animate on my stage.  something must be wrong somewhere.  let me know if you have any suggestions on this.
    // insert code to be run when the composition is fully loaded here
    // here i'm assigning a variable to each one of my textboxes at they're named in my edge animate comp
    var outputField1 = $(this.lookupSelector("helps2"));
    var outputField2 = $(this.lookupSelector("communicate"));
    var outputField3 = $(this.lookupSelector("experience"));
    var outputField4 = $(this.lookupSelector("interact"));
    var outputField5 = $(this.lookupSelector("understand"));
    var outputField6 = $(this.lookupSelector("overcome"));
    var outputField7 = $(this.lookupSelector("flourish"));
    var outputField8 = $(this.lookupSelector("collab"));
    var outputField9 = $(this.lookupSelector("trust"));
    var outputField10 = $(this.lookupSelector("grow"));
    var outputField11 = $(this.lookupSelector("engage"));
    var outputField12 = $(this.lookupSelector("survive"));
    var outputField13 = $(this.lookupSelector("thrive"));
    var outputField14 = $(this.lookupSelector("evolve"));
    var outputField15 = $(this.lookupSelector("connect"));
    var outputField16 = $(this.lookupSelector("achieve"));
    $.ajax({   
        type: "GET",
        url: "myxmlfile.xml",
        dataType: "xml",
        success: function(xml) {
    //here i'm trying to load the the text in my xml file into my textboxes in edge animate.  'txt1, txt2, txt3' are the tags in my xml file
            outputField1 = $(xml).find('txt1').text();
            outputField2 = $(xml).find('txt2').text();
            outputField3 = $(xml).find('txt3').text();
            outputField4 = $(xml).find('txt4').text();
            outputField5 = $(xml).find('txt5').text();
            outputField6 = $(xml).find('txt6').text();
            outputField7 = $(xml).find('txt7').text();
            outputField8 = $(xml).find('txt8').text();
            outputField9 = $(xml).find('txt9').text();
            outputField10 = $(xml).find('txt10').text();
            outputField11 = $(xml).find('txt11').text();
            outputField12 = $(xml).find('txt12').text();
            outputField13 = $(xml).find('txt13').text();
            outputField14 = $(xml).find('txt14').text();
            outputField15 = $(xml).find('txt15').text();
            outputField16 = $(xml).find('txt16').text();
    but nothing happens on preview.  my textboxes still contain the original text that lives in my comp.

  • How to dynamically load images into Flash

    I have a movie clip on the stage that I want to dynamically
    load images into (that constantly change), how would I go about
    doing this? Thanks.

    Use the Loader class to load in images.
    Then use addChild to add the Loader class into your MovieClip
    on the stage.
    As far as &amp;quot;constantly change&amp;quot; what
    do you mean by that? You could use setInterval, ther enterFrame
    event, or any other means to trigger a new image to be loaded into
    the Loader instance.
    Finally, you can use the Tween class to create some nice
    effects for the images (fade it, blur in, photo blend, masks,
    etc)

  • Load different thumbnails into different movieclips

    I'm creating a gallery and having a problem loading thumbnails into different MovieClips. I have all the MCs stored into an Array. I could load them if I wanted to type out:
    var thumbLoader1:Loader = new Loader();
    movieClipName1.addChild(thumbLoader1);
    but I would think there's a more dynamic way. Right now Im stuck at:
    var imageThumbNames:Array = new Array
    function photoLoaded(event:Event):void
        trace ("photo loaded");
        trace (xmlData.Person.length());
        imageThumbNames[photoNumberLoaded] = "image" + photoNumberLoaded;
        var image:Bitmap = event.target.content as Bitmap;
        image.smoothing = true;
        thumbHolderArray[photoNumberLoaded].addChild(image);
        if (photoNumberLoaded < xmlData.Person.length() && photoNumberLoaded < numberOfThumbs)
            photoNumberLoaded += 1;
            addThumbs();
    I tried switcing the var "image" with a name from the "imageThumbNames" array but that would've been too easy. Any help is greatly appreciated.

    var thumbLoader1:Loader = new Loader();
    movieClipName1.addChild(thumbLoader1);
    var imageThumbNames:Array = [your image files];  // populate in for-loop
    var photoNumberLoaded:uint=0;
    addThumbs();
    function photoLoaded(event:Event):void
        trace ("photo loaded");
        trace (xmlData.Person.length());
        //imageThumbNames[photoNumberLoaded] = "image" + photoNumberLoaded;
        var image:Bitmap = event.target.content as Bitmap;
        image.smoothing = true;
    //not sure if this is the right thing to add to add these loaders to
        thumbHolderArray[photoNumberLoaded].addChild(mc.getChildAt(0));
    photoNumberLoaded += 1;
        if (photoNumberLoaded < xmlData.Person.length() && photoNumberLoaded < numberOfThumbs)
            addThumbs();
    var mc:MovieClip=new MovieClip();
    function addThumbs(){
    mc["loader_"+photoNumberLoaded]=new Loader();
    var urlR:URLRequest=new URLRequest(imageThumbNames[photoNumberLoaded]);
    mc["loader_"+photoNumberLoaded].addEventListener(Event.COMPLETE,photoLoaded);
    mc["loader_"+photoNumberLoaded].load(urlR);

  • Making a loaded swf-file loading images into the movie..

    Trying to convert my problem from norwegian into english
    isn't always that easy... :)
    Anyway..
    I've created som cool buttons that I want to be loaded into a
    movie (let's call i MainMovie.swf) and from there I want the
    buttons to be able to load images into a movieclip (ImageContainer)
    inside the MainMovie.swf.
    Is it possible to make the MainMovie.swf communicate with the
    the loaded buttons (each button is a swf-file containing the
    actionscript, objects, etc.) so when the buttons are clicked they
    load different images into the ImageContainer?
    My idea here is to include an as.file into the MainMovie.swf
    as well containing the url's to the images that I want to be loaded
    into ImageContainer.
    I've tried to create a button on a layer above the buttons
    that's loaded into the MainMovie.swf but I end up with the loaded
    buttons not working properlu because of the button that I've
    created and placed above them.
    Now, I don't want the url's inside the buttons thats loaded
    into the MainMovie.swf as I want the ability to be able to replace
    those buttons-files without having to use too much time writing the
    url's in each button.
    Thanks folks.

    are all your swfs using as3 or as2? if as3, you won't be
    loading into a movieclip: you'll use a loader instance and you can
    reference (or communictae with) the loaded as3 objects using the
    content property of your loader once you cast it as a
    movieclip.

  • Help with AS3, loading multiple files into a movieclip in specific order in scrollbar

    Hello! I am in need of some advice. We are trying to build a site with these features:
    Our site will be built in Actionscript 3.
    1. A navigation menu that, when a button is clicked, will scroll the site quickly to a specific Y position using swfaddress.
    2. The entire site is controlled by a flash scroll bar, which will be scrolling a single movieclip.
        2A. The movieclip will load content corresponding to the navigation categories, all which is organized into zipped files (using this to extract the contents of each section, example: about.zip for the about         section of the site)
        2B. The movieclip will load multiple zipped files one by one that correspond to the navigation, in order, making the site appear to be very tall.
    **What we are in need of is understanding how to load multiple zipped files into a movie clip, in a specific order, and having them scroll between one another through the navigation. The separate navigation categories can be in movieclips instead of zipped files if that is easier.
    Here is a reference of something that works like this: http://swfc-shanghai.com/#/about/

    Hello kglad! I have set aside the idea of using zipped files, and am now just using multiple external swfs that I'd like to load into the movieclip in a specific order. Any thoughts?
    I'm new to AS3, and I'm  attempting to create a scrolling movieclip that will load multiple  external files, in order, into that movieclip. I'm using XML as well. At  this point, nothing is loading into my movieclip (contentMain) and it's  a bit frustrating! Thank you for your help!
    Current error: 1180: Call to a possibly undefined method load.
    AS3:
    //XML Loader
    var myXML:XML = new XML();
    myXML.ignoreWhite = true;
    myXML.load ("master.xml");
    myXML.onLoad =function(sucess) {
       if (sucess) {
    contentMain.loadAll();{
         load("1_Overview.swf")
         load("2_Webcam.swf")
         load("3_Twounion.swf")
         load("4_Oneunion.swf")
         load("5_Retail.swf")
         load("6_Nearby.swf")
         load("7_Courtyard.swf")
         load("8_Map.swf")
         load("9_Conference.swf")
         load("10_News.swf")
         load("11_Sustainability.swf")
         load("12_Contact.swf")
    addEventListener("complete",onLoad)
    onLoad();{
    //load all
         }else {
             trace("ERROR LOADING XML");

  • Controling a loaded swf into movieClip

    help!!
    i have loaded a {slide swf} into a movieClip .. on stage ..
    using the
    var loader:MovieClipLoader();
    using a button movie clip the is embeded into a seperate swf
    file that is loaded in at run time
    but the {slide swf} is runing a Interval that i need to clare
    ... so is there a way to talk to swf file after you load it into a
    movie Clip how do you address that

    var kglad : Master = new Master();
    Kglad .onReply=function(){
    " you are on to somthing big [ only the second picture fade
    in and thats where it stop ] it deos not seem to bee loading any
    more ... but when you click the next _btn.
    the caption keep changing ... but pictures don't change
    "........ i am sending you a better view of what ihave
    done<<<<<<<<<<start... // create
    variables
    var x:XML = new XML();
    x.ignoreWhite = true;
    var urls:Array = new Array();
    var captions:Array = new Array();
    var captions2:Array = new Array();
    var whoIsOn:Number;
    //XMl function
    x.onLoad = function() {
    var photos:Array = this.firstChild.childNodes;
    for (i=0; i<photos.length; i++) {
    urls.push(photos
    .attributes.url);
    captions.push(photos.attributes.caption);
    captions2.push(photos
    .attributes.caption2);
    holder.loadMovie(urls[0]);
    caption.text = captions[0];
    caption2.text = captions2[0];
    whoIsOn = 0;
    //Load XML
    x.load("pics/kingslandMarks/lmlist.xml");
    // The Button envents
    previous.onRelease = function() {
    clearInterval(nInterval);
    if (whoIsOn>0) {
    whoIsOn--;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    next.onRelease = function() {
    if (whoIsOn<urls.length-1) {
    whoIsOn++;
    clearInterval(transitionI);
    transitionI = setInterval(transitionF, 50, wholsOn);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    function transitionF(index) {
    if (!fadedOut) {
    holder._alpha -= 4;
    if (holder._alpha<0) {
    fadedOut = 1;
    holder._visible = 0;
    } else {
    if (!loadStart) {
    holder.loadMovie(urls[whoIsOn]);
    loadStart = 1;
    if (!loadComplete) {
    if (holder.getBytesLoaded()>0 &&
    holder.getBytesLoaded()>=holder.getBytesTotal()) {
    holder._visible = true;
    loadComplete = 1;
    holder._alpha = 0;
    } else {
    holder._alpha += 4;
    if (holder._alpha>=100) {
    clearInterval(transitionI);
    /*next.onRelease = function() {
    clearInterval(nInterval);
    if (whoIsOn<urls.length-1) {
    whoIsOn++;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    var s;
    //Experimenting with auto play slide show
    var nInterval:Number;
    autoPlay();
    function autoPlay() {
    function neXt():Void {
    if (whoIsOn<urls.length-1) {
    whoIsOn++;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    if (whoIsOn == urls.length) {
    clearInterval(nInterval);
    whoIsOn = 1;
    function prEv() {
    if (whoIsOn>0) {
    whoIsOn--;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    auto.onRelease = function() {
    nInterval = setInterval(neXt, 2000);
    this._visible = false;
    sTop._visible = true;
    if (whoIsOn<urls.length-1) {
    whoIsOn++;
    holder.loadMovie(urls[whoIsOn]);
    caption.text = captions[whoIsOn];
    caption2.text = captions2[whoIsOn];
    sTop.onRelease = function() {
    clearInterval(nInterval);
    this._visible = false;
    auto._visible = true;
    //try to fade the movieClip holder
    function fade():Void {
    holder._alpha -= 5;
    if (holder._alpha == 20) {
    holder._alpha = 100;

  • How can i load file into database from client-side to server-side

    i want to upload file from client-side to server-side, i use the following code to load blob into database.
    if the file is in the server-side, it can work, but if it in the client-side, it said that the system cannot find the file. i think it only will search the file is in the server-side or not, it will not search the client-side.
    how can i solve it without upload the file to the server first, then load it into database??
    try
    ResultSet rset = null;
    PreparedStatement pstmt =
    conn.prepareStatement ("insert into docs values (? , EMPTY_BLOB())");
    pstmt.setInt (1, docId);
    pstmt.execute ();
    // Open the destination blob:
    pstmt.setInt (1, docId);
    rset = pstmt.executeQuery (
    "SELECT content FROM docs WHERE id = ? FOR UPDATE");
    BLOB dest_lob = null;
    if (rset.next()) {
    dest_lob = ((OracleResultSet)rset).getBLOB (1);
    // Declare a file handler for the input file
    File binaryFile = new File (fileName);
    FileInputStream istream = new FileInputStream (binaryFile);
    // Create an OutputStram object to write the BLOB as a stream
    OutputStream ostream = dest_lob.getBinaryOutputStream();
    // Create a tempory buffer
    byte[] buffer = new byte[1024];
    int length = 0;
    // Use the read() method to read the file to the byte
    // array buffer, then use the write() method to write it to
    // the BLOB.
    while ((length = istream.read(buffer)) != -1)
    ostream.write(buffer, 0, length);
    pstmt.close();
    // Close all streams and file handles:
    istream.close();
    ostream.flush();
    ostream.close();
    //dest_lob.close();
    // Commit the transaction:
    conn.commit();
    conn.close();
    } catch (SQLException e) {

    Hi,
    Without some more details of the configuration, its difficult to know
    what's happening here. For example, what do you mean by client side
    and server side, and where are you running the upload Java application?
    If you always run the application on the database server system, but can't
    open the file on a different machine, then it sounds like a file protection
    problem that isn't really connected with the database at all. That is to
    say, if the new FileInputStream (binaryFile) statement fails, then its not
    really a database problem, but a file protection issue. On the other hand,
    I can't explain what's happening if you run the program on the same machine
    as the document file (client machine), but you can't write the data to the
    server, assuming the JDBC connection string is set correctly to connect to
    the appropriate database server.
    If you can provide some more information, we'll try to help.
    Simon
    null

  • I am able to download all the album I bought from itune store. The album contains 13 songs but 4 of them would not load up into my ipod. How can I fix that?

    I am not able to download all the album I bought from itune store. The album contains 13 songs but 4 of them would not load up into my ipod. An error code will pop up notified me that "my Ipod cannot convert some of the file" How can I fix that?

    Hi there mayway3000,
    You may find the troubleshooting steps in the article below helpful.
    iPod does not play content purchased from the iTunes Store
    http://support.apple.com/kb/TS1510
    -Griff W.

  • How do I find bad music files?  I have thousands of files, but some are bad.  When I try to load them into iTunes, it just spins.  I need a routine to identify and remove the bad files.  Any ideas?

    How do I find bad music files?  I have thousands of files, but some are bad.  When I try to load them into iTunes, it just spins.  I need a routine to identify and remove the bad files.  Any ideas?

    Hi ajoddo20,
    Welcome to the Apple Support Communities!
    You can use Home Sharing to import music and other media from one computer to another. Please use the instructions and information located in the attached article for information on how to complete the process. 
    iTunes 11 for Mac: Use Home Sharing to import items from another iTunes library
    Cheers,
    Joe 

  • How can I load data into table with SQL*LOADER

    how can I load data into table with SQL*LOADER
    when column data length more than 255 bytes?
    when column exceed 255 ,data can not be insert into table by SQL*LOADER
    CREATE TABLE A (
    A VARCHAR2 ( 10 ) ,
    B VARCHAR2 ( 10 ) ,
    C VARCHAR2 ( 10 ) ,
    E VARCHAR2 ( 2000 ) );
    control file:
    load data
    append into table A
    fields terminated by X'09'
    (A , B , C , E )
    SQL*LOADER command:
    sqlldr test/test control=A_ctl.txt data=A.xls log=b.log
    datafile:
    column E is more than 255bytes
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)

    Check this out.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch06.htm#1006961

  • How to create keyboard for Load Files into Photoshop

    does anyone know if there is a way to create or is there an existing keyboard shortcut to Load Files into Photoshop from Bridge?

    I should have been more specifc.
    Much like in bridge-tools-photoshop-load files into photoshop, I want to load multiple files into a layered photoshop document.
    Can't seem to find a keyboard shortcut for this action. Though I don't know how to write scripts very well but there are far too many keyboard shortcut posts I've searched and can't seem to find a way.
    thanks

  • How to  load data into user tables using DIAPIs?

    Hi,
    I have created an user table using UserTablesMD object.
    But I don't have know how to load data into this user table. I guess I have to use UserTable object for that. But I still don't know how to put some data in particular column.
    Can somebody please help me with this?
    I would appreciate if somebody can share their code in this regard.
    Thank you,
    Sudha

    You can try this code:
    Dim lRetCode As Long
    Dim userTable As SAPbobsCOM.UserTable
    userTable = pCompany.UserTables.Item("My_Table")
    'First row in the @My_Table table
    userTable.Code = "A1"
    userTable.Name = "A.1"
    userTable.UserFields.Fields.Item("U_1stF").Value = "First row value"
    userTable.Add()
    'Second row in the @My_Table table
    userTable.Code = "A2"
    userTable.Name = "A.2"
    userTable.UserFields.Fields.Item("U_1stF").Value = "Second row value"
    userTable.Add()
    This way I have added 2 lines in my table.
    Hope it helps
    Trinidad.

Maybe you are looking for

  • How can i make a application-form without PHP or How can i make Mailto working properly?

    Dear All, I'm working on a application-form for my website. As you can see on the added screenshot. My problem is that is can't use PHP, as my host doesn't support this. I have tried to make it as a mailto (GET) form but, as i already read online, it

  • Clips lose pixel aspect ratio setting after relinking

    hi there, after reopening a project from a backup drive I had to relink all my media. no problem with that... but after relinking all aspect ratios were lost. files are 2048x1536 anamorph (manually) set to an aspect of 1.33 and then scaled down to 19

  • Function call SALI_MT_GET_TID_BY_NAME failed

    All, We have the Central System Monitoring set up on the SOM to monitor Red Alerts. There is a current Red Alert associated with Log Attributes under the following path: SOM\CCMS database self-monitoring\...     Database self-monitoring         SQL S

  • Customizing the InfoView

    Does anyone have an example of how they have customized their log on page and added a custom logo to Infoview in XIR3.1? Prior to upgrading to XIR3.1 we had scripts that would modify the launchpad.html, web.xml, and the logon.jsp files to add our log

  • What's the official word on "iSIGHT"?  Does it work with msn or no?

    I keep reading various reviews...some people say yes..others say no. Does anyone know for a fact if isight works with msn? I've seen the camera and it looks fabulous. And...if it does work, how easy is it to hook it up? Is it simply 'plug and play'?