Reading random movieClips onClick, then return to the start screen

Hi I am very new to actionScript 3. My project starts with who travel a film clip (startPage), then onClick, moviecip startPage disappears and a random movieclip(sc01-sc03) loads and plays. Once each random movieclip is playing, I want to remove from the scene and reload the home page. I have the random part using a table, but I can't figure out how to remove the movieClip random sc once it is loaded. I tried using removeChild, but Flash is not recognizing that I added and the movieclips sc in the Park. Help!

My current code below:

package

{

import flash.display.MovieClip;

import flash.events.MouseEvent;

import flash.events.Event;

SerializableAttribute public class Main extends MovieClip

{

var startPage:StartPage;

var sc01:Sc01;

var sc02:Sc02;

var sc03:Sc03;

private var _scenario:Array;

public void Main()

{

startPage = new StartPage();

SC01 = new Sc01();

SC02 = new Sc02();

Sc03 = new Sc03();

_scenario = new Array();

MC.addChild (startPage);

Add scenes to the table

_scenario [0] = sc01.

_scenario [1] = sc02;

_scenario [2] = sc03;

Add event listeners

startPage.boxButton.addEventListener (MouseEvent.CLICK, onBoxButtonClick);

startPage.addFrameScript (startPage.totalFrames - 1, stopPageFunc);

SC01.addEventListener (Event.ENTER_FRAME, everyFrame01);

SC02.addEventListener (Event.ENTER_FRAME, everyFrame02);

Sc03.addEventListener (Event.ENTER_FRAME, everyFrame03);

stop at the end of the chronology of startPage

function stopPageFunc()

{

startPage.stop ();

}

function onBoxButtonClick(event:MouseEvent):void

{

MC.removeChild (startPage);

MC.addChild (_scenario [Math.floor (Math.random () * _scenario.length)]);

}

function everyFrame01 (): void

{

If (sc01.currentFrame is 50)

{

MC.removeChild (sc01);

MC.addChild (startPage);

startPage.gotoAndPlay (1);

}

on the other

{sc01.play ();

}

}

function everyFrame02 (): void

{

If (sc02.currentFrame is 50)

{

MC.removeChild (sc02);

MC.addChild (startPage);

startPage.gotoAndPlay (1);

}

on the other

{sc02.play ();

}

}

function everyFrame03 (): void

{

If (sc03.currentFrame is 50)

{

MC.removeChild (sc03);

MC.addChild (startPage);

startPage.gotoAndPlay (1);

}

on the other

{sc03.play ();

}

}

go to the homepage when script

}

}

}

replace line 44 by:

MC.removeChild (MovieClip (e.currentTarget));

Tags: Adobe Animate

