Multiple MovieClips Loading SWF From Same Array (Posted Code)

Hey there,
I'm currently working on a project that has eight separate movieclips (for loading content) on separate layers.  I have placed code in these mc's to randomly draw from the same array of 61 different swf's.  Each mc randomizes the array just fine, but here's the problem.  The code works great for one instance, but as soon as I add the code (including renaming) to the other mc's, the swf won't load/play.  I am not getting an compiler errors, and am kinda stuck as to what the problem may be.  Here's an example of the code I'm using.  It is the same for each mc, except I'm renaming the variables as well as the instances for each mc.  Thanks for any suggestions.
Mike
//filename = new Array("screen1.swf","screen2.swf","screen3.swf","screen4.swf","screen5.swf","screen6.swf" ,"screen7.swf","screen8.swf","screen9.swf","screen10.swf","screen11.swf","screen12.swf","s creen13.swf","screen14.swf","screen15.swf","screen16.swf","screen17.swf","screen18.swf","s creen19.swf","screen20.swf","screen21.swf","screen22.swf","screen23.swf","screen24.swf","s creen25.swf","screen26.swf","screen27.swf","screen28.swf","screen29.swf","screen30.swf","s creen31.swf","screen32.swf","screen33.swf","screen34.swf","screen35.swf","screen36.swf","s creen37.swf","screen38.swf","screen39.swf","screen40.swf","screen41.swf","screen42.swf","s creen43.swf","screen44.swf","screen45.swf","screen46.swf","screen47.swf","screen48.swf","s creen49.swf","screen50.swf","screen51.swf","screen52.swf","screen53.swf","screen54.swf","s creen55.swf","screen56.swf","screen57.swf","screen58.swf","screen59.swf","screen60.swf","s creen61.swf");
//i = filename.length;
//k=random(i)
//_root.movieTarget.loadMovie(filename[k]);
//movieTarget._xscale=80;
//movieTarget._yscale=80;
var fileNames:Array = ["screen1.swf","screen2.swf","screen3.swf","screen4.swf","screen5.swf","screen6.swf","scr een7.swf","screen8.swf","screen9.swf","screen10.swf","screen11.swf","screen12.swf","screen 13.swf","screen14.swf","screen15.swf","screen16.swf","screen17.swf","screen18.swf","screen 19.swf","screen20.swf","screen21.swf","screen22.swf","screen23.swf","screen24.swf","screen 25.swf","screen26.swf","screen27.swf","screen28.swf","screen29.swf","screen30.swf","screen 31.swf","screen32.swf","screen33.swf","screen34.swf","screen35.swf","screen36.swf","screen 37.swf","screen38.swf","screen39.swf","screen40.swf","screen41.swf","screen42.swf","screen 43.swf","screen44.swf","screen45.swf","screen46.swf","screen47.swf","screen48.swf","screen 49.swf","screen50.swf","screen51.swf","screen52.swf","screen53.swf","screen54.swf","screen 55.swf","screen56.swf","screen57.swf","screen58.swf","screen59.swf","screen60.swf","screen 61.swf"]
fileNames.sort(function () {
    return Math.round(Math.random());
trace("Random array: " + fileNames);
var currentMovieNum:Number = 0    ;
this.createEmptyMovieClip("container", _root.getNextHighestDepth());
var mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
mcl.addListener(mclListener);
mclListener.onLoadInit = function(movieTarget:MovieClip) {
    trace("Preparing to play: " + fileNames[currentMovieNum]);
movieTarget.loadClip(fileNames[currentMovieNum], container);
movieTarget._xscale=80;
movieTarget._yscale=80;
this.onEnterFrame = function() {
    if (currentMovieNum == fileNames.length) {
        currentMovieNum = 0;
    } else {
        if (movieTarget._currentframe == movieTarget._totalframes) {
            mcl.loadClip(fileNames[currentMovieNum], movieTarget);
            currentMovieNum++;

Thanks for taking a look at this.  The randomizer seems to work just fine, as here is a sample output from the trace:
Random array: screen47.swf,screen2.swf,screen57.swf,screen21.swf,screen9.swf,screen49.swf,screen36.swf, screen17.swf,screen6.swf,screen59.swf,screen15.swf,screen12.swf,screen33.swf,screen25.swf, screen42.swf,screen22.swf,screen24.swf,screen40.swf,screen11.swf,screen19.swf,screen32.swf ,screen35.swf,screen7.swf,screen39.swf,screen23.swf,screen4.swf,screen1.swf,screen48.swf,s creen31.swf,screen45.swf,screen29.swf,screen18.swf,screen51.swf,screen14.swf,screen34.swf, screen10.swf,screen38.swf,screen26.swf,screen16.swf,screen13.swf,screen55.swf,screen37.swf ,screen44.swf,screen61.swf,screen43.swf,screen20.swf,screen28.swf,screen30.swf,screen56.sw f,screen50.swf,screen54.swf,screen53.swf,screen46.swf,screen58.swf,screen41.swf,screen8.sw f,screen5.swf,screen52.swf,screen3.swf,screen60.swf,screen27.swf
Might you be able to lead me down a better path?  I'm currently unable to get this to function for multiple symbols.  The previous is the code that I've placed on the first keyframe of a movieclip with an instance name of movieTarget.  Works swimmingly for one, but once the code is placed on the other symbols on different layers, it seems to only work on the lowest layer in the project.
M

Similar Messages

  • Loading external .swf from an array in  array order

    I was wondering if someone can help me out.  The code below demonstrates pulling in multiple .swf from an array and plays each one randomally when the "main .swf re-publishes each time.  I cant figure out how to play each .swf in the order that specifies in the array.
    example:  I want the main .swf to play 'clip0','clip1','clip2' in that specific order not random.
    Can someone assist me.
    stop();
    var movieArray:Array = ['clip0','clip1','clip2'];
    var loader:Loader = new Loader();
    var index:int = movieArray.length * Math.random();
    var url:String = movieArray[index] + '.swf';
    trace("Attempting to load", url);
    loader.load(new URLRequest(url));
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderComplete);
    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loaderIOError);
    addChild(loader);
    function loaderComplete(e:Event):void {
        trace("Successfully loaded", url);
    function loaderIOError(e:IOErrorEvent):void {
        trace("Failed to load", url);

    so replace:
    var index:int = movieArray.length * Math.random();
    with this:
    var index:int = 0;

  • How to effectively remove a loaded SWF from the stage?

    I can not figure out a proper coding to remove a loded SWF from the stage.
    Here is my set up.
    I have a layout segmented into labeled section. In the section labeled "products" I have a layout consisting of product images acting as buttons which bring a user to another labeled section "prdctsPopUps"
    In the "prdctsPopUps" section I have placed an instance of LoaderMax placed into an mc container. Placing LoaderMax into an mc container automatically resolved an issue of clearing loaded SWFs from stage when I come back to "products" section.
    I specified the variable in the "products" section with the following set up:
    var sourceVar_ProductsPopUps:String;
    function onClickSumix1PopUp(event:MouseEvent):void {
                        sourceVar_ProductsPopUps="prdcts_popups/sumix1-popup_tl.swf";
                        gotoAndPlay("prdctsPopUps");
    So each button has its own "....swf" URL and they all open fine and I can come back to "products" section without any issues.
    However inside the swf (which loads through LoaderMax which is placed into an mc) there are other buttons which bring a user to labeled section "xyz". Which also functions properly. It opens as it is supposed to be and without any previously loaded "...swf" on the stage.
    At the labeled section "xyz" there is a limited set of buttons repeating from section "products" which has to bring a user back to the same set up in the "prdctsPopUps" labeled section and open a corresponding "...swf" .
    However only the last opened "...swf" will appear in that section. Effectively the one which was originally opened from the "prdctsPopUps" section and not the one which was supposed to be opened from the "xyz" section.
    I can not understand why it would work from one labeled section and not from another. I can not figure out on which section which code/function needed to be placed.
    Here is the set up from a button from the "xyz" section whcih supposed to bring a user to the same "prdctsPopUps" section but to load a different "...swf"
    var sourceVar_ProductsPopUps_fromXYZ:String;
    function onClick_floralytePopUp_fromXYZ(event:MouseEvent) :void {
                        sourceVar_ProductsPopUps_fromXYZ="prdcts_popups/floralyte-popup_tl.swf";
                        gotoAndPlay("prdctsPopUps");
    Here is the code set up for the LoaderMax from the "prdctsPopUps" section:
    var loaderProductPopUps:SWFLoader = new SWFLoader(sourceVar_ProductsPopUps,
                                                                                                        estimatedBytes:5000,
                                                                                                        container:holderMovieClip,
                                                                                                        onProgress:progressHandler,
                                                                                                        onComplete:completeHandler,
                                                                                                        centerRegistration:true,
                                                                                                        alpha:1,
                                                                                                        scaleMode:"none",
                                                                                                        width:540,
                                                                                                        height:730,
                                                                                                        crop:true,
                                                                                                        autoPlay:false
    function progressHandler(event:LoaderEvent):void{
              progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;
    function completeHandler(event:LoaderEvent):void{
              var loadedImage:ContentDisplay = event.target.content;
              TweenMax.to(progressBarPopUp_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});
    loaderProductPopUps.load();
    Is there something which needs to be imported, or specific function needs to be specified in a specific labeled section?

    actually, i think you'll need to use something like:
    var loaderProductPopUps:SWFLoader;
    if ((loaderProductPopUps){
    if(loaderProductPopUps.content)){
       loaderProductPopUps.unload();
    loaderProductPopUps= new SWFLoader(sourceVar_ProductsPopUps, //the value of sourceVar_ProductsPopUps allows to load mulitple SWFs from the products page.
                                                                                                         estimatedBytes:5000 ,
                                                                                                         container:holderMov ieClip,// more convinient and easier to manage if to place the LoaderMax into an empty mc (holderMovieClip)
                                                                                                                                                                         // if not will work as well. Then the line container:holderMovieClip, has to be replaced with container:this,
                                                                                                                                                                         // can be any size, can not be scaled as it distorts the content
                                                                                                         onProgress:progress Handler,
                                                                                                         onComplete:complete Handler,
                                                                                                         centerRegistration: true,
                                                                                                         //x:-260, y:-320, //no need for this is if used: centerRegistration:true,
                                                                                                         alpha:1,
                                                                                                         scaleMode:"none",
                                                                                                         //scaleX:0, scaleY:0,
                                                                                                         //vAlign:"top",
                                                                                                         width:540,
                                                                                                         height:730,//scales proportionally but I need to cut off the edges
                                                                                                         crop:true,
                                                                                                         autoPlay:false
    function progressHandler(event:LoaderEvent):void{
              progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;
    function completeHandler(event:LoaderEvent):void{
              var loadedImage:ContentDisplay = event.target.content;
              //TweenMax.to(loadedImage, 1.5, {alpha:1, scaleX:1, scaleY:1});//only need this line if corresponding values are changed in SWF loader constructor
              TweenMax.to(progressBarPopUp_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});
    loaderProductPopUps.load();

  • Multiple POu2019s were created from same requirement

    Issue: multiple POu2019s were created from same requirement (i.e. requirement had quantity of 100.  60 was put on one PO and 40 was put on another PO), BBP_GET_STATUS_2 program returns an error
    -Please let me know some tips/ pointers to investgate this issue.
    -How to investgate this issue? I really appreciate a thought process to investigate,

    Hi Rick,
    The splitting of a requirement into mulitple PO's will happen due to some criteria checks. Please see my note 1380879, where it states the following:
    There are a number of criteria that are taken into account when creating    
    the follow-on document:                                                                               
    proc_org    Purchasing Org                                                  
    proc_group    Purchasing Group                                              
    co_code     Company Code                                                    
    Pcins       Procurement card company                                        
    Pcnum       Procurement card number                                         
    ext_quote_id  External Quotation                                            
    logsys_fi     Logical Financial System                                      
    ext_dem_logsys  Logical System from where an External Re-quirement Comes                                                                               
    ext_dem_posid External Requirement Item Number                              
    Subtype     Item Subtype (Extended, local scenario)                         
    guid_ven    Vendor Guid                                                     
    guid_prpven   Desired vendor Guid                                           
    suppl_addr.   Ship to address fields                                        
    Doc_type    Process Type                                                                               
    Additional splits:                                                          
    Always split extended limit items                                           
    Always split if there is a missing vendor                                   
    Items grouped by hierarchies are split to separate PO s                                                                               
    The split criteria can be found within the code of Class                    
    CL_BBP_SC_TRANSFER. From this class there are a method's depending on       
    the follow-on document type:                                                                               
    SPLIT_BACKEND_OBJECTS                                                       
    SPLIT_BACKEND_PO                                                            
    SPLIT_BID                                                                   
    SPLIT_LOCAL_AND_BACKEND_ITEMS                                               
    SPLIT_LOCAL_OBJECTS                                                         
    SPLIT_LOCAL_PO                                                              
    SPLIT_LOCAL_PO_DO                                                           
    SPLIT_PO_BE_MAP_CRITERIA                                                    
    SPLIT_PO_LOC_CHK_LIMIT                                                      
    SPLIT_PO_LOC_CMP_CRITERIA                                                   
    SPLIT_PO_LOC_MAP_CRITERIA                                                   
    SPLIT_REQUISITION                                                           
    SPLIT_RESERVATION   
    So if all of the above criteria are the same then one PO should have been created but if the above critieria is different in each item then the system will split the items into different PO's
    I hope this helps
    Kind Regards,
    Lisa

  • Unable to load swf from different domain through html wrapper in Chrom

    Hi All,
           I am trying a embed a swf from different domain. My html wrapper was in one domain and swf was in another domain. I have embedded the swf into the html wrapper. When i run the html file it is loading the swf in firefox and working fine. But when i try to run the same html in chrom or IE the swf is aborted. I have crossdomain.xml file in both the servers which is also allowing both the domains. I was not able to figure out the issue. Can anybody help on this.
    regards,
    Jayagopal.

    Are you getting any errors or warnings?

  • Controlling loaded swf from main timeline

    Hello,
    I'm working on loading external swf files for ios. I am able to load the swf files and set them to visible or invisible in different frames. I am having trouble controlling the loaded swf files from the main timeline. Specifically, I would like to have a button on the main timeline, that when clicked will move a loaded swf to frame 1.
    Here is a code that loads one swf file:
    var myLoader1:Loader;
    var loaderContext1:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
    if(myLoader1 == null)
              myLoader1 = new Loader();
              addChild(myLoader1);
    myLoader1.load(new URLRequest("folder/file1.swf"),loaderContext1);
    myLoader1.visible = true;
    backbutton.addEventListener(MouseEvent.MOUSE_DOWN, backbutton1);
    function backbutton1(myEvent:MouseEvent):void {???????????? myLoader1.gotoAndStop(1);}  (this line does not work)
    (Once I load file1.swf, within the file1.swf I click a forward button to move to different frames. My question is: how do I code the 'backbutton' on the main timeline so that it causes the loaded file1.swf to go to frame 1?)
    Thank you for your help.

    sure.
    if the movieclip on the loaded swf's main timeline has reference mc, you would use:
    MovieClip(myLoader.content).mc.gotoAndStop(1);
    p.s.  you might find the following helpful,  http://kb2.adobe.com/community/publishing/918/cpsid_91887.html

  • Load swf from a tree

    Could someone show me how to load swf file from a link on a
    tree node? The tree would come from embeded xml.
    Thanks

    I am getting 1034 Type coercion error. I have Googled it this
    error must have hundreds of links. Is it a bug in Flex 3? Here is
    the code. The problem only occurs when I link to a swf.
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical"
    verticalAlign="middle"
    backgroundColor="white">
    <mx:Script>
    <![CDATA[
    import mx.events.ListEvent;
    import mx.managers.*;
    import mx.flash.*;
    import mx.controls.treeClasses.*;
    private var t:Tree;
    private var dataObj:Object;
    private var suffix:String;
    private function tree_itemClick(evt:ListEvent):void {
    var t:Tree = evt.currentTarget as Tree;
    var dataObj:Object = evt.itemRenderer.data;
    if (dataObj.hasOwnProperty("@src")) {
    swfLoader.source = dataObj.@src;
    } else if (t.dataDescriptor.isBranch(t.selectedItem)) {
    swfLoader.source = null;
    panel.status = "";
    private function tree_labelFunc(item:Object):String {
    var suffix:String = "";
    if (tree.dataDescriptor.isBranch(item)) {
    suffix = " (" + item.children().length() + ")";
    return item.@label + suffix;
    private function swfLoader_complete(evt:Event):void {
    panel.status = (swfLoader.bytesTotal/1024).toFixed(2) +
    'KB';
    ]]>
    </mx:Script>
    <mx:XML id="dp" source="data/dp.xml" />
    <mx:HDividedBox width="100%" height="100%">
    <mx:Panel width="200" height="100%">
    <mx:Tree id="tree"
    dataProvider="{dp}"
    labelFunction="tree_labelFunc"
    showRoot="false"
    width="100%"
    height="100%"
    itemClick="tree_itemClick(event);" />
    </mx:Panel>
    <mx:Panel id="panel"
    width="100%"
    height="100%"
    backgroundColor="white">
    <mx:SWFLoader id="swfLoader"
    scaleContent="true"
    width="100%"
    height="100%"
    complete="swfLoader_complete(event);"/>
    <mx:ControlBar>
    <mx:LinkButton label="{swfLoader.source.toString()}"
    />
    </mx:ControlBar>
    </mx:Panel>
    </mx:HDividedBox>
    </mx:Application>

  • Flushing loaded swfs from stage target mc?

    Hi, I'm using buttons to send the playhead to frames in which swfs are then loaded into an otherwise blank movieclip called "stage_target_mc" ...how can I then flush out the previously loaded swf so only a newly loaded swf displays in "stage_target_mc"?  For example, after clicking upon the 'about' button the 'about' swf loads...then if the 'concepts' button is clicked the 'concepts' swf loads -- but the previously loaded 'about' swf still plays...I would like to be able to flush the 'about' swf so only 'concepts' is display, in this example.  Thanks!
    code associated with buttons used to send playhead to frames "concepts" or "about":
    about_btn.addEventListener(MouseEvent.CLICK, displayAbout);
    function displayAbout(e:MouseEvent):void {
    root.gotoAndStop("about");
    concepts_btn.addEventListener(MouseEvent.CLICK, displayConcepts);
    function displayConcepts(e:MouseEvent):void {
    root.gotoAndStop("concepts");
    code on frame called "concepts":
    stage_target_loader.load(new URLRequest("swfs/stages/concepts.swf"));
    MovieClip(root).stage_target_mc.addChild(stage_target_loader);
    code on frame called "about":
    stage_target_loader.load(new URLRequest("swfs/stages/about.swf"));
    MovieClip(root).stage_target_mc.addChild(stage_target_loader);

    Before loading, try using the unloadAndStop() method of the Loader class if you are using a newr version of Flash

  • Accessing multiple mail accounts comming from same incomming mail server

    What is the trick to accessing multiple mail accounts comming from the same incoming mail server with the same user ID and password?
    I have a website that I run all of my mail through and I have never been able to check more than one configured mail account using "MAIL".
    Thanks

    Hi Sparky,
    You can configure mutliple accounts easily enough. Preferences > Accounts, then the Account Information tab. You are providing email address, incoming server, username and password for each.
    First account: [email protected]; mail.host.com; sparky; sparkypassword
    Second account: [email protected]; mail.host.com; sparky; sparkypassword
    Check, as noted above, that all accounts are set to enabled and to autocheck: Both settings are under the Advanced tab. Then exit and save. Now your inbox will show a disclosure triangle. Click it and you'll see both accounts.
    Does that explain enough? Are you haveing a problem doing this or just weren't sure how?
    Let us know!
    Good luck,
    John

  • Can't stop loaded .swf from looping

    I have a loaded .swf that has the necesary stops to just play once and stop. It works when testing the movie, but once uploaded to the server, it loops forever, any ideas,  I am using ActionScript 2.0

    it works when tested in HTML browser, but not when uploaded to server

  • Load SWF from text link?

    Hi
    I have navigation movieclips which load external SWF's into
    my "loader_mc" empty movie clip on my stage, however I need to add
    some text onto certain pages and from this text create hyperlinks
    which are meant to load external SWF's also into the same loader_mc
    movie clip.
    Firstly, is this even possible - i.e. load external swf's
    from text links?
    Secondly, if so, how? When i select the text, the actions
    panel is always disabled.
    Any suggestions or advice would be greatly appreciated.
    Thanks

    I just have stop(); on the swf
    this is the code for adding the swf
    addBubbles(e.currentTarget);
            private function addBubbles(e:Object):void
                var xx:Number = e.x;
                var yy:Number = e.y;
                var bubble:boxg = new boxg();
                bubble.x = xx;
                bubble.y = yy;
                e.parent.addChild(bubble);
                bubble.gotoAndPlay(1);
    But when i run the debug i get an error on this line - e.parent.addChild(bubble);
    Error #1009: Cannot access a property or method of a null object reference.
        at InventoryItem/addBubbles()[C:\Documents and Settings\frida\Desktop\hello99\hello3\InventoryItem.as:39]
        at InventoryItem/mouseClickHandler()[C:\Documents and Settings\frida\Desktop\hello99\hello3\InventoryItem.as:28]
    what that means?
    Thank you

  • Loading images from an Array generated from XML

    OK, this is my first day trying to use AS3 and I'm kind of
    confused on how to load an image onto the screen and then be able
    to resize it, scale it, etc..
    I'm loading up to 5 images in from an XML file that will be
    generated on a server. (right now I'm just using a test.xml file).
    Normally I would load the images into dynamically created
    movie clips (whatever0_mc through whatever4_mc generated by code in
    AS2). But I can't seem to get anything working.. I've looked on the
    internet and read through some information but I'm still just
    REALLY confused... this is what I have so far. To make it easier on
    me in the future, I've put different code on different layers so I
    can look at it closer.. I've separated the code into the different
    layers they're on here:
    First Layer:
    import flash.events.Event;
    import flash.net.URLLoader; // URL Loader Import for Images
    import flash.net.URLRequest; // URL Requests Import for
    Images
    import flash.display.Loader; // Loader
    import flash.events.ProgressEvent; // Progress for Loader
    import flash.text.TextField; // Imports for Text Fields
    import flash.display.Sprite; // Imports Sprite stuff for
    loaded Images
    import flash.display.Bitmap; // Imports stuff to display a
    bitmap
    Second Layer:
    var imgLoader:Loader = new Loader(); // Initialize Image
    Loader
    // Listeners for the Image Loaders //
    function showPreloader(evt:Event):void {
    trace("-- ** showPreloader ** --");
    addChild(loadProgress_txt);
    function showProgress(evt:ProgressEvent):void {
    trace("-- ** showProgress ** --");
    var totalLoaded:Number = evt.bytesTotal;
    var currentLoaded:Number = evt.bytesLoaded;
    var thePercent:Number = (currentLoaded * 100) / totalLoaded;
    loadProgress_txt.text = thePercent + "%"; // Show bytes
    loaded
    function showLoadResult(evt:Event):void {
    trace("-- ** showLoadResult ** --");
    Third Layer:
    // Setup Variables //
    var imageArray:Array = new Array();
    var galleryTitle:String;
    var numPhotos:Number;
    var gallerySubmitter:String;
    // XML Info //
    XML.ignoreComments = true;
    XML.ignoreWhitespace = true;
    var galleryXML:XML;
    var xmlLoader:URLLoader = new URLLoader();
    var request:URLRequest = new URLRequest("test.xml");
    xmlLoader.load(request);
    xmlLoader.addEventListener(Event.COMPLETE, XMLComplete);
    function XMLComplete(evt:Event):void {
    trace("-- ** XMLComplete ** --");
    var loader:URLLoader = evt.target as URLLoader;
    if (loader != null){
    galleryXML = new XML(loader.data);
    galleryTitle = galleryXML.children()[0].attributes()[0];
    numPhotos = galleryXML.children()[0].attributes()[1];
    gallerySubmitter = galleryXML.children()[0].attributes()[2];
    trace("galleryTitle: " + galleryTitle);
    trace("numPhotos: " + numPhotos);
    trace("gallerySubmitter: " + gallerySubmitter);
    for(var i:Number = 0; i<numPhotos; i++) {
    imageArray.push(galleryXML.children()[0].children()
    .attributes()[1]);
    } // for(var i:Number = 0; i<numPhotos; i++)
    trace(imageArray.toString());
    trace("loading: images\\gallery\\" + imageArray[0]);
    var imgRequest:URLRequest = new
    URLRequest("images\\gallery\\" + imageArray[0]); // Request the
    Image into the Loader
    imgLoader.load(imgRequest);
    imgLoader.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
    imgLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress);
    imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,showLoadResult);
    } else { // if (loader != null){
    trace("loader is not a URLLoader!");
    } // if (loader != null){
    } // function onComplete(event:Event):void {
    // End XML Info //
    Can anyone point me in the next direction?
    thanks...

    When you used the IMAQ create VI you specified each image to use the same name of "image".  Each image has to have a unique name.  I edited your VI to give a unique name for each image and I was able to view three different images in three different viewing panes.
    Attachments:
    Image Array Reworked.vi ‏19 KB

  • Get multiple Input/Output Stream from same socket ?

    For a better express of my problem i will put my test example
    I have those 4 classes
    package test;
    import...
    public class ReaderExecutor extends Thread{
            private InputStream in = null;
            private static int defaultID = 0;
            private int ID = getID();
            public ReaderExecutor(InputStream in){
                this.in = in;
            public void run(){
                try {
                    int c ;
                    while ((c=in.read())!=-1)
                        System.out.println("ReaderThread " + this.ID + ":" + c);
                catch (IOException e) {
                    System.out.println("ReaderThread "+this.ID+" stopped !");
            private static int getID(){
                return defaultID++;
    package test;
    import...
    public class WriterExecuter extends Thread{
        OutputStream out = null;
        private static boolean odd = true;
        private boolean isOdd ;
        public WriterExecuter(OutputStream out) {
            this.out = out;
            isOdd = odd;
            odd = !odd;
        public void run(){
            try{
                for (int i = isOdd?1:2;i<10;i+=2){
                    System.err.println(i);
                    out.write(i);
            }catch(Exception e){
                System.out.println("WriterThread stopped !");
    package test;
    import...
    public class Main { 
        public Main() {
        public static void main(String[] args) throws Exception {
            try{
                ServerSocket ss = new ServerSocket(9090);
                System.out.println("Ascult ... ");
                Socket client = ss.accept();
                new ReaderExecutor(client.getInputStream()).start();
                //Thread.sleep(2000);
                new ReaderExecutor(client.getInputStream()).start();
            }catch (Exception e){
                e.printStackTrace();
    package test;
    import...
    public class Main1 {
        public Main1() {
        public static void main(String[] args) {
            try{
                Socket s = new Socket("localhost",9090);
                WriterExecuter t= null ;
                t = new WriterExecuter(s.getOutputStream());
                t.start();
                t = new WriterExecuter(s.getOutputStream());
                t.start();
            }catch(Exception e){
                e.printStackTrace();
    }Now if i run successive Main , Main1 i get this output
    Ascult ...
    ReaderThread 0:0
    ReaderThread 1:0
    ReaderThread 0:0
    ReaderThread 1:0
    ReaderThread 0:0
    ReaderThread 1:0
    ReaderThread 0:0
    ReaderThread 1:0
    ReaderThread 0:0
    ReaderThread 0 stopped !
    ReaderThread 1 stopped !The question is can i get other Input/Output individual streams with a separate logic functionality from the same socket?
    From this example it seems i can't :(
    Thx
    Alex

    For what you are trying to do the simplest solution is to have one socket per "stream" that is the way they are designed to be used.
    However, you can multiplex multiple stream over a single socket, but you have do the coding yourself or use a solution which does this for you e.g. JMS. (There is no support at the socket level for this)

  • Loading SWF from CS5

    Hi,
    I'm porting a plug-in from CS4 to CS5 which has Flex components to it.  There is no mention of any changes in the Flex portion of the API in the porting guide, but yet it's obviously changed.  To make things worse, the sample flexuistroke is missing all the C++ code.
    I made the obvious change from LoadMovie to LoadSWF and while all function calls succeed, the SWF file never shows up in our panel.
    Can anyone tell me either what's changed or provide an example?
    Thanks

    later some debug, I found this:
    buttons on a container MovieClip react slower than buttons on main timeline (all air versions [desktop, android])
    seems (and sounds, to say the truth) to be correct the running path: [mouse events:]
    OVER -> DOWN [and then] UP -> CLICK
    but,
    OVER -> DOWN [and then] UP -> CLICK with buttons in main timeline is fast enough
    OVER -> DOWN [and then] UP -> CLICK with buttons a MovieCLip is not fast enough to be acceptable
    and, in the case:
    OVER -> DOWN [and then] UP -> CLICK with buttons a MovieCLip is AIR for Android is terribly SLOW (can't use buttons?!?!)
    adobe, have I to open a bug report?
    Massimiliano
    nb AIR 2.5.1 (I ask to myself if previous versions of AIR were free from this bug, or if worldwide developers are used to not to use buttons in movieclips when developing for AIR...)

  • Detect load completion from an array of images

    I have an array with 6 items. I have a for loop that dynamically builds a movie clip and loads the images. I'm trying to get an action/function to start only when the last image is finished loading I have the onLoadComplete working, but I cant seem to figure out how to get it to work on the last image and then activate an action/function?
    Wil I need to find another way of looping them using the onloadcomplete as a singnal to load the on image and then the other?
    Can anybody help?

    Thank you Kglad! I was able to get the script working. If I could bother you with a minor problem with the script? its with the depths. I had better controll over depths in AS3, but I need to write in AS2. Any way with the script, before I added the tweens I was able to stack the images one ontop of the other, and then set the depth of the banner_mc above the images, but when I go to tween them they are infront of the banner. How can I get that banner on top (of everything else)?
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    var MCL:Number
    var listener:Object = new Object()
    napolpics = new Array()
    napolpics = [
                                   "estimates_1_sm.jpg",
                                   "directions_1_sm.jpg",
                                   "partners_3_sm.jpg",
                                   "home_4_lg.jpg",
                                   "estimates_2_sm.jpg",
                                   "about_4_lg.jpg"
    MC_Tween = new Array
    MC_Tween = []
    for (var i=0; i < napolpics.length; i++)
              var imagesLoaded:Number=0;
              var container:MovieClip = this.createEmptyMovieClip("big_"+i, this.getNextHighestDepth());
              MC_Tween.push(container);
              var mcLoader:MovieClipLoader = new MovieClipLoader();
              mcLoader.addListener(this);
              mcLoader.loadClip(napolpics[i], container);
              container._y=75;
              container._x=10;
              container.height=161;
              container.width=194;
              this.onLoadComplete = function(mc:MovieClip)
                                  imagesLoaded++;
                                  if(imagesLoaded==napolpics.length)
                                            var tweenit=setTimeout(callyourfunction, 3000);
                                            MCL= MC_Tween.length-1
    function TweenImages()
              trace (MCL)
              var fadeit = new Tween(MC_Tween[MCL], "_X", Strong.easeInOut, MC_Tween[MCL]._x, 300, 4, true);
              fadeit.onMotionFinished=function()
                        MCL--
                        if(MCL>-1){var tweenit=setTimeout(TweenImages, 3000);}
                        else{clearTimeout(tweenit)}

Maybe you are looking for