ActionScript 3 coding to return to the homepage of 10 secs after audio file stops

Hello..

I am having some problems with my Flash project.

At the moment it all works, but I need now to do something I've never done before.

Basically, the user selects a page and the project can run through actionscript 3.0, coding, an audio file and displays the page right in the timeline.

I have a return button which once typed will return to the home page.

I now need to return to home page 10 dry after the audio file as well as keeping the function of the back button.

What should I do?

I can provide the coding I use if necessary.

I am currently using Flash Pro CS6 on a PC Win 7 Pro.

Thank you for your help

Michael

If you need both something happening you have a few choice items from the timer to choose.

The less complicated would probably use the setTimeout() function and call the same function as the button uses.  You just need to assign the function of the event argument to null (as in: buttonFunctionName (evt:MouseEvent = null) function).

Another option is to use the Timer class.

These two options are documented in the help files if you need to find how to use them.

Tags: Adobe Animate

Similar Questions

  • Return to the homepage

    Hey,.

    I've seen a couple of posts related to navigate to new positions, and while I have the basic gist down, I'm having some trouble to go back to the homepage of my 2nd page.

    The first page is called Unit and here is the code:

    package
    {
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.events.MouseEvent;
        import flash.filesystem.File;
        import flash.text.TextField;
        import flash.text.TextFormat;
    
        import qnx.dialog.*;
        import qnx.display.IowWindow;
        import qnx.events.DialogEvent;
        import qnx.ui.buttons.Button;
        import qnx.ui.buttons.IconButton;
        import qnx.ui.data.DataProvider;
        import qnx.ui.display.Image;
        import qnx.ui.listClasses.DropDown;
        import qnx.ui.text.Label;
    
        [SWF(width="1024", height="600", backgroundColor="#cccccc", frameRate="30")]
        public class Unit extends Sprite
        {
    
                    private var currentView:String = "mainWindow";
            private var backgroundBlack:Boolean = true;
    
            public function Unit()
            {
                drawMainWindow();
            }
    
            private function drawMainWindow():void {
                clearWindow();
                this.currentView = "mainWindow";
    
                            createBackground();
    
                            var distanceButton:IconButton = new IconButton();
                distanceButton.setSize(BUTTON_WIDTH,BUTTON_HEIGHT);
                distanceButton.addEventListener(MouseEvent.CLICK, clickDistanceButton);
                distanceButton.x = 47;
                distanceButton.y = 100;
                addChild(distanceButton);
    
                stage.nativeWindow.visible = true;
            }
    
            private function clickDistanceButton(event:MouseEvent):void {
                clearWindow();
                var distanceScreen:distance = new distance();
                addChild(distanceScreen);
            }
    
            private function clickHomeButton(event:MouseEvent):void {
                clearWindow();
                drawMainWindow();
            }
    
            public function createBackground():void {
                var appBackgroundImage:Image = new Image();
                  if(backgroundBlack){
                    appBackgroundImage.setImage(File.applicationDirectory.resolvePath('backgroundBlack.png').url);  
    
                appBackgroundImage.setPosition(0,0);
                addChild(appBackgroundImage);
            }
    
            //Clears the window
            private function clearWindow():void {
                while(numChildren > 0) {
                    removeChildAt(0);
                }
            }
    
        }
    }
    

    Now my second page called 'distance.as' is:

    package
    {
        import flash.display.Sprite;
        import flash.events.MouseEvent;
    
        import qnx.ui.buttons.IconButton;
    
        //[SWF(width="1024", height="600", backgroundColor="#cccccc", frameRate="30")]
        public class distance extends Sprite
        {
            public function distance()
            {
                drawDistanceWindow();
            }
    
            public function drawDistanceWindow():void {
    
                //Home Button - take back to main app screen.
                var homeButton:IconButton = new IconButton();
                homeButton.addEventListener(MouseEvent.CLICK, clickHomeButton);
                homeButton.setSize(48,48);
                homeButton.setIcon("homeIcon.png");
                homeButton.x = 929;
                homeButton.y = 15;
                addChild(homeButton);
            }
    
            private function clickHomeButton(event:MouseEvent):void{
                clearWindow();
                var homeScreen:Unit = new Unit();
                addChild(homeScreen);
            }
    
            //Clears the window
            private function clearWindow():void {
                while(numChildren > 0) {
                    removeChildAt(0);
                }
            }
    
        }
    }
    

    When I click on the "homeButton", the screen goes to gray and is not in fact add the new home screen.

    Any clue?

    In addition, at the same time, you will notice that my first page 'Unit' has a function called "createBackground".

    I want to be able to access the function of my second page (title: distance.as). How can I do?

    I don't want to rewrite the code again, and so it would be better if I just access my second page (createBackground) function.

    If I do: Unit.createBackground ()... it gives me an error.

    Any help would be great!

    Thank you!

    Here's a dispatcher singleton class where you were not sure if it was:

    public class SharedData extends EventDispatcher
    {
      private static var _instance          : SharedData = null;
    
      ///////////////////////////////////////////////////////////////////////
      public function SharedData(target:IEventDispatcher=null)
      {
        super(target);
      }
    
      ///////////////////////////////////////////////////////////////////////
      public static function get instance() : SharedData
      {
        if( _instance == null ) // first time
        {
            _instance = new SharedData();
        }
        return _instance;
      }
    
      // ...
    }
    

    The singleton is added to each class/page/EC that never needs to share information or communicate between pages:

    private var shared_data : SharedData = SharedData.instance;
    

    To send a message to a page:

    this.shared_data.dispatchEvent( new Event( 'showpage1' ) );
    
    // typically I define a public static const in the singleton class for the event id
    

    In the main root Sprite, he listens to this event (no matter who's asking):

    this.shared_data.addEventListener( 'showpage1', ShowPageOne );
    
    // ....
    
    private function ShowPageOne( event : Event ) : void
    {
      // show page 1
    }
    
  • The table widget. Inserting text, audio files, and pdf files.

    Hello world

    I have a client [Organization of the Church], that they want to put all their audio Sermon in their Web site. Similar to this: http://www.calvarysj.org/?page_id=1310

    They have many audio files and I think I need to sort by year or book but going back to my question, nobody knows how to do or what kind of widget I use?

    Thank you

    Debs

    You use the table here widget:

    http://musewidgets.com/collections/all/products/table-maker

    In addition to adding audio files;

    https://forums.Adobe.com/message/6429361

    https://forums.Adobe.com/message/6276219

    Thank you

    Sanjit

  • The icon to return to the homepage has disappeared.

    Back to firefox icon has disappeared, that is when I read my gmail, there is no icon (House?) go to the home page. How can I get that back?

    This has happened

    Each time Firefox opened

    Is a few days ago

    Make sure that the toolbar button is on the toolbar.
    See the controls, buttons, and Toolbars Customize Firefox

  • How to return to the homepage of first after finishing the quiz?

    Hi, don't know if it's more a question of Captivate9, but I downloaded an evaluation module for captivate on bonus at the end of a course, it works as expected, but when I finish and then click on the "Continue" button nothing happens. How can I make it behave as learning modules of first failure where you are taken to the home page of the learner? At the moment the only way I can do that is to hit the cross at the top right (circled in red below):

    continue.PNG

    Best, James

    Hello

    You need to take steps to release the button continue in Quiz preferences while creating your Captivate 9 project.

    Steps to follow:

    1. go to preferences in Captivate 9 quiz game

    2. go in Quiz > success or failure

    3. choose 'Exit' action for transmission or quality defect

    Thank you

    Shikha

  • the audio tracks of the missing at the end when played notes from audio files.

    I copied the audio tracks in the media player of different record library. The discs are very clean and none of them were damaged. When I play these beaches towards the end notes are always droped. It sounds as if the Truck was damaged. When I listen to these tracks on a DVD player or another player, yet there is no problem. Is this a software or hardware problem and what can be done to solve this problem. I regularly receive updates of windows.

    Hello

    I suggest that you follow these steps and check if the problem persists.

    Step 1:

    Update of your sound, card drivers and check if the problem persists.

    Step 2:

    Test the issue in a clean boot State, and check if the problem persists.

    Note: Follow step 7 to your computer as usual.

  • How to import a video from google on Windows Movie Maker when it's a MPG4 file and the film detects it as an audio file?

    I cannot read the file as a video and only as an audio Director. How to change the file in one only that the manufacturer can read?

    I cannot read the file as a video and only as an audio Director. How to change the file in one only that the manufacturer can read?

    ================================
    Might be interesting to try to convert the .mp4 files
    format .wmv before import into Movie Maker.

    The following freeware can convert:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Format Factory
    http://www.pcfreetime.com/
    (FWIW... installation..., you can uncheck
    ('all' boxes on the last screen)

    After downloading and installing Format Factory...
    Open the program and choose an output folder...
    (this is where you will find your files when they are
    converted)

    Drag and drop your clips video .mp4 on the
    main screen...

    Select "all to WMV" / OK...

    Click on... Beginning... in the toolbar...

    That should do it...

    John Inzer - MS - MVP - Digital Media Experience - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • When I insert video file inside the chronology of its display 4 audio files with it under the video but it must be an audio file with a video why his put four

    I really need to know its happened before, how can I solve this problem

    Specify the name of the program that you use, so a moderator can move this message to the correct forum

    This Cloud forum is not for help with problems of program... program would be Photoshop Lighroom or Muse or?

  • The use of AEC in After Effects files

    If I import a 3d Cinema 4 d AE scene, what I owe anything at the cinema, before I can use the AEC in AE file? In other words it automatically updates changes in what I see in my AE calendar after changing an animation in C4D without making these changes in C4D first? I prefer not to use Cineware because it does not account for things like target tags, etc.

    ACS files are only meta files which contain data of the transformation of the ligghts and objects but also make it pass info for easy composition. They contain no data. You have to go all in C4D properly first.

    Mylenium

  • How do I add or remove silence at the beging and end of each audio file by using batch

    Hi all

    I'm new to this forum. I've been using Audition 3 for the last two years and these days I need to coop with a very difficult situation, which is; I have over 2000 files that begin and end with a random length of silence, it varies from 0 to 7 sec. My question is, how do I set the duration of silence at the beginning and at the end of each file to a constant quantity of 2s using batch?

    Kind regards

    Pavlos

    pavlos22 wrote:

    My question is, how do I set the duration of silence at the beginning and at the end of each file to a constant quantity of 2s using batch?

    You have to perform two processes to achieve this. The first is that you need to remove all amounts of the silence of the files, so that they begin at zero and stop at the end. You can do it automatically using edit > delete Silence, but you should pay attention to how implement you.

    After that, you need a script to add a set amount of silence at each end of each file and run this as a batch process. Information on how to do that are in this thread, in the role of fourth, and as far as I know, this is the only way to do it. There is more information in the rest of the wire also, explain how it actually works.

  • My iPad keeps returning to the home page

    MY iPad 5.01 keeps returning to the homepage when you use, how dp to stop this

    By 5.01 iPad do you mean a first generation iPad?

    It is very possible that what you're trying to do is simply beyond the capabilities of the iPad. If you do not have a first generation iPad then your device is 5-6 years, which is considered old in the world of technology.

    One thing you can try is to force your iPad to restart. Press the sleep and home for 20 seconds approximately. If you see a slider offering to put off, ignore that and hold the buttons until you see the Apple of money. Once you see that, let go of taken and let it reboot and see if that helps.

  • How can I return to the home page to access the box

    all my files appear highlighted in blue at the top of the screen next in the tab of the box when I open thunderbird Mozilla to recover email rather than the display of the homepage with box sand tab no file titles don't point blue poster culminating next in the tab of the box. Help, please!


  • How can I get the soundtrack of pacman, playing on google, to stop playing when I was able to connect Firefox?

    Since this morning, when I connect on Firefox, I immediately start to hear a soundtrack of pacman. In my view, it is connected to the pacman game displayed on the homepage of google. How can I stop this?

    This has happened

    Each time Firefox opened

    Is this morning

    How can I disable the cool previews?

  • What is the best way to retrieve deleted mp3 files? I am running OSX Leopard 10.5.8 on a PowerPC G5 tower. I'll be very grateful for any help in this matter. Thanks to Chris

    Hello

    What is the best way to retrieve deleted mp3 files? I had a lapse of attention and I deleted a folder containing most of my music files. It is for the most part, the mp3 but there was regular audio files and some wav files in there also. I am running OSX Leopard 10.5.8 on a PowerPC G5 tower. I have another PPC machine to help the recovery, if I need, but at the moment, he is not appearing on my network (3 computers). I'm trying to change this soon. I'll be really grateful for any help in this matter.

    Thanks to Chris

    If you emptied the Recycle Bin after you move the folder to the trash, and you don't have a time Machine or another backup, then it is lost, sorry.

  • Set the minimum size of an audio file for media player

    When the drive media computer analysis for audio files, how can I set it so I don't get all the dings of Dong and other annoying files

    Hello

    Limit audio files in Windows Media Player library.

    See also:

    Windows Media Player library: frequently asked questions

    You can also try to rebuild the database from the Windows Media Player library and check:
     
    Note: Re-construction of the Media Player library will delete all the files in the library.
     
    To do this, disable the Windows Media Player database by following this step:
     
    a. exit Windows Media Player.
    b. Click Start, run, type %LOCALAPPDATA%\Microsoft\Media Player and then click OK.
    c. Select all files in the folder and then click on Delete on the file menu.
    Note: You don't have to remove the folders that are in this folder.
    d. restart Windows Media Player.
    Note: Windows Media Player automatically rebuilds the database.
    If this does not resolve the problem, disable the Windows Media Player database cache files. To do this, follow these steps:
    a. exit Windows Media Player.
    b. Click Start, click Run, type % LOCALAPPDATA%\Microsoft and then click OK.
    c. Select the Media Player folder, and then click on Delete on the file menu.
    d. restart Windows Media Player.
     
    You can also consult the information provided in the article below and see if you find the information useful.
     
    You cannot view, add, or remove items from the Windows Media Player library

Maybe you are looking for