Select which swf will be load by code

Hello all;
My question is quite simple maybe but i could not find it in action script 3.0.
There are 100 buttons in my movie clip and a timeline of 10 frames length.
If user clicks on button1, the movie clip will play and at the last frame it will redirect to second scene (scene2) and then "on scene2's first frame" "externalscene1.swf" will be loaded.
If user clicks on button 5 then on scene2's first frame "externalswf2.swf" will be loaded.
Here the normal code i wrote :
//SCENE1 - 1st frame :
st1.addEventListener(MouseEvent.CLICK, a1001e);
function a1001e(eeevt:MouseEvent):void {
MovieClip(root).play();   <<< i want to assign a variable (the swf name to be loaded)
//SCENE2 - 1st frame:
stop();
var loader3:Loader = new Loader();
loader3.load(new URLRequest("1004.swf"));   << i want to load variable.swf and load that swf.
addChild(loader3);
Thank you for all help.

I am not very clear what you want to ask, but as far as i have understood you want to manipulate URL of a swf to be loaded and pass the urlRequest object to loader.load method. That is you dont want to have different urlRequest object for all the different swf you want to Load. Try out in the following manner
The name of the SWF to be loaded should be such that it can be easily manipulated, Suppose you have 3 swf, then their name could be movie_1.swf, movie_2.swf, movie_3.swf.
// keep a counter
var counter:Number  = 0;
// url
function clickHandler(e:MouseEvent):void
     //increment counter on click of a button:
     counter++;
     //manipulate the url
     var url:String = "movie_"+counter;
     var request:URLRequest = new URLRequest(url);
     loader.load(request);
     addChild(loader);
all the buttons have same listener clickHandler.
There could be several other ways. Just let me know if this helps you out.

Similar Messages

  • Can I select which components will have auto binding turned on?

    To be honest, the only reason I don't use JDeveloper full time is due to this reason only.
    Can I select which components will have auto binding turned on?
    I don't see the need or reason to bind every single component in the page to your backing bean.
    This can clutter up your backing bean and all the searching for the bindings that I do care about is a real time waster.
    I've looked at the preferences and settings without much luck, thus I'd appreciate any thoughts on this topic.
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    To make sure I understand your response, your refering to Managed Beans as your Backing Beans - I thought the two were the same thing.
    Moving on, that is a good idea and I'll try it right now in a test project.
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How do I select which pictures will be shown on transition album 1 or album 2?

    Working with IMovie using still shots not video.  When I insert the transition of titled "album 1" or "album 2" ect.... I would like to select which pictures are shown in than transition.  Is there a way to do that?

    Select the transition and a bunch of markers will appear.
    Grab the marker you want to move to whatever image you want. The Canvas will display the transition with the selected images. You have to select an image that's in the project.

  • Any reasons SWFs will not load into an application?

    I've loaded thousands of swfs before into applications/components, but now I have an application (component) that won't load a swf - no matter where I put it, not matter how I load it (I've tried using a static <mx:SWFLoader source="test.swf" />  with the test.swf in the same directory as the component).  I've also tried  with a combination of the SWFLoader control with ActionScript and I tried loading it using all ActionScript (var loadTheSWF:SWFLoader = new SWFLoader() method).
    I even wrote a test application to load the test.swf - that loads fine.
    This particular component is very busy, I'm wondering if I've just "maxed out" the components ability to do more?  Or confused it somehow with namespaces and import statement.  At a loss here.
    Any insights welcomed.
    Thanks.

    The SWFloader appears on the screen with a broken link graphic in its place, but it can't seem to "find' the swf.  I have tried four different swfs.  I even created one with a simple 50-frame animation with no AS that will not load.  All these swfs will load in another application, just not this one for some crazy reason.  I may have to break down the whole comonent, or do a work around.
    Thanks.

  • My swf will not load or I cant see it ,,Help ?

    I am just trying to load a dreamweaver page and I have some
    flash in it but the flash is not showing up which is leaving gaping
    holes in the website.. Can somebody see whats wrong?
    www.mcdcpoway.com

    Being that nowhere on that page is reference to a swf file,
    I'd say that's
    why now Flash is showing...
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • There are several sites which Firefox will not load images. The rest of the site loads correctly, but the images simply do not appear.

    (There is no error message, loading message etc, just white space). These images load correctly in Safari . The sites include target.com, gap.com & garnethill.com and are the item photos for specific items listed on the site. I've tried many of the troubleshooting tips. help!

    Probably third party images, such as those of the manufacturer
    see https://support.mozilla.com/questions/858732

  • SWF will not load when video is present

    I looked around to see if this problem was asked before, but I couldnt find anything.
    So my situation is that a small animated logo displays normally on most pages except the ones that contain videos.
    Any ideas what I could do? Let me know what details you guys need.

    i had the same issue as everyone here after upgrading to itunes 10.x.  vista could see xp home share.  ipod touch could see xp home share.
    neither could see vista home share.
    after several hours of authorizing de-authorizing, rebooting router etc, i knew it had to be a firewall thingy with vista as xp was working fine
    i went to this article http://support.apple.com/kb/ht2553 and followed the instructions.  itunes was already in my vista exception list.  on a hunch i deleted the itunes exception and followed the steps to add it again and boom it worked!! i could now see my vista machine from my ipod touch immediately.
    something must have screwed up the firewall exception on the upgrade to itunes 10.x
    it worked for me, i hope this helps others

  • Will not load transparent SWF

    I have problems using an SWF i have made. The SWF is
    displayed with an absolute layer above it. This means it must be
    set to transparent. This works fine in Safari and Opera, but in
    Firefox the SWF will not load at all when the property is set to
    transparent. When that property is not set, it works perfectly.
    Also, it does not work in IE when loaded from the cache, something
    I avoid by using a random variable from a php script.
    Does anyone have any idea what I have done wrong? This is my
    first SWF file compiled with mxmlc, so I may have coded something
    in a bad way?

    steviln wrote:
    > I have problems using an SWF i have made. The SWF is
    displayed with an absolute
    > layer above it. This means it must be set to
    transparent. This works fine in
    > Safari and Opera, but in Firefox the SWF will not load
    at all when the property
    > is set to transparent. When that property is not set, it
    works perfectly. Also,
    > it does not work in IE when loaded from the cache,
    something I avoid by using a
    > random variable from a php script.
    >
    > Does anyone have any idea what I have done wrong? This
    is my first SWF file
    > compiled with mxmlc, so I may have coded something in a
    bad way?
    >
    Transparency is purely browser end, nothing to do with the
    movie.
    Could you provide problematic URL? Funny thing tho, this
    problem never occurs in IE or Firefox
    but more commonly in Safari, while in your case, the other
    way round.
    Anyway, if possibly, give us the URL so we can check it out
    first to find out whether it's
    your end or general problem, then will try to go from there.
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Which server will get the load?

    Hi all
    I have 2 servers, on 'server1', I have an flv file, on
    'server2', I have an swf file.
    The swf file on server2 loads the flv file on server1. My
    question is, which server will get the burden of the load of the
    flv file? Additionally, how can I test this to confirm this (bare
    in mind, I'm not a server guy).
    Any help is always appreciated.
    Thanks
    Chris

    You can basically publish it to one Origin Server and that server will republish the incoming stream to other 3 origin servers. This feature is called Multi-point publish. Basically you use application.onPublish and onUnpublish handlers in conjunction with Server-side NetStream Class to achieve this.
    Simple example:
    var nc;
    var ns;
    application.onAppStart = function(){
          nc = new NetConnection();
         nc.onStatus = function(info){
              // you can trace connection status here
         nc.connect("rtmp://Origin_Server_2/myApp");
    application.onPublish = function(myClient,myStream){
        ns = new NetStream(nc);
        ns.attach(myStream);
        ns.publish(myStream.name,"live");
    application.onUnpublish = function(myClient,myStream){
          ns.publish(false);

  • How can I found out which swf is loaded?

    I need to write an if statement for my menu to find out which
    swf is loaded into a certain level.
    On my menu, I have code that when a user clicks on a button,
    it reloads a new swf over itself into the same level. I have the
    menu in a shared library, but the code is in the menu itself.
    Probably not the best design, but I have to work with it now.
    I need some code to figure out which swf is loaded into level
    5. How can I do that? I need to be able to determine the swf and
    store it as a virable such as "calendar.swf"

    That didn't work...
    When the user clicks on the calendar (it's instance name is
    "calendar") it stores a global variable:
    calendar.onRelease = function() {
    _global.newpage = "calendar";
    _level0.myMCL.loadClip("calendar.swf", 5);
    Now, I need to send it through and if, else if, else if, etc.
    statement looking for the _global.newpage
    This is the code for the else if for the calendar:
    } else if (_global.newpage == "calendar") {
    greenbar._y = -56.4;
    greenbar._visible = true;
    _global.newpage.enabled = false;
    And, that code isn't working. Everything works except for the
    enabled = false line. What do I need to change that to so that it
    works?

  • Warning: An ActionScript 1.0/2.0 SWF file has loaded an ActionScript 3.0 SWF; code in the ActionScri

    hi,
    I am using classLoader to load the multiple swf and using that getclass method i am accessing its document class. it is working fine in local system. when i upload the same files in server,i am getting the below error
    Warning: An ActionScript 1.0/2.0 SWF file has loaded an ActionScript 3.0 SWF; code in the ActionScript 3.0 SWF will not run.
    any help pls

    what's your url?

  • HT5188 Free VPP app - Cannot load VPP Codes into Configurator because app is Free.  Sister company developed the app for us at no cost and we are installing on our devices.  Will the app expire after a year without VPP codes?  Devices will not have connec

    This is strange Case!
    We have been authorized to download 40 copies of a VPP app.  The price tier is free.  We download the app through itunes and load it into configurator.  Because the App is free we are not given the option to load the codes which we rightfully own. 
    The devices we wish to configure will not have internet connectivity in the future and I need to know that the app on them will not expire!
    If I load the app with configurator (unsupervised!) will the app expire in a year and be disabled?  I cannot have that happen!
    Please advise!
    Best,
    Nelson

    This is strange Case!
    We have been authorized to download 40 copies of a VPP app.  The price tier is free.  We download the app through itunes and load it into configurator.  Because the App is free we are not given the option to load the codes which we rightfully own. 
    The devices we wish to configure will not have internet connectivity in the future and I need to know that the app on them will not expire!
    If I load the app with configurator (unsupervised!) will the app expire in a year and be disabled?  I cannot have that happen!
    Please advise!
    Best,
    Nelson

  • Please let me about the SAP transaction code(s) from which I will get month

    Please let me about the SAP transaction code(s) from which I will get monthly
    Material or product wise listing of cost of finished goods sold & lying as stock

    Dear parameswar
    Go to SE16, give the table MBEW and select the following fields:-
    VERPR  -  If you want to see the moving average price of that particular material
    STPRS  -  If you want to see the Standard price of that particular material
    SALK3   -  If you want to see the total valuated stock of that particular material
    To see how much stock is available, run MMBE and execute.  You can also check in MC.9 (mcdot9)
    thanks
    G. Lakshmipathi

  • Drop down menus on iPad, the first selection in the drop down will not load as a selection when using safari, what can I do?

    Drop down menus on iPad, the first selection in the drop down will not load as a selection when using safari, what can I do?  I use this for my mobile, on-site auto repair business and not being able to call up repair and diagnostic info and reference for some cars is troublesome for sure. It works fine on the computer and I have installed a remote desktop app as a workaround but it is unreliable because the desktop is not business dedicated and may be off or in use at the time. So is there a known fix for this?
    Let me paint a more descriptive picture, visualize 4 drop down selection menus, first one is for year, next one is for make, 3rd one is model and the last one is for engine size/type. If I wanted to choose a 2012 vehicle it wont work because it is the top selection on the list. This can be forced by selecting any other year and then coming back to 2012. Ok fine, but then let's say I wanted to choose Acura as the make, well it won't take it because again it's the top selection. Again you work around it be selecting any other make and coming back to Acura. Ok now select the model, same trend follows. But now since most Acura vehicles come with dedicated engines and no optional engines I have only 1 selection in that final drop down menu and it will not take my selection and therefore never let me proceed to the info I need.
    This is also true when ordering parts from my wholesaler's website, they use drop downs and I can only get to that last drop down and then I'm stuck. This is blindingly frustrating, what options do I have. I'm not opposed to any avenue at this point.

    Did you ever figure this out? I bought my iPad last week to use in my business as well. I assume you are trying to use alldata? That is where I noticed this same issue. I had problems with identifix working with safari but downloaded a different browser and that works fine. Alldata does not work with either browser. The main difference is that on identifix if there is only one engine selection, it automatically selects the only option and continues to the home page. With alldata you have to make the selection manually even if there is only one option. Honestly if I can't get this to work I am going to return the iPad as it looses a significant amount of usefulness to men

  • My browser will not load a page or update unless I am actively moving my cursor or typing. If I select a page and don't do anything then it doesn't load at all. I have no idea how this happened or how to fix it. Thanks.

    My browser will not load a page or update unless I am actively moving my cursor or typing. If I select a page and don't do anything then it doesn't load at all. I have no idea how this happened or how to fix it. Thanks.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for