Can I combine two methods of code to load various SWF files into the same location

I presently have a set up where a large SWF file brought on the stage by clicking small icons from the scrollable thumbnail menu on the bottom of the stage. All of it happens at the same frame with .xml loading file.
Here is the code for constructing the ImageLoader(for thumbnails) and SWFLoader for (bigger SWF files)
[CODE]
   function _xmlCompleteHandler(event:LoaderEvent):void {
   _slides = [];
   var xml:XML = event.target.content; //the XMLLoader's "content" is the XML that was loaded.
   var imageList:XMLList = xml.image; //In the XML, we have <image /> nodes with all the info we need.
   //loop through each <image /> node and create a Slide object for each.
   for each (var image:XML in imageList) {
    _slides.push( new Slide(image.@name,
          image.@description,
          new ImageLoader("loadingAssets/appThumbnails/slideshow_image scroller greenSock_mine/assets/thumbnails/appThmb_imgs/" + image.@name + ".jpg",
               name:image.@name + "Thumb",
               width:_THUMB_WIDTH,
               height:_THUMB_HEIGHT,
               //centerRegistration:true,//messes up the code as places SWFLoader in the upper left corner which is 0,0 coordinates
               //x:260, y:320,//doesn't work here but works in line 69
               scaleMode:"proportionalInside",
               bgColor:0x000000,
               estimatedBytes:13000,
               onFail:_imageFailHandler}),
          new SWFLoader("loadingAssets/appThumbnails/slideshow_image scroller greenSock_mine/assets/images/" + image.@name + ".swf",
                name:image.@name + "Image",
                width:_IMAGE_WIDTH,
                height:_IMAGE_HEIGHT,
                //centerRegistration:true,//messes up the code as places SWFLoader in the upper left corner which is 0,0 coordinates
                x:0, y:144,
                scaleMode:"proportionalInside",
                bgColor:0x000000,
                estimatedBytes:820000,
                onFail:_imageFailHandler})
[/CODE]
Here is what I would like to resolve. I have another section on the site with an image collage. Every image is a button. I want to script this each image on click to go to the label with ImageLoader and SWFLoader AND TO OPEN A UNIQUE SWF (ASSOCIATED WITH AN IMAGE CLICKED) ON THAT PAGE
Previously this is what I did to achieve it. I would specify a String:
[CODE]
var sourceVar_ProductsPopUps:String;
[/CODE]
and then all my buttons will have their unique SWF assigned for them which opens at another labeled section ("prdctsPopUps" in this example):
[CODE]
function onClickSumix1PopUp(event:MouseEvent):void {
  sourceVar_ProductsPopUps="prdcts_popups/sumix1-popup_tl.swf";
  gotoAndPlay("prdctsPopUps");
[/CODE]
Then in the "prdctsPopUps" section I would specify that var string to bring up SWF files. The value of sourceVar_ProductsPopUps allows to load mulitple SWFs from the previous page.
[CODE]
loaderProductPopUps = new SWFLoader(sourceVar_ProductsPopUps,
[/CODE]
But I need both of them to be working at the same time. First there is a sectionA from where a user can navigate to specifically targeted SWF to section B's SWFLoader. Then in the section B a user has an option to bring up other SWF files into SWFLoader from the scrollable thumbs menu. Is there a way to combine these two lines into one:
[CODE]
          new SWFLoader("loadingAssets/appThumbnails/slideshow_image scroller greenSock_mine/assets/images/" + image.@name + ".swf",
[/CODE]
and
[CODE]
new SWFLoader(sourceVar_ProductsPopUps,
[/CODE]

Thanks for looking into my issue.
Unfortunatelly I am not so advanced in AS and do not complitely understand the logic of the problem. I will try to decribe my set up more precise.
So, my main flash file is broken into labeled sections on the main time line.
One of the sections is "Applications" It has an animated collage of images. Each image acts as a button and once clicked brings a user to a section called "ApplicationsPopUps".
"ApplicationsPopUps" section has small image thumbnails scroll menu at the bottom of the screen and a large SWFLoader in the middle of the screen. User can click on an image in the thumbnails scroll menu and a corresponding SWF file will load in the middle of the screen in SWFLoader. User can click on left/right navigation buttons and preceeding/following SWF file will load in SWFLoader.
Everything works fine (with your previous help)
Here is the working code for the ImageLoader and SWFLoader (please let me know if you need additional code on the page):
function _xmlCompleteHandler(event:LoaderEvent):void {        _slides = [];       var xml:XML = event.target.content; //the XMLLoader's "content" is the XML that was loaded.        var imageList:XMLList = xml.image; //In the XML, we have  nodes with all the info we need.        //loop through each  node and create a Slide object for each.       for each (var image:XML in imageList) {         _slides.push( new Slide(image.@name,               image.@description,               new ImageLoader("loadingAssets/appThumbnails/slideshow_image scroller greenSock_mine/assets/thumbnails/appThmb_imgs/" + image.@name + ".jpg",               {                    name:image.@name + "Thumb",                    width:_THUMB_WIDTH,                    height:_THUMB_HEIGHT,                    //centerRegistration:true,//messes up the code as places SWFLoader in the upper left corner which is 0,0 coordinates                    //x:260, y:320,//doesn't work here but works in line 69                   scaleMode:"proportionalInside",                    bgColor:0x000000,                    estimatedBytes:13000,                    onFail:_imageFailHandler}),                 new SWFLoader("loadingAssets/appThumbnails/slideshow_image scroller greenSock_mine/assets/images/" + image.@name + ".swf",                   {                     name:image.@name + "Image",                     width:_IMAGE_WIDTH,                     height:_IMAGE_HEIGHT,                     //centerRegistration:true,//messes up the code as places SWFLoader in the upper left corner which is 0,0 coordinates                   x:0, y:144,                     scaleMode:"proportionalInside",                     bgColor:0x000000,                     estimatedBytes:820000,                     onFail:_imageFailHandler}) 
Thumbnails in the section "ApplicationsPopUps" and images in the image collage in the section "Applications" represent the same photographs. So when a user clicks on one of the images in "Applications" section it would be natural that that image will load in the "ApplicationsPopUps" section. However "ApplicationsPopUps" section presently has a working code (as sampled above) It looks too complex for me and I do not know hot to implement this feature. I do want to keep the functionality of the thumbs image scroller in section "ApplicationsPopUps" as it is now. But I want to add that when a user click on an image from section"Applications" then that particular SWF file will load in SWFLoader in section "ApplicationsPopUps" and then the present functionality can as well be exectuted. Presently it just opens on a first image in xml order.
P.S. I see that you had a download link in your answer. How did you do it? I could also upload a small sample file with my problem. This way you could see all the set up right away.

Similar Messages

  • Can in combine two itunes. my wife and i have seperate itunes on the same pc, can i combine then

    My wife and i ahev two user set up our pc. we both have itunes with different content. I would really like to combine them..is this possible

    At the moment iTunes accounts cannot be merged or combined. You have both accounts authorised on the same computer's iTunes (Store > Authorise This Computer), but the content from them will continue to be 'owned' by the account that originally bought / downloaded it.

  • What is the code to load a .swf file in AS3 on the same layer?

    I'm new to AS3 and am trying to figure out the code for loading a .swf file on the same layer of the same page, thereby replacing all of the information. I don't want to put it on layer 2, etc. Another easy thing I can do in AS2 but am struggling with in AS3.
    thanks!
    Steve

    There are no 'layers' in AS3 - there is just the display list. You can use addChildAt to add things at a specific depth - thereby placing it behind or above something, but if you just use addChild it goes on top of whatever is currently there...
    Anyway - to answer your question, you can load a .swf with a Loader object like so:
    var l:Loader = new Loader();
    l.load(new URLRequest("myFile.swf"));
    addChild(l);
    You can wait for complete like was shown, but you don't have to. And this will not 'replace' anything - it just loads myFile.swf on top of anything currently being shown. If you want to 'replace' what's there you need to remove it first:
    while(numChildren){
         removeChildAt(0);

  • Can i add two country holiday on my iCal and see them at the same time?

    Can i add two country holiday on my iCal and see them at the same time? HOW?

    Just subscribe to the appropriate calendars: you can subscribe to as many as you like.
    http://www.apple.com/downloads/macosx/calendars/

  • Can two or more place comments on a pdf file at the same time?

    We use SharePoint to place pdf files for our team members to open and comment and review.  Until recently we have not had any issues with two or more opening the same pdf at the same time and placing comments.  But now we are losing some of the comments.  Please advise.

    I've seen changes I've made on my iPad show up on the same document that's been open all the time on my Mac, which suggests it might be possible. However, I've also had a small number of notifications that documents on different devices are not in sync with each other. So while it might have the potential to work, I'd be inclined to think it would be quite unreliable.

  • Can you have two separate products appear on Newsstand if they live in the same Enterprise app?

    A client has two sets of publications - a weekly and a monthly.
    We ideally want to build an Enterprise app that houses all their weekly and monthly publications. Both products need to appear in Newsstand.
    Is this possible? If so, how do we partition the app so that the publications are separate? I assume we would need a custom storefront as well.
    Thanks

    Hi,
    If you want to create 2 separate apps on Newsstand then you need to build and manage these separately. This requires you to create 2 separate App IDs and build separate apps using App Builder.
    Remember that folios are always uploaded into a specific application account. This means you'd have to create a separate application account for the other app and only upload the folios you'd like to see in that app.
    Do note that apple will probably give you issues if you offer the exact same content twice, so they'll reject the app. If you do want to differentiate between users only getting the weekly vs monthly issues I'd suggest you use an entitlement server.
    Bart

  • How can I combine two itunes accounts into one?

    How can I combine two itunes accounts into one?

    Items purchased from the iTunes Store are permanently associated with the account from which they were originally purchased.  Apple provides no way to change this.
    However, if you wish to put content from two accounts into a single iTunes library, you can easily do so.  Use the command File > Add File (or Folder) to Library.

  • How can I combine two databases, from two computers, to have one combined database of messages?

    My old XP computer recently died and I had to build a new Windows 8.1 machine. While I was down I used a laptop as a temporary replacement. Now my new machine is running fine and receiving e-mail, but I now have two databases--one on the new machine and one on the laptop. Both are based on a recent backup, so they are lengthy--except that the new machine's database has a hole in it for the period I was on the laptop and the laptop's database also has gaps. How can I combine two databases into one that includes the messages from both machines?
    Thanks in advance,
    profsimonie

    Thanks for your reply. My profile folder did not contain any MBOX files. I found them in another folder on another drive. The Import-Export tools simply transferred each folder to the current one as a sub-folder. Then I had to use ctrl-a to select everything in the folder and move them manually to the current folder (such as inbox). Then I could use the other utility you mentioned to remove the duplicates. This had to be done, one folder at a time, to combine each folder. It worked, but I had about thirty-five folders to deal with. The whole process took most of two days to complete. I wish there was a simple way to blend everything together in one action, but I could not find an add-on that would do this.
    Frank Simonie

  • Can I combine two bex querys by comining query function

    Hi expert,
            Can I combine two bex querys by comining query function?
    Many Thanks,

    Hi,
    Add a combined query function is not possbile by BICS  connectivity.This is product limitation.
    Regards,
    Amit

  • Can you combine two animations?

    I created an Edge animate animation, but want to put it into another file I am working on. How can I do this?

    There are certainly people a lot more knowledgeable about Edge than me - but what I did, and it worked, was publish, copy the published runtime and put it into the head -  copy the other edge_  files into the root, the div with the EDGE class, and then use that class definition in css , by overriding  with [style]
    e.g.: in the body:
    <div id="Stage" class="EDGE-55507062"></div>
    and in css:
    .EDGE-55507062[style] {
    display:block:
    whatever...
    Only other tips about this are ensure you also bring in edge_includes file; chuck out any extra images, symbols etc. that you're not using before publishing, correct the path in the runtime if you need to...

  • How to call a java method so I can pass a file into the method

    I want to pass a file into a java method method from the main method. Can anyone give me some help as to how I pass the file into the method - do I pass the file name ? are there any special points I need to put in the methods signature etc ?
    FileReader file = new FileReader("Scores");
    BufferedReader infile = new BufferedReader(file);
    Where am I supposed to put the above text - in the main method or the one I want to pass the file into to?
    Thanks

    It's a matter of personal preference really. I would encapsulate all of the file-parsing logic in a separate class that implements an interface so that if in the future you want to start taking the integers from another source, e.g. a db, you wouldn't need to drastically alter your main application code. Probably something like this, (with an assumption that the numbers are delimited by a comma and a realisation that my file-handling routine sucks):
    public class MyApp{
    public static void main(String[] args){
    IntegerGather g = new FileIntegerGatherer();
    Integer[] result = g.getIntegers(args[0]);
    public interface IntegerGatherer{
    public Integer[] getIntegers(String location);
    import java.io.*;
    public class FileIntegerGatherer implements IntegerGatherer{
    public Integer[] getIntegers(String location){
    FileInputStream fs=null;
    try{
    File f = new File(location);
    fs = new FileInputStream(f);
    byte[] in = new byte[1024];
    StringBuffer sb = new StringBuffer();
    while((fs.read(in))!=-1){
    sb.append(new String(in));
    StringTokenizer st = new StringTokenizer(sb.toString(),",");
    Integer[] result = new Integer[st.countTokens()];
    int count = 0;
    while(st.hasMoreTokens()){
    result[count]=Integer.valueOf(st.nextToken());
    count++;
    catch(IOException e){
    //something sensible here
    finally{
    if(fs!=null){
    try{
    fs.close();
    catch(IOException f){
    return result;
    Once compiled you could invoke it as java MyApp c:\myInts.txt
    Sorry if there are typos in there, I don't have an ide open ;->

  • Is there a way to combine two backups on separate disks created by time machine into one on a single disk?

    Is there a way to combine two backups on separate disks created by time machine into one on a single disk? One backup is a continuation of the other and was created when I rec'd a message that the 1st disk was full. I'm using a iMac (late 2010) and both external drives are WD. Thanx.

    With the timeline selected, go to File/Export/Movie and export each as a DV-AVI video.
    You can then combine those AVIs into a new project with virtually no loss of quality.

  • Can two users work on different files of the same project?

    Sorry if this has been asked already...but can two users work
    on different files of the same project? How would that work? Would
    it work something like this?
    1. From RoboHelp 7, user A checks out the entire project.
    2. User A checks in the files they are not working with.
    3. User B checks out the project but can only 'edit' the
    files that have been checked in by user A.
    Is this how the source control works?

    That's the basic idea. User A doesn't actually have to check
    out the whole project, though. RSC will selectively check out only
    the files that are actually getting changed. Both writers will have
    a complete copy of the project on their local machines, but the
    files are read-only until they are literally checked out, which is
    on an as-needed basis unless the writer explicitly checks them out.
    G

  • HT4314 I have two ipods in my house that were set up under the same email.  I have since assigned two different emails.  How can I change the game center account so that is not shared by both ipods because it is for two different users and they are not ha

    I have two ipods in my house that were set up under the same email.  I have since assigned two different emails.  How can I change the game center account so that is not shared by both ipods because it is for two different users and they are not happy?

    By "game center account", do you mean Apple ID?
    If so, you can change it.
    1. Tap settings and navigate to iTunes and App Stores
    2. Tap "Apple ID" and then tap "Sign Out"
    3. Log in with a different ID.

  • HT204053 If two separate iPhones are signed into the same AppleID can the iMessages be read on both devices?

    If two separate iPhones are signed into the same AppleID can the iMessages be read on both devices?

    Welcome to the Apple Support Communities
    You're right

Maybe you are looking for