Load external swf and stopping on the 1st frame.

Hello everyone

I use following code to display an external swf file on the iPad.

var request: URLRequest = new URLRequest ("http://< server ip > / test.swf");

loader = new Loader();

Loader.Load (request);

The file load passes through each image and closes the application.

Y at - it will be a way to stop the 1st frame once the file is loaded and move between the ribs to the?

Thank you

If you listen to when the charger is finished, you can stop the swf file:

var mc:MovieClip;

loader.contentLoaderInfo.addEventListener (Event.COMPLETE, swfloaded);

function swfloaded(e:Event) {}

MC = e.target.content as MovieClip;

MC. Stop();

}

Now you can do what you like in this clip. As:

mc.gotoAndStop ('some ' label');

or:

mc.gotoAndStop (10);

Tags: Adobe AIR

Similar Questions

  • Load external .swf and button top

    Hello!

    I have a problem here! I want to load a file (created from inDesign) external .swf and then on load a button at home (a small image that I created with the name "home_btn"), which refers to my home page to say frame 90

    Any help it would be greatly appreciated,

    Frank

    I founded by myself, I just create a clip of this button and this is my code in case anyone has the same problem...

    import flash.events.MouseEvent;

    import flash.display.Loader;

    import flash.net.URLRequest;

    var loader: Loader = new Loader();

    Loader.Load (new URLRequest ("MyInDesignSwf.swf"));

    addChild (loader);

    addChild (home_front);

    home_front.addEventListener (MouseEvent.Click, playClickedExit)

    Stop();

    function playClickedExit(event:MouseEvent):void

    {

    removeChild (loader);

    gotoAndPlay (90);

    }

  • Problem with loading external swf files

    Hello

    I am currently working on a project which is an interactive and dynamic elemtry school presentation to the Denmark. I finished my project and it works perfectly, but only locally on my computer.

    The final draft should be implemented on the site and public work. I tried to implement the project on the site and unfortunately, it does not work as expected.

    When all the files where transferred to the ftp server, only a single files are responding and appear correctly.

    Interactivity of the project is based on a structure of Action script, which is based on the smooth transition between swf files (load another swf file after the action is triggered by clicking on a button) do any work.

    After days of trying to figure out the solution, I'm totally lost. One thing is to publish the project so that all action script will work and answer between swf files, and the other thing is to make it user-friendly for the Android and apple products.

    The presentation is quite heavy because of its loading external swf content files, which are images and movies.

    I really hope you can help me with my problem. I will gladly share the files and codes if it would help solve the problem.

    Best regards

    Agata

    It could be a problem of location of file from loading.  When you place a swf file in an HTML base for targeting anything that the SWF load becomes the folder of the html page.  You may need to adjust the target so that the target of swf files, load it as if it were in the same folder as the html page.

  • Loading multiple SWFs and saving them (code works is not under Chrome and Firefox 23)

    Hey guys,.

    Anyone has an idea why this suddenly does not work? (It works under internet explore but not firefox and chrome)

    The code below is placed on my main swf to preload all my external swf and store them for not having to wait too long to get there.

    Thank you guys.

    I took the code by btw: http://www.beautifycode.com/the-finer-art-of-loading-2-handling-multiple-swfs#snippet

    I am running flash player 11.8.800.94... He used to work under Firefox and Chrome


    var _swfLoader:Loader;

    var _swfRequest:URLRequest;



    var _swfPathArr:Array = new Array)

    '00.swf', '01.swf', '02.swf'

    );



    var _swfClipsArr:Array = new Array();

    var _swfTempClip:MovieClip;

    var _loadedSWFs:int;



    startLoading (_swfPathArr);



    function startLoading(pathArr:Array):void {}

    _swfLoader = new Loader();

    _swfRequest = new URLRequest();



    loadSWF(pathArr[1]);

    };



    function loadSWF(path:String):void {}

    setupListeners (_swfLoader.contentLoaderInfo);



    _swfRequest.URL = path;

    _swfLoader.load (_swfRequest);

    };



    function setupListeners(dispatcher:IEventDispatcher):void {}

    dispatcher.addEventListener (Event.COMPLETE, onSwfComplete);

    };



    function onSwfComplete(event:Event):void {}

    event.target.removeEventListener (Event.COMPLETE, onSwfComplete);



    _swfTempClip = event.target.content;

    _swfTempClip.customID = _loadedSWFs;

    _swfClipsArr.push (_swfTempClip);



    If (_loadedSWFs < _swfPathArr.length - 1) {}

    _loadedSWFs ++;

    loadSWF (_swfPathArr [_loadedSWFs]);

    } else {}



    //

    }

    };

    I have no problem with ff and I don't see any problem in chrome.

    You probably have a typo in if:

    loadSWF(pathArr[1]);

    should be

    loadSWF(pathArr[0]);

  • Cannot load external swf

    Hello

    Im trying to load an external swf into my project, the code is simply:

    var loader: Loader = new Loader;

    Loader.Load (new URLRequest ("gallery.swf");

    I get an error that says the following when it debug.

    TypeError: Error #1009: cannot access a property or method of a null object reference...
    at gallery_fla::MainTimeline/frame1()
    Cannot view the source code at this location

    I have done this same thing before but never got this error message, I tried to load a swf file that is old and it worked fine.

    IM totally lost here, any help is very appreciated.

    Because the error is pointing Gallery fla, it can be that the problem lies in the SWF Gallery.  What you need to do, is to enter your Setings publish and select the option to enable debugging.  This will help by joining the line number of the code problemed.  You think it's a number of top line to no matter what you have in the file doing the oading that would probably make most issues that's the file you load.

    Just in case you have copied and pasted, the following line should have thrown an error of syntax by lack a parenthesis...

    Loader.Load (new URLRequest ("gallery.swf");

  • WMP will open the VTS_01_1.VOB and stop at the end of this file

    I don't know if this is the place to post this question, but it's here.

    I created a web page that lists the cover images all my DVDs that I have on an external hard drive and each cover image is related to the first file VTS_01_1.VOB for this DVD.

    I test page to see how it works for each device I have.  The page works perfectly with my tablet from Samsung, the player on the Tablet, I installed automatically go VTS_01_1.VOB, VTS_01_2.VOB and so on until the movie is done.

    If I use my pc Windows 7, WMP will open the VTS_01_1.VOB and stop at the end of this file, how can I get WMP to continue to the next file automatically?

    Personally, I would check the source code of the Web page of the first.

    Paste the full path to the video_ts.ifo file in a new MS Word document and save it as htm.  Then run the file [it should open in your default browser], then right-click on the page and select view source.  Find the link - it should look like

    href ="... / SomeFolder/VIDEO_TS. IFO "> D:\SomeFolder/VIDEO_TS." IFO

    assuming that D:\SomeFolder/video_ts.ifo is the text that is displayed for the link

    Then go to your actual Web page and discover its source to verify that the link contains this model.

    If the solution is not as simple as that, then you will need to post a question in the section Web & networks of this forum I don't know enough about writing for the Web page.

    To increase the chances of getting there help please include a description of what happens when you try to click on the link - rather than 'will not work.

  • Records of Vista Media Center starts and stops at the wrong time

    I use Windows Vista Home Premium, SP1 and that you may have noticed that when I schedule recordings for some a particular channel, Media Center starts 2 minutes beforehand and ends 2 minutes in advance.  This affects only shows record from my local affiliate Fox - all other shows for other strings start and stop at the appropriate time.

    I checked the system clock with the start times of the shows and both are correct.  In fact, I saw one day Media Center started to record for a show that did not begin until 08:00 at 19:58 (according to the system time).  I had my TV on at the same time and was able to verify that the program in question had not yet begun, so the flow of the internet was sychned with the dissemination of local transmission.

    It's very frustrating because I miss the end of some shows and cannot always extend registration ends because I'm ordering another channel, the next hour.

    I have the same problem with the FOX network...

    -1 make sure your clock automaticly sets in the internet and update once by pressing the link (which makes that he can see the time server)...

    There are two ways you can go with this:

    -If your departure time is correct, then just go to the Planner and choose the program (or series) you are trying to install, select the recording settings (or adjustment of series) or advanced setting... There is an option to "stop recording" 1 min, 2 min, 3 min, 5 min, until 2 hours after the recording is finished... I have mine set to 5 minutes after, and she fixed it...

    -If the starting time is disabled (as mine is), to enter ERM and manuver to tasks > settings > TV > recorder > recorder defaults

    This is where you define all the flaws of the recorder, find "Start when possible" and "Stop when possible", 4 min value (max allows MCE)... Save and exit, restart the machine too...

    You should be good to go...

    PS, I just read the last sentence in your post, you must only have a tv tuner card in your machine (I have two, and that's the reason why I bought two), so you can always have a problem when recording two different channels (back to back on the same channel should work okay).

  • PowerCLI defining politics NTP to "Start and stop with the host" in ESXi 5

    Would appreciate any help in the definition of the strategy NTP on ESXi 5 hosts 'start and stop with the host. My script is currently using the following:

    Get-VMHost MyEsx | Get-VMHostService | where {$_.} Key - eq 'ntpd'} | Game-VMHostService-policy "automatic."

    This sets up the NTP service in "start automatically if all ports are open and stop when all ports are closed.

    "When I cange to 'MyEsx Get-VMHost | Get-VMHostService | where {$_.} Key - eq 'ntpd'} | Game-VMHostService-political ' market / stop with host"" the following is returned:

    «The possible enumeration values are "auto, On, Off«»»»

    Anyone know of a way (in PowerCLI) of the set up for the 'start and stop with host?

    OK, then you should choose politics "on".

    These are the policy values and what they match.

    Like this

    Get-VMHost MyEsx | Get-VMHostService | where {$_.Key -eq "ntpd"} | Set-VMHostService -Policy On
    
  • Goto and stop using the keys on the keyboard?

    Hello

    Is this possible...

    Got a simple presentation keys to access to and stop on the image tag. It scrolls the pages presenting the front button and back.

    However it is possible to use the keyboard forward and back buttons to control walking forward and backward movement of the pages.

    This is an application for my client's last-minute... If you are looking for a simple solution if possible.

    Thank you

    You can assign a listener to the keys, although I'm not sure what you consider to be front and rear buttons to keyboard...

    var keyListener:Object = new Object();
    Key.addListener (keyListener);

    keyListener.onKeyDown = function() {}
    If (Key.GetCode () == Key.LEFT) trace ("left");  Replace the traces of your commands goto
    If (Key.GetCode () == Key.RIGHT) trace ("right");
    }

  • How to load external images and animate it after it is loaded?

    I know how to load external images using xml, but the problem is that if I have a lot of images to load then animate after it is loaded. I know theres a work around to this problem but still I have not understand.

    Thanks for help.

    You will need to use the MovieClipLoader class.  It supports have a headset which allows you to determine when the image has loaded so that you can act on it.

    If you are looking for the MovieClipLoader.addEventListener methoid (), there is an example that will be useful to see how to configure things (it's not your scenario, but a good reference).

  • How to load external swf file and unload the swf file parent?

    I have a question. Let's say I have file1.swf, file2.swf and file3.swf, how can I link this 3 files together.

    Let's assume that file1.swf is the main content file, but as I load file2.swf, I want the file1.swf get replaced by file2.swf. How could unload file1.swf at that time, so that my file2.swf will become the main content file?

    and even once, when my current post file2.swf and I want it get replaced by file3.swf tinkle of a button. so that i can unload the file2.swf and let them file3.swf become the main content file...
    Anyone have ideas on this?
    Thank you..

    If you're publishing to fp 10 + use:

    var loader: Loader = new Loader();

    var urlR:URLRequest = new URLRequest();

    addChild (loader);

    Btn1.addEventListener (MouseEvent.Click, f);

    btn2.addEventListener (MouseEvent.Click, f);

    function f(e:Event):void {}

    {if (Loader.Content)}

    loader.unloadAndStop ();

    }

    {if(e.currentTarget==btn1)}

    urlR.url = "file2.swf";

    } else {}

    urlR.url = "file3.swf";

    }

    Loader.Load (urlR);

    }

    p.s. Please check the useful/correct, if there is.

  • run the error when go to the "home" button after loading external swf

    I work to develop an Android app to learn Arabic, it's very simple.

    to explain the alphabet, I create and load files SWF external, first and second Chargers work well (loading and when click the buttons there is not any question)

    but the third charger charge well also, but the problem when I test project, I make me run error when press home.

    (it does not occur when you load other chargers)

    Here are the sisters Project.rar Android - Google Drive files

    Thank you

    the problem is in the way that you use to add the listeners to events for the buttons, you add a listener for them different click events each keyframe, so you need to remove the headphones before you leave for another frame.

  • load external swf by .extension and get totalFrames

    What I'm trying to achieve is dragging and droping a swf in this app all trace its totalframes.

    But no luck yet, can't seem to ge the file.extension to load.

    code so far:

    package

    {

    import flash.display.Sprite;

    import flash.text.TextField;

    import flash.filesystem.File;

    import flash.events.Event;

    import flash.events.NativeDragEvent;

    import flash.display.MovieClip;

    import flash.desktop.NativeDragManager;

    import flash.desktop.Clipboard;

    import flash.desktop.ClipboardFormats;

    import flash.net.URLRequest;

    import flash.display.Loader;

    import flash.events.Event;

    to import flash.events.ProgressEvent;

    import flash.events.IOErrorEvent;

    SerializableAttribute public class Main extends Sprite

    {

    private var dragTarget:Sprite = new Sprite();

    private static var myLoader;

    var currentfile;

    public void Main()

    {

    addEventListener (Event.ADDED_TO_STAGE, doStage);

    }

    private void doStage(e:Event):void

    {

    tv_mc.addEventListener (NativeDragEvent.NATIVE_DRAG_ENTER, doDragEnter);

    tv_mc.addEventListener (NativeDragEvent.NATIVE_DRAG_DROP, doDragDrop);

    tv_mc.addEventListener (NativeDragEvent.NATIVE_DRAG_EXIT, doDragExit);

    }

    private void doDragEnter(e:NativeDragEvent):void

    {

    NativeDragManager.acceptDragDrop (tv_mc);

    }

    private void doDragDrop(e:NativeDragEvent):void

    {

    var dropFiles:Array = e.clipboard.getData (ClipboardFormats.FILE_LIST_FORMAT) in the table;

    for each (var file:File in dropFiles)

    {

    Switch (file.extension)

    {

    case "swf":

    path_txt.text = file.nativePath;

    CurrentFile = file.extension;

    swfLoader.addEventListener (Event.INIT, loader_init);

    loadswf();

    break;

    by default:

    path_txt. Text = "a file format not recognized";

    }

    }

    }

    private function loadswf (): void

    {

    trace (CurrentFile)

    var mLoader:Loader = new Loader();

    var mRequest:URLRequest = new URLRequest (currentfile);

    mLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, onCompleteHandler);

    mLoader.load (mRequest);

    }

    private void onCompleteHandler(loadEvent:Event)

    {

    trace ("Loaded")

    }

    }

    }

    any help is welcome!

    THX pavel

    part of the problem is that this current file gives only the fileextension

    CurrentFile = file.extension;

    and urlrequest waits the whhole path

    var mRequest:URLRequest = new URLRequest (currentfile);

    also: If you drag multiple files on your application, you will also encounter problems, rather from the loading immedaiately osf must build smth like a queue of the charger (or throw an exception if multiple files are placed in your app)

  • How to load external swf files into the AIR

    I try this code its working at the computer, but when I publish this .apk or .ipa file, my external swf file does not open

    (I included my external file as well)

    places_btn.addEventListener (MouseEvent.MOUSE_DOWN, newvid);

    function newvid(event:MouseEvent) {}

    trace ("you clicked me");

    var loadit = new Loader();

    addChild (loadit);

    loadit. Load (new URLRequest ("scene02.swf"));

    }

    01.jpg

    Add this in your newid function:

    You forgot to put the beginning of your original function:

    var loadit = new Loader();

    addChild (loadit);

    var _lc:LoaderContext = new LoaderContext (false null, ApplicationDomain.currentDomain),

    loadit. Load (new URLRequest ("scene02.swf"), _lc);

  • methods used for loading external assets and SWFs

    Hello world

    My client wants to take all the Flash games on their website and put them on a portable device that is not connected to the internet. I need to ensure that sovereign wealth funds are completely autonomous, in that they do not need Internet load SWF files or other assets. The customer does not have all of the FLA, so my plan is to download the SWF and it decompiler to decompile with Sothink, and then look for the ACEs for these methods:

    URLRequest

    loadMovie

    loadMovieNum

    If the search returns the results then I'll assume that the game is loading something and this match will not be used. The customer does not want to put any time in this development, he will either on the laptop as is or not at all.

    Are there other methods that I should look for that I have not listed? Thank you!

    Here are the different charging methods so that you can look out

    URLRequest

    loadMovie

    loadMovieNum

    Loader.load()

    Sound.load()

    URLLoader.load()

    URLStream.load()

    FileReference.download()

    XML.Load( )

    hope this has helped.

Maybe you are looking for

  • Driver for GIPB-232CV-A

    Where can I find the driver for the GPIB-232CV-A.

  • M1217MFP: M1217MFP scan multiple pages

    Nice day How to scan multiple pages into 1 document. Thank you.

  • The Digital Signatures and Windows Logo Testing

    I'm be repeated pop-up message says "HP PrecisionScan LT Installation - Digital Signature not found '.  I can accept that, but then when you try to install the software a message says: "software you are installing for this hardware HP ScanJet 3300 ha

  • Why a right-click dialogue boxes suddenly appear and follow the cursor?

    This is a really annoying problem, everything will be ok, then all of a sudden, right click dialog boxes will appear and follow the cursor. I left click to get rid of them, that works sometimes, but more often than not they flutter on the screen, som

  • How can I get my shortcut on my dektop?

    I just deleted my McAfee my desktop shortcut. He deleted the shortcut everything and I don't know how to put it back on. I don't know why she deleted, I think that this has happened to me before and I don't remember how I solved the problem or if I d