Multiple Scenes and Labels

Basically what I'm trying to do is use the "page up" button to navigate to different labels on the timeline. The problem is that the labels are in different scenes (for example label_5 is in Scene 3). So each time I go to a label outside the scene, I get an error message.
var myLabels:Array = [ "label_1", "label_2", "label_3", "label_4", "label_5"];
var nextLabel:String;
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
function keyPressed(evt:KeyboardEvent):void
switch(evt.keyCode)
case Keyboard.PAGE_UP :
    var inc:int = myLabels.indexOf (currentLabel);
    inc = inc < myLabels.length-1 ? inc+1 : 0;
    nextLabel = String(myLabels[inc]);
    gotoAndStop(nextLabel);
    break;
Is there an easy way to fix this?
Thanks so much in advance.

Scenes have never been a good idea - but if you must use them you'll need to do this different. Either use two arrays - one with the frames like you have now, and a second one with scene names. Or modify the array you have now to consist of an array of arrays - with the sub arrays containing frame,scene values. I'd probably use two arrays though as it's less to modify... something like so should do it.
var myLabels:Array = [ "label_1", "label_2", "label_3", "label_4", "label_5"];
var myScenes:Array = ["scene1", "scene1", "scene2", "scene3", "scene3"];
var nextLabel:String;
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
function keyPressed(evt:KeyboardEvent):void
switch(evt.keyCode)
case Keyboard.PAGE_UP :
    var inc:int = myLabels.indexOf (currentLabel);
    inc = inc < myLabels.length-1 ? inc+1 : 0;
    nextLabel = String(myLabels[inc]);
    gotoAndStop(nextLabel, myScenes[inc]);
    break;
PS - no need to cast nextLabel to a string like you have - it already is a string in the array.