Similar Questions

  • Some applications Windows 8 will not be open and constantly return to the start screen

    Some Windows 8 applications (calendar, Photos, Messenger, etc.) do not open and return to the start screen. I updated the computer, so the apps worked during this session.  However, after that I disconnected and re-connected to the laptop the next day, the same apps stopped working again.  This continues that occur on a regular basis.  How to solve definitively the problem?

    Note: I noticed that others have this same problem, and I tried the troubleshooting suggestions (i.e., to download the troubleshooter of the modern user interface, cache cleanup, etc.), but none of these suggestions has definitely solved the problem.  I bought my new laptop two months ago and have been facing this problem since.  I want a permanent solution.

     
    W8 comes with built in AV from Microsoft (Windows Defender) solution. You do
    not actually need a third party.
     
     
    Barb
     
    MVP - Windows/entertainment and connected home
     
     
    Please mark as answer if that answers your question
     
     
     
     
  • error then return to the main screen.

    Hi experts,

    When I navigate to the main screen I get below error. I click on the Cancel button and I see this error on the home page.

    < 2015 sep 17 20:34:45 CEST > < WARNING > < Socket > < BEA-000449 > < close the socket, as no data read on 127.0.0.1:64,085 during the inactive configured timeout of 5 seconds. >

    < Sep 17, 2015 20:36:20 CEST > < error > < javax.enterprise.resource.webcontainer.jsf.application > < BEA-000000 > < Error rendered view [/ FCRHome2]

    java.lang.IllegalStateException: component data flow is not found

    at oracle.adfinternal.view.faces.streaming.StreamingDataManager.submit(StreamingDataManager.java:519)

    at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer._encodeStreamingResponse(DocumentRenderer.java:4047)

    at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1707)

    at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1600)

    at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:525)

    Truncated. check the log file full stacktrace

    >

    Hi Preta M

    Found a bug with Custom UIShell Jdev 12 C

    Custom UIShell JDeveloper 12 c

  • Often my e-mail application stops and returns to the start screen.

    Hello again,

    The answer to fix my inability to eliminate the old emails worked.  I've deleted and reinstalled my Hotmail account (the one with the two old emails, I couldn't delete) and the problem was solved.  Now I have another that is more frequent than before.  I can be in my two email accounts (for the most part occurs in my second Yahoo account).  I could be in the middle of a long email or even just start and my computer automatically shut down the email, then go to the main start screen.  When I enter the e-mail icon, I am automatically taken to my "Hotmail" account each time.  It's so boring that I now have access to my accounts of messaging through Web applications.  In the beginning, sometimes this would save a draft of the email, but now it doesn't.  Not sure if I changed something that could have caused this because I had nothing else questions e-mail with 8 of the window.  Not a big fan of him and prefer Windows 7.  Thanks for any help to solve this very annoying problem.

    had the same problem with my Windows 8, which has developed after choosing the prospects of the original Hotmail/Windows Live installation. On the Windows Welcome screen, I uninstalled the original mail app by clicking the tile and choose uninstall. I then reinstalled the app from the store Windows. The messaging application now opens successfully.

  • I have a Dell Windows 7 after downloading updates crucial sercurity, I get a message saying "Connection to the internet." The display then returns to the logo screen. What can I do?

    I have a Dell Windows 7 after downloading the critical updates, I get a message saying "Unable to connect to the internet."  What should I do?

    Hello

    1. Once you get this error message?
    2. are you able to browse the internet using your internet browser?

    Step A.
    Please check if you are facing the same question when working in mode safe mode with networking.
    a. restart your computer.
    b. when the computer starts, you will see your computer hardware are listed. When you see this information tap the F8 on your keyboard key repeatedly until you are presented with the screen Windows 7 Advanced Startup Options.
    c. using the arrow keys, select the desired option of Mode without failure.
    d. press the Enter key on your keyboard to boot mode safe mode of Windows 7 with networking.
    e. when Windows starts, use check and Internet explore if the problem persists.
    For more information, refer to the article below.
    Troubleshooting in safe mode
    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshooting-problems-while-in-safe-mode

    Step B.
    If the problem exists not in Mode safe run mode startup minimum troubleshooting to find the root cause of the problem.
    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/kb/929135
    Note: When the diagnosis is complete, don't forget to reset your computer to normal startup. Follow step 7 in the above article.

    I hope this helps.
  • My books downloaded Kindle won't open in Windows 8. When I click on the open book, I make a return to the start screen. How can I fix it?

    No problem in downloading books. I use the Kindle for PC app from Amazon, but not Windows 8 Kindle that application has been preloaded (also checked for update of the Windows store. "I have a Lenovo X 1 carbon Touch.

    Hi Rawasa,

    Thanks for sharing of the issue in the Microsoft Community.

    I understand from the information provided, you are unable to open the Kindle app. We need additional information to help you in a better way.

    1 did you recent hardware or changes to the software?

    2. have you set any proxy to connect to Internet?

    3 have you installed the latest updates to Microsoft?

    4. have you installed a third-party antivirus?

    Here's something that you can try and check if these steps help you to resolve the issue.

    Method 1: Download and run the troubleshooter modern UI App and check.

    http://download.Microsoft.com/download/F/2/4/F24D0C03-4181-4E5B-A23B-5C3A6B5974E3/apps.diagcab

     

     

    Method 2: Follow the link to the troubleshooting steps.

    http://Windows.Microsoft.com/en-us/Windows-8/what-troubleshoot-problems-app

     

     

    You can also contact the Kindle to get help. Here is the link for the Kindle support.

    http://www.Amazon.co.UK/GP/help/customer/display.html?nodeID=200487860

    I hope this helps. For the Windows questions or issues, please get back to us. We are here to help you.

  • After a Windows Update, that the several apps shortcut does not work, I went back to the start screen.

    Shortcuts to programs of work OK, but two shortcuts to applications of games and two apps printer briefly displays a title screen and then return to the start screen.  I tried to remove and then reload applications without success, I ran Paretologic Health program several times, tried to defrag the drive is done everything to nothing.  Troubleshooting Windows detects no error either.

    It worked for me in the past...

    Run the Windows update repair tool Control Panel / troubleshooting / view all (in the left margin)

    followed by the two of them, even if the first says no found error.  Maybe 15 minutes each.

    Form a command prompt (admin)

    DISM / Online/Cleanup-image /Scanhealth
    DISM / Online/Cleanup-Image /RestoreHealth

  • Under XP, when I try to install the program screen flash BACK and trying to change back, but then return to the windows form.

    When I run the Setup in the program screen flash backs and trying to change back, but then return to the windows form.

    * original title - back program will not be run. *

    How old is this program and what is his name?  If you give us the name of the program someone read here who have experience with the peculiarities of the program might be able to provide more help.

    Open a command prompt, and then try running Setup from the command prompt.  To start a command prompt, type CMD in the box run from the start menu and press or click OK .  At the command prompt, you can use the CD command to navigate to the CD, or you can run the Setup program by using the full path to the Setup program, for example:

    x:\Install.exe

    where x is the CD drive letter.

    John

  • try to install sp1 of Vista he gets at the end of step 3, then returns to the original OS

    original title: Vista SP1
    Whenever I try to install sp1 of Vista it happens at the end of stagen 3 then returns to the original OS

    Software probably prevents writing to the registry.  Try to install in clean boot mode.

    http://support.Microsoft.com/kb/331796

  • Can I access a label inside a MC and then return to the main time line

    Here is my current set up.

    I have a section marked on the main timeline that has the icons of 12 different videos. Each icon acts as a button and brings a user to a section marked with a FLV Playback component work video to play the corresponding video. These marked sections are located on the main of the time.

    This methog is my very long time mainline. Is there a way to do an additional MC which will hold all the buttons of the video and then have this MC separated in marked sections.

    In other words can I access a label inside a MC and then return to the main time line?

    My current code to access the label placed on the main timeline is:

    HowTo_maininfo_mc.theArrangement_btn.addEventListener (MouseEvent.CLICK, theArrangement_btn_amimated_btnDown);

    function theArrangement_btn_amimated_btnDown(event:MouseEvent):void {}

    gotoAndPlay ("theArrangement");

    }

    What it would be like if my "theArrangement" label would be located inside a MC?

    Is there a specific code of if I want to have a close button located on the label inside a MC and he needs to get on a label located on the main timeline?

    You should have an image with an flvplayback component and having each button assign the variable value from a source that is used by your component:

    var sourceVar:String;

    function theArrangement_btn_amimated_btnDown(event:MouseEvent):void {}

    sourceVar = "arrangement.flv";  for example

    gotoAndPlay ("flv_pb");

    }

    ///

    and as part of the "flv_pb", use:

    yourflv_pb.source = sourceVar;  where yourflv_pb is your component instance name.

  • updates Windows returns to the start-up and restart the portable computer

    I put a clean image of windows 7 on my laptop and started running the updates of windows. There were 200 +. They download and restarted the computer and start the installation. The problem is now that he gets so far installs it fails and he returned to the starting point and then restart the laptop and the process begins again. They only way I can get back to my computer through safe mode. Any suggestions?

    Try excluding upgrades recommended to install important updates and only load the Important updates first which should be updated about 159 200 not.

    If you get hung up refer to the latter.

    It is expected by M$, we must now jump through hoops to clean install.

    http://www.ZDNet.com/article/sticking-with-Windows-7-the-forecast-calls-for-pain/

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-update/Windows-Update-remains-at-checking-for-updates/ff3c442e-79a6-40d3-AC35-29e130cebef1

    If looking for updates to hang on a current installation,

    Switch your windows update setting to never check the updates temporarily

    Restart the machine

    Then you download this from your download folder run from there.

    https://TechNet.Microsoft.com/library/security/MS16-039?f=255&MSPPError=-2147217396

    Download the x 86 for 32-bit or x 64 for 64-bit

    Install it and restart when prompted too after he did a search of stand-alone for updates that should not

    take too long, it took all of 5 seconds, '' If '' windows update settings are turned on forever check

    updates before running from the downloads folder.

    Once it installs and restarts

    You can reset your updates affecting everything you had before default =...

    Then check the updates manually.

    I think that the solution came from Softpedia and Joel_CS posted on this thread,

    http://News.Softpedia.com/news/Windows-Update-hanging-when-downloading-April-12-patches-502886.shtml

    You must scroll down for Joel SC post threads, it is the last answer on this page,

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-update/Windows-Update-hangs/dbd539c3-bfc6-42DF-a6ff-0e55ef7938eb?page=6

  • Simulator deploy token not to see the place. How to return to the home screen of the setting screen?

    I tried to test the app on my bb10 Simulator,

    of webworks...\bin, I ggenerated dubugtoken, then use blackberry - deploy deploy IP 192.168.59.130 Simulator.

    but side Simulator, I do not see that this token of debugging has been deployed.

    What should I do?

    How to return to the home screen of the setting screen? There is no back button the page setting of the Simulator.

    Thank you.

    Hi neemliu,

    To return to the home screen, you must slide up from the bottom of the screen. You need to make the same gesture, using your mouse when you use the Simulator. Drag the mouse with the lower edge of the screen to the top.

    What do you see in the output for blackberry - deploy when you deploy the token? He succeeds?

    Have you tried to deploy applications? The process is the same, if you can deploy applications then you should be able to deploy the debugging token.

  • Return to the main screen

    Hello...

    I have 3 screens... when the user makes a click of a button in the screen has... I send screen b... and when the user to click a button in this screen I send to (C) of the screen

    Now I have to put a button on the screen that the user can return to the screen has... (home) if I use the 'back arrow' key of the device returns to the screen (B) and later has... So what can I do?

    The display "battery" is not strictly a battery. You can extract a screen that is not at the top. So to do what you want, when you tap the screen C, you could pierce the veil B backstage. However, users generally expect the 'return arrow' key (actually, the ESC key) to return to the previous screen. This regime would be in contradiction - when they pressed the screen C to ESCAPE, they want to go back to (which is what you want, but not typical for BB applications).

    If you want ESC to return to the screen B and have a separate on screen C button to return to the screen has, simply write the change listener for the pop key field (or close) the two C and B display C would need to have (or be able to find) a reference to screen B.

    Another approach is to have one screen and have three 'modes': A, B and c. when switching between modes, remove all fields and add the fields to the desired mode. ESC - unless override you the default behavior - would then always exit the application (since there is only one screen).

  • How to return to the main screen after watching downloads?

    This such a stupid question, but I have forgotten how to return to the main screen after watching downloads.

    Close the window or tab to download (if you are using some addon) or only to change the tab:

    Downloads:

  • Returns to the home screen when I press the address bar

    Whenever I press the address bar - to check the address to type in a new - the browser returns to the home screen "Awesome." I would have preferred just the current site until I have actually navigate away from him.

    Ugh. I would prefer a home button or something. If I change my mind, or was simply check the URL, now I have to wait for the page to load again.

    Thanks for the info. At least now that I realized how to display the URL rather than the title of the page, I run into this problem less.

Maybe you are looking for