Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 837555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:09:34+00:00 2026-05-15T05:09:34+00:00

I just wanna know if it is possible to pause a playing SWF file

  • 0

I just wanna know if it is possible to pause a playing SWF file in adobe flex?
I have an SWF Loader and it plays my SWF file however, it does not have any capability (or built in function) that pauses the file.

Can anyone help me with this please? I’ll appreciate some code to start with. 🙂 Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:09:34+00:00Added an answer on May 15, 2026 at 5:09 am

    You can use the stop();

    The following is an example of a swf playing and control is given to the play and pause and gotoandstop buttons.

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   minWidth="955" minHeight="600">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
    
        <fx:Script>
            <![CDATA[
                private function playHandler():void {
    
                    var file_mc:MovieClip = fileswf.content as MovieClip;
                    file_mc.play();
    
                }
    
                private function pauseHandler():void {
    
                    var file_mc:MovieClip = fileswf.content as MovieClip;
                    file_mc.stop();
                }
    
                private function pauseat(frame:Number):void {
    
                    var file_mc:MovieClip = fileswf.content as MovieClip;
                    file_mc.gotoAndStop(frame);
                }
    
            ]]>
        </fx:Script>
    
    
        <mx:SWFLoader x="0" y="0" source="abc.swf" id="fileswf"/>
        <s:Button x="0" y="200" label="Play" id="playbtn" click="playHandler()"/>
        <s:Button x="100" y="200" label="Pause" id="pausebtn" click="pauseHandler()"/>
        <s:Button x="100" y="250" label="Pause at A" id="pauseAbtn" click="pauseat(1)"/>
        <s:Button x="200" y="250" label="Pause at B" id="pauseBbtn" click="pauseat(2)"/>
        <s:Button x="300" y="250" label="Pause at C" id="pauseCbtn" click="pauseat(3)"/>
        <s:Button x="400" y="250" label="Pause at D" id="pauseDbtn" click="pauseat(4)"/>
        <s:Button x="500" y="250" label="Pause at E" id="pauseEbtn" click="pauseat(5)"/>
    
    </s:Application>
    

    For completeness I have placed in the method for @Embed (it is not possible to get the original swf directly via SWFLoader [runtime vs compile time] but you can you can load the Bytes from a Class)

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   minWidth="955" minHeight="600" addedToStage="init()">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
    
        <fx:Script>
            <![CDATA[
    
                [Embed(source="abc.swf", mimeType="application/octet-stream") ]
                public var abc_cls:Class;
    
                public var ldr:Loader = new Loader();
    
                private var file_mc:MovieClip;
    
                protected function init():void
                {
                    ldr.loadBytes( new abc_cls() as ByteArray );
                    ldr.contentLoaderInfo.addEventListener(Event.INIT, onSwfLoaded);
                    swfcontainer.addChild(ldr);  
                }
    
                private function onSwfLoaded(e:Event):void {
                    file_mc = ldr.content as MovieClip;
                }
    
                private function playHandler():void {
    
                    file_mc.play();
    
                }
    
                private function pauseHandler():void {
    
                    file_mc.stop();
                }
    
                private function pauseat(frame:Number):void {
    
    
                    file_mc.gotoAndStop(frame);
                }       
    
            ]]>
        </fx:Script>
    
    
        <mx:Image id="swfcontainer" />
        <s:Button x="0" y="200" label="Play" id="playbtn" click="playHandler()"/>
        <s:Button x="100" y="200" label="Pause" id="pausebtn" click="pauseHandler()"/>
        <s:Button x="100" y="250" label="Pause at A" id="pauseAbtn" click="pauseat(1)"/>
        <s:Button x="200" y="250" label="Pause at B" id="pauseBbtn" click="pauseat(2)"/>
        <s:Button x="300" y="250" label="Pause at C" id="pauseCbtn" click="pauseat(3)"/>
        <s:Button x="400" y="250" label="Pause at D" id="pauseDbtn" click="pauseat(4)"/>
        <s:Button x="500" y="250" label="Pause at E" id="pauseEbtn" click="pauseat(5)"/>
    
    </s:Application>
    

    I am sure now that it is the embed that was giving the problem sorry for any confusions. So if you need your swf as part of your file below should the trick.

    The last way you can achieve getting assets into your flex workspace is to use SWC Assets Method.

    Good Luck ! 😀

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just wanna know using org.eclipse.jdt.core.dom.ASTParser if it is possible to parse only a
i just wanna know is it possible to display the Calendar in the month
I just wanna know how to do an if -statement in simple HTML. Like
I am new to LINQ and just wanna know; is there any application in
I am a new newbie to android. Just wanna know how could we create
I wanna know whether is it possible to store array of string in the
I just wanna to substract one CSV-File from another one, but not if the
I am using a BufferedReader. I just wanna know how to clear the BufferedReader
I just wanna know how made a many to many relationship between two entity´s
Hi When i wanna start a new project, I have enough details to just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.