Similar Messages

  • AS2 open another scene and play a label inside a mc

    I'm looking for a piece of AS2 script that will open a different scene and play a label from inside a mc.
    So it should be something like...
    On release go to scene x and play x label from inside x mc.
    I can get to the scene via the button "on release gotoandplay scene 2 .
    Once in the scene I can get a button to gotoandplay themc.mc and the label.
    But what I really want to do is get the button on one page to go to the scene and play the label on the second scene.
    Any ideas?

    use:
    gotoAndPlay("scene2_frame1");
    this.onEnterFrame=someF;
    function someF(){
    yourmovieclip.gotoAndPlay("some label");
    delete this.onEnterFrame;

  • Can anyone please make an app or intergrate location based reminders as multiple locations and have reminders pop up as a whole list just like you list them on a piece of paper and check them off as you walk in a store?

    My name is Tess Loggins and I am a lover of Omnifocus for iphone. I
    > love Omnifocus ,but it is lacking a feature for me. I don't really
    > know how to write this so, please bear with me. Ok. Take out a piece
    > of paper and label it on top Grocery List. Keep in mind that you like
    > to shop at Giant Eagles and Trader Joes. (these two stores are your
    > multiple locations)Write on your list eggs, pickles, butter, wine,
    > tomatoes and lobster(my favorite). So now you have your list. Now it's
    > time to go shopping. let's get into the car..(Please imagine all of
    > this on your iphone/and or using Omnifocus).Lets go to Giant Eagles
    > first. Wow! my whole list on that piece of paper pops up on my screen
    > on my iphone, so all I have to do is check off the items I needs as I
    > walk through the store. Now, I have decided that I will now go to
    > Trader Joes for the wine, pickles and lobster... (I didn't check off
    > the wine, pickles or lobster) Ok, back into the car.lets now drive to
    > Trader Joes. Now ,we are pulling into the driveway of Trader Joes and
    > BAM. my list wine, pickles and lobster (Just like I  wrote it on that
    > piece of paper) pops up. Now we enter Trader Joes and as we walk down
    > the aisle, we can check of the whole list because it's now on our
    > iphone screen. This to me is what I call technology.. I hope you
    > understand my point I am trying to get across. In your next Omnifocus
    > update can you PLEASE implement this to your app. I  want that whole
    > experience in the app. Is this at all possible to do? Is there even a
    > way that I can help to make this happen! In all the apps in the Appstore no one has come up with this idea and has not made app just like this.

    You seem to think you are talking to Omnifocus here.  The odds of actually reaching them here are practically 0%, I would guess.
    I suggest you go to the omnigroup forums and present your suggestions in the omnifocus forum.
    http://forums.omnigroup.com

  • Multiple scenes not working on any computer except my own.

    HI everyone,
    I try to run a swf or html file of my fla file and it only works on my machine but not on my laptop. I have the latest flash player installed but it still doesn't work.  Can anyone advise. My laptop works for single scenes swf and html but not for multiple scene file.
    Aron

    it just sits there and nothing moves or comes on when I hit the play button in my application.  I have tried running a swf file through firefox and an html publications of my file but they don't seem to work on my lap top except for on the original computer I created the app on.
    Could you or anyone please tell me if these links work http://dl.dropbox.com/u/307778/Gemoro%20BovoMetzia%2023b-1-9%20Scenes.html
    http://dl.dropbox.com/u/307778/Gemoro%20BovoMetzia%2023b-1-9%20Scenes.swf
    Thanks for your help
    Aron

  • Using a function in multiple scenes

    I have a .fla project being created under CS4, using
    ActionScript 3.0, that consists of multiple scenes.
    In the code attached to the first scene, I define some
    functions that are used as methods on buttons:
    function MouseDown(TheKey:Object):void
    TheKey.alpha=0.6;
    function MouseUp(TheKey:Object):void
    TheKey.alpha=1.0;
    function AlphaPoint6(event:MouseEvent):void
    MouseDown(event.currentTarget);
    function AlphaonepointO(event:MouseEvent):void
    MouseUp(event.currentTarget);
    And I use a couple of the functions as EventListener methods
    on buttons
    Key1.addEventListener(MouseEvent.MOUSE_DOWN,AlphaPoint6);
    Key1.addEventListener(MouseEvent.MOUSE_UP,AlphaonepointO);
    So far so good.
    Then, I create a second scene in which I have some other
    buttons.
    When I try using the same functions as eventlisteners on
    these buttons, in the code for the second scene:
    Key11.addEventListener(MouseEvent.MOUSE_DOWN,AlphaPoint6);
    Key11.addEventListener(MouseEvent.MOUSE_UP,AlphaonepointO);
    then, I get the error messages
    1120: Access of undefined property AlphaPoint6
    1120: Access of undefined property AlphaonepointO
    BUT, if I try declaring these functions again with the script
    of the second scene, I get the error message
    1021 Duplicate Function definition
    So, I seem to be stuck between a rock and a hard place. On
    the one hand, when the compiler parses the second scene, it
    believes those functions are defined (as it is not happy if you try
    defining them again). On the other hand, the compiler does not
    think they are defined. as it considers them to be undefined
    properties.
    Does anyone have an idea about how to resolve this conumdrum?

    One option is to not use scenes. Just take what you have as
    scenes and either place them in the one timeline, or convert them
    into movielcips. In my own design work, I have never used scenes.
    When I first encopuntered them via someone else's design, I
    immediately disliked them because it meant I had to search thru
    inobvious places to find things that needed to be revised. Other
    folks that help in these forums have their own reasons for
    promoting not using scenes... troublesome, unreliable, outdated,
    etc

  • Multiple Selection Keywording/Labeling (Bug?)

    I recently noticed an inconsistency in behavior when selecting multiple images and applying a color label or keyword.
    If I am in grid view in the main window and use the lower row of images to make a sequential selection of, for example,
    10 images by selecting the first and shift-clicking the 10th. If I apply a keyword to these images, it works just fine.
    However, if I am in single image view rather than grid view and make the same selection using the scrolling lower
    row, only the first image is keyworded or color labeled.
    I personally like to look at a single image in the main viewer and use the lower scroller to go from image to image and apply keywords. If I need to apply to more than one, I shift click and select multiples.
    However, I am not able to do this when viewing only a single image in the main viewer.
    Am I missing something in the logic of this behavior that perhaps is  useful?
    Can someone attempt to reproduce this?
    Thanks so much for your help.
    -Scott
    I am running the latest update of LR2 on a Mac Mini in Snow Leopard.

    scottgriz wrote:
    ...what is the point of being able to multiselect in the film strip when in single image view? It seems to me that a multiple selection in the film strip should behave the same no matter which way I view the main window. If it does not, there should be some logic to this behavior, not simply, "That's how it works".
    -Scott
    Here's some practical uses for being able to select multiple images in the filmstrip:
    1. You're using loupe view and want to limit the number of selections so you are able to browse and choose the best image from a specific group of similar images.
    2. Same as 1 but you want to apply ratings or labels to the images in the group. The rating/label will be applied to only the most selected image, not all of them, which is the desired behavior.
    3. When in survey view the selection is controlled by the filmstrip. You can add and remove images from survey view by simply clicking on them in the filmstrip.
    4. When in compare view, you can change the select/candidate images by clicking in the filmstrip.
    There might be more, but I use these all the time.

  • Scenes and Apps?

    Hi Guys,
    I have been working on my second app and I am using scenes to separate the various elements, 4 in total, home and 3 simple game modes.
    First off does anyone use scenes? I remember reading most coders dont like scenes because they tend to cause problems, is this still true, is it true for apps? Should I just keep all of my stuff on one time line?
    Next off I am having a strange issue when going from scene to scene. The first mode runs smooth but as I go through other game modes and eventually get back to the first one it starts slowing down and the more I move around the app the more the performance seems to suffer. It feels like there are events still triggering in the background and they keep stacking adding up and slowing down the process. I use WeakRefrences and remove all the events I am aware of but it still seems to be some issue.
    And here is one I cant even wrap my head around, in one mode you tap a button and it runs an addChild function I have a multi touch event listener assigned to it and if you just tap the button you can only get about 5 objects on the stage before slow down but if you put one finger on the stage but off the button and tap with the other finger you get crazy good performance closer to 15 objects before the app begins to bog down which would be fine in my case.
    Any thoughts would be helpful.
    BTW this is with Flash Pro 5.5 and air 2.7 on iPhone 4 with latest iOS, not the beta stuff, latest public release.

    Scenes work well, and are extremely useful if the project is largely animation, that is scene-like. I did an app that had about 6700 frames, and using scenes was a lot easier to manage than have a single scene that was that long.
    If you're just using scenes as a way to organize a few screen arrangements, then you may as well use one scene and a few frame labels, one for each screen layout. Doing it that way could easily let you share elements across several of the layouts. I work that way a lot.
    I think that with touch events you can set the frequency that you're looking at them. There are hundreds a second, and if you're trying to do something on every one of those, that could get demanding.
    The other slowdowns you mentioned probably would still happen if you had a single frame FLA. Look around for the usual solutions to that, such as freeing up bitmap memory where possible.

  • Is there a way to make multiple Scene Menus?

    I am using Premiere Elements 8.0 to make a DVD of different slideshows. I was wondering if there is a way to make multiple Scene Menus from a single Main DVD Menu. I want to be able to link to a second scenes menu not connected to the first one, almost like a Deleted Scenes or Special Features option on a DVD.
    Thanks for all the help!!

    Not directly in PrE. The Menu Sets are designed to automatically generate the necessary Scene Menus, based on the DVD Markers, and linked from the Main Menu.
    One can use an authoring program, like Sony's DVD Architect to do what you want. One would Export/Share the Timeline, and then Import that into DVD Architect.
    There are some tutorials, and also a link to Steve Grisetti's book on Sony DVD Architect on the Muvipix site.
    Hope that this helps, and good luck,
    Hunt

  • Sound in multiple scenes

    How do I get a single audio clip to play through multiple scenes in a flash project?

    Hi Marie,
    Using Actionscript would allow greater control as Ned suggests, but even otherwise you should be able to play and control your audio clip through multiple scenes.
    Can you please elaborate what exactly you wish to do and where are you getting stuck. In general, an audio with Sync property set as Event or Start plays across scenes as well.

  • Creating Chart Links Using Items and Labels.

    Hi Guys,
    I have created a chart with the following query:
    Series 1
    select null link, COUNTRY label, COUNT(UPGRADE_COMPLETED) "Upgrade Completed"
    from "IBHP_SCHEMA1"."APAC_IBHP_TRACKING"
    where REGION='ASEAN'
    AND UPGRADE_COMPLETED='Y'
    and account_classification <> 'Multiple Revenue'
    and account_classification <> 'Duplicate'
    and account_classification <> 'Partner'
    group by COUNTRY
    Series 2
    select null link, COUNTRY label, COUNT(UPGRADE_INPROCESS) "Upgrade In Process"
    from "IBHP_SCHEMA1"."APAC_IBHP_TRACKING" where REGION='ASEAN' AND UPGRADE_INPROCESS='Y'
    and account_classification <> 'Multiple Revenue'
    and account_classification <> 'Duplicate'
    and account_classification <> 'Partner'
    group by COUNTRY
    and two other series.
    Now when i click on teh values in chart, i want it to show in a report e.g. If total Upgrade complete for Philippines is 4. When i click the value of 4 it should show me 4 records for philippines.
    Help will be appreciated.

    Ok So here is the full detail:
    I have 1 bar chart with 4 series, codes are below. THis is one Page 4
    Series 1
    select null link, COUNTRY label, COUNT(UPGRADE_COMPLETED) "Upgrade Completed"
    from "IBHP_SCHEMA1"."APAC_IBHP_TRACKING"
    where REGION='ASEAN'
    AND UPGRADE_COMPLETED='Y'
    and account_classification <> 'Multiple Revenue'
    and account_classification <> 'Duplicate'
    and account_classification <> 'Partner'
    group by COUNTRY
    Series 2
    select null link, COUNTRY label, COUNT(UPGRADE_INPROCESS) "Upgrade In Process"
    from "IBHP_SCHEMA1"."APAC_IBHP_TRACKING" where REGION='ASEAN' AND UPGRADE_INPROCESS='Y'
    and account_classification <> 'Multiple Revenue'
    and account_classification <> 'Duplicate'
    and account_classification <> 'Partner'
    group by COUNTRY
    Series 3
    select null link, COUNTRY label, COUNT(UPGRADE_PLANNED_NYC) "Planned but not Committed"
    from "IBHP_SCHEMA1"."APAC_IBHP_TRACKING" where REGION='ASEAN' AND UPGRADE_PLANNED_NYC='Y'
    and account_classification <> 'Multiple Revenue'
    and account_classification <> 'Duplicate'
    and account_classification <> 'Partner'
    group by COUNTRY
    Series 4
    select null link, COUNTRY label, COUNT(UPGRADE_CANDIDATE_INYK) "Candidate Intention not Known"
    from "IBHP_SCHEMA1"."APAC_IBHP_TRACKING" where REGION='ASEAN' AND UPGRADE_CANDIDATE_INYK='Y'
    and account_classification <> 'Multiple Revenue'
    and account_classification <> 'Duplicate'
    and account_classification <> 'Partner'
    group by COUNTRY
    So the chart looks like a stacked bar chart, showing Each Series per 7 countries in the ASEAN region
    THEN- I have created another page where i have a report which is page 22
    The code for this report is:
    select     "APAC_IBHP_TRACKING"."COUNTRY" as "COUNTRY",
         "APAC_IBHP_TRACKING"."ACCOUNT_NAME" as "ACCOUNT_NAME",
         "APAC_IBHP_TRACKING"."REVENUE_BAND" as "REVENUE_BAND",
         "APAC_IBHP_TRACKING"."GCM_ACCOUNT_ID" as "GCM_ACCOUNT_ID",
         "APAC_IBHP_TRACKING"."REGION" as "REGION",
         "APAC_IBHP_TRACKING"."SALES_INDUSTRY" as "SALES_INDUSTRY",
         "APAC_IBHP_TRACKING"."NEW_IMPLEMENTATION" as "NEW_IMPLEMENTATION",
         "APAC_IBHP_TRACKING"."PRODUCT_VERSION1" as "PRODUCT_VERSION1",
         "APAC_IBHP_TRACKING"."PRODUCT_VERSION2" as "PRODUCT_VERSION2",
         "APAC_IBHP_TRACKING"."ACCOUNT_CLASSIFICATION" as "ACCOUNT_CLASSIFICATION",
         "APAC_IBHP_TRACKING"."UPGRADE_COMPLETED" as "UPGRADE_COMPLETED",
         "APAC_IBHP_TRACKING"."UPGRADE_INPROCESS" as "UPGRADE_INPROCESS",
         "APAC_IBHP_TRACKING"."GO_LIVE_DATE" as "GO_LIVE_DATE",
         "APAC_IBHP_TRACKING"."UPGRADE_PLANNED_NYC" as "UPGRADE_PLANNED_NYC",
         "APAC_IBHP_TRACKING"."UPGRADE_CANDIDATE_INYK" as "UPGRADE_CANDIDATE_INYK",
         "APAC_IBHP_TRACKING"."UPGRADE_TIMEFRAME" as "UPGRADE_TIMEFRAME",
         "APAC_IBHP_TRACKING"."NOTUPGRADING_OLDREALASE" as "NOTUPGRADING_OLDREALASE",
         "APAC_IBHP_TRACKING"."NOTUPGRADING_FUSION" as "NOTUPGRADING_FUSION",
         "APAC_IBHP_TRACKING"."NOTUPGRADING_MAYSWITCH" as "NOTUPGRADING_MAYSWITCH",
         "APAC_IBHP_TRACKING"."NOTUPGRADING_NODECISION" as "NOTUPGRADING_NODECISION",
         "APAC_IBHP_TRACKING"."NOTUPGRADE_NOTUSINGAPP" as "NOTUPGRADE_NOTUSINGAPP",
         "APAC_IBHP_TRACKING"."GLOBAL_CUSTOMER" as "GLOBAL_CUSTOMER",
         "APAC_IBHP_TRACKING"."COMMENTS" as "COMMENTS",
         "APAC_IBHP_TRACKING"."SALES_REP" as "SALES_REP",
         "APAC_IBHP_TRACKING"."CC_MANAGER" as "CC_MANAGER",
         "APAC_IBHP_TRACKING"."IMPLEMENTATION_PARTNER" as "IMPLEMENTATION_PARTNER",
         "APAC_IBHP_TRACKING"."OCS_CS_MANAGER" as "OCS_CS_MANAGER",
         "APAC_IBHP_TRACKING"."GCM_OPP_ID" as "GCM_OPP_ID",
         "APAC_IBHP_TRACKING"."REVENUE_APPS" as "REVENUE_APPS",
         "APAC_IBHP_TRACKING"."REVENUE_TECH" as "REVENUE_TECH",
         "APAC_IBHP_TRACKING"."REVENUE_SYS" as "REVENUE_SYS",
         "APAC_IBHP_TRACKING"."REVENUE_OFM" as "REVENUE_OFM",
         "APAC_IBHP_TRACKING"."REVENUE_OCS" as "REVENUE_OCS",
         "APAC_IBHP_TRACKING"."REVENUE_ACS" as "REVENUE_ACS",
         "APAC_IBHP_TRACKING"."TOTAL_REVENUE" as "TOTAL_REVENUE",
         "APAC_IBHP_TRACKING"."GCM_STATUS" as "GCM_STATUS",
         "APAC_IBHP_TRACKING"."CLOSE_DATE" as "CLOSE_DATE",
         "APAC_IBHP_TRACKING"."NEW_DEAL_ADDED" as "NEW_DEAL_ADDED",
         "APAC_IBHP_TRACKING"."REFERENCE_CUSTOMER" as "REFERENCE_CUSTOMER",
         "APAC_IBHP_TRACKING"."LOCAL_NAME" as "LOCAL_NAME"
    from     "APAC_IBHP_TRACKING" "APAC_IBHP_TRACKING"
    where "APAC_IBHP_TRACKING"."COUNTRY" = :P22_COUNTRY
    Within the same report i have created a Hidden page item information is below:
    Sourced Used- Always replacing any existing value in session state
    Source Type- Database Column
    Database Column Name- Country
    CHART SERIES AREA- So going back to page 4 and taking first series for example, i have the following action item:
    Action link- link to custom target
    Target- page in this application
    Page- 22
    Item 1- Country
    VALUE=#LABEL#

  • Multiple scene interface in javafx

    Hi,
    How can i achieve multi scene interface under single stage with common menu bar in javafx ?
    i.e,multiple scenes should change in single stage and Menu bar should be common for every scene.
    I am using javafx scene builder to build Gui’s.

    i believe the answer is that Adobe is following Windows Programming User Interface Guidelines, that Microsoft itself doesn't always follow.

  • How do we split our iCloud accounts but keep one iTunes account so we can share purchased content for our multiple iPhones and iPads?

    How do we split our iCloud accounts but keep one iTunes account so we can share purchased content for our multiple iPhones and iPads?

    You can migrate a copy of the data to a new account, then delete the other person's data from each account.  To do this, on the phone that will be changing accounts, if you have any photos in photo stream that you want to keep on the phone, save these to your camera roll by opening the photo stream album in the thumbnail view, tapping Edit, then tap all the photos you want to save, tap Share and tap Save to Camera Roll. If you have any synced notes that you want to keep on the phone, email these to yourself so you can create new notes in the new account.
    Once this is done, go to Settings>iCloud, scroll to the bottom and tap Delete Account.  (This will only delete the account from this phone, not from iCloud.  The phone that will be keeping the account will not be effected by this.)  When prompted about what to do with the iCloud data, be sure to select Keep On My iPhone.  Next, set up a new iCloud account using a different Apple ID (if you don't have one, tap Get a Free Apple ID at the bottom).  Then turn iCloud data syncing for contacts, etc. back to On, and when prompted about merging with iCloud, choose Merge.  This will upload the data to the new account.  You will create a new icloud email address with you turn Mail to On.
    Finally, to un-merge the data you will then have to go to icloud.com on your computer and sign into each iCloud account separately and manually delete the data you don't want (such as deleting your wife's data from your account, and vice versa).

  • My touch screen isn't working and stopped working after I went running with it. I have restarted it multiple times and restored it on my MacBook. It will still not let me slide it to even look at the phone. Please help ASAP.

    I took my iPhone running today and when I returned I was not able to slide it open or type in my pass code. All buttons are still responding. I have tried restarting it multiple times and even restored it, but the touch screen will not respond to anything. I also cleaned the screen off with a damp cloth. Please help! I WAS able to slide it open in the middle of restoring it but not able to click on any apps. Help! My life is on my iPhone and I am a nurse on call!

    Try restore as new using computer iTunes.

  • Can anyone advise how to close apps on iPad with new iOS? I have multiple open and cannot close them.

    Can anyone advise how to close apps with the new iOS?  I have multiple open and cannot close them

    Double-tap on the Home button. You will see a preview of the app above the actual icon. Slide the preview up to kill it.
    Please get the iPhone User Guide (For iOS 7 Software)Sep 19, 2013 - 23 MB.

  • Can I use one itunes account for multiple users and multiple devices

    Can I use one itunes account for multiple users and multiple devices?

    The iTunes EULA, as I understand it (I'm not an attorney )for Apps is basically that one person can use an App multiple devices, or multiple people can use an App one device..so one to many or many to one, but not many to many....

Maybe you are looking for

  • ABAP program developed in one system will it run in another system.

    Hi All,        I have a very important query. I know that SAP 4.7, BW 3.1 and SAP CRM 4.0 have same kenel release SAP Basis 620.(please correct me if I am wrong) If Kernel in these systems are same, will an ABAP program developed in one system (say S

  • [Solved/Broken DPM] Hang at boot when switching modes with radeon

    When I tried to boot into Arch about a week ago after cleaning some dust out of my case I was met with a nasty surprise, it wouldn't boot properly! Once my system got to the point where it would usually change resolutions (KMS kicks in) my displays (

  • Splitting text form file

    Hello, This is the problem, I have a text file with mobile messages, here's an example of these messages. 25 100 SEND 2228161 Hello Pete RECEIVE 2228161 Hello Chris, how are you? SEND 2227765 I hate text speak RECEIVE 2228876 wot u on bout SEND 22279

  • Recursive node mapping

    Hi everybody, i would like to ask if it is posiible to map context node with recursive node from controller to view. I try to do that by the recursive subnode is disabled. When that is not possible can that any one explain why? Regards Bogdan

  • Stand alone application with VISA

    Hello,  I build a stand alone installer application from my VI using LV 7.1 VI which contains some VISA serial communications with a standard RS232 port.  In build application wizard settings I checked the Serial Port Suport in Advanced settings in I