Passing TIME variable in ALLOCATION

I have the following allocation, and the variables for my DIM TIME are not working. Does anyone know how I would achieve this in NW version? I would like the script to take the TIME member selected at package run time and get the annual input member from the *SELECT to use in the WHAT for DIM TIME. The code validates fine, but the package fails and returns, "Unknown dimension name in keyword: "%TIME_SET:
Does anyone have any experience with something similar?
*SELECT(%INP%,[ANNUAL],TIME,[ID]=%TIME_SET%)
*RUNALLOCATION
*FACTOR = USING
*DIM ACCOUNTCC WHAT=ALLOC_PCT; WHERE=>>>;USING=BAS(SGA_SERV_EXP);
*DIM ENTITY WHAT=NO_ENTITY; WHERE=>>>;USING=BAS(TOTAL_ENTITIES);
*DIM BU WHAT=A_AM; WHERE=<<<;USING=NO_BU;
*DIM DATASRC WHAT=INPUT; WHERE=ALLOC;USING=R3;
*DIM TIME WHAT=%INP%;WHERE=>>>; USING=%TIME_SET%;
*DIM GEOGRAPHY WHAT=NO_LOCATION; WHERE=>>>; USING=BAS(GLOBAL_TOTAL);
*DIM FUNCTIONAL WHAT=NO_FUNCTION; WHERE=<<<; USING=BAS(TOTAL_FUNCTIONS);
*ENDALLOCATION
*COMMIT
I appreciate any and all feedback!
Regards,
karen

Hi,
Am not sure this can help you.
Please check whether SELECT is working fine in your system. Because it is not working in ours and we use XDIM_FILTER which does the same task as SELECT.
Regards,
G.Vijaya Kumar.

Similar Messages

  • URGENT: I want to pass a variable to a stored procedure at run time

    Post Author: aruplabs
    CA Forum: Data Connectivity and SQL
    I work for a health care provider and I have reports that pull PHI (Protected Health Information) about patients that needs to be logged according to federal HIPAA regulations. One of the pieces of information that needs to be logged is the username of the person who ran the report. Since these reports will be run from our Crystal Enterprise server I can get this from the CurrentCEUserName variable but I am looking for a way to pass this value to a stored procedure that will not only return the records for the report, but also log the disclosure in our PHI disclosure tracking table. I know you can pass a parameter to a stored procedure but I dont know how, or if it is even possible, to pass a run time variable. This is an urgent problem that I need to find a solution for. Any help would be appreciated.
    Thank you.

    Here it is. Right now, when i press te "Go" it runs for the specific time i've set and when its done the variable "Run" is set true. When i call this VI from another VI it waits for the loop to be finished before it will read the variable.
    Regards
    Viktor
    Attachments:
    Untitled 2.vi ‏26 KB

  • Passing Session variable of DATE data type to opaque view filter

    Hi Everyone,
    Can you guys please help me in passing session variable of DATE data type in RPD's physical layer 'opaque view' filter for Oracle database
    I tried following syntax, syntax wise I didn't got getting any error, but at the same time this opaque view is not fetching any records as well. my session variable is "END_DATE" and its value is 1998/12/31:00:00:00(as shown in RPD session windows, datatype is DATETIME)
    SELECT AMOUNT_SOLD, CHANNEL_ID, CUST_ID, PROD_ID, PROMO_ID, QUANTITY_SOLD, TIME_ID FROM SH.SALES
    WHERE TIME_ID =TO_DATE( 'VALUEOF(NQ_SESSION.END_DATE)','MM/DD/YYYY')
    SELECT AMOUNT_SOLD, CHANNEL_ID, CUST_ID, PROD_ID, PROMO_ID, QUANTITY_SOLD, TIME_ID FROM SH.SALES
    WHERE TIME_ID = TO_DATE( 'VALUEOF(NQ_SESSION."END_DATE")','MM/DD/YYYY')
    SELECT AMOUNT_SOLD, CHANNEL_ID, CUST_ID, PROD_ID, PROMO_ID, QUANTITY_SOLD, TIME_ID FROM SH.SALES
    WHERE TRUNC(TIME_ID) = TO_DATE( 'VALUEOF(NQ_SESSION."END_DATE")','MM/DD/YYYY')
    In past, I was able to pass a session variable into a opaque view filter using DATEOF function, but that was in DB2.
    I appreciate your time and help

    Finally, I got right format. here it is
    to_date(substr('valueof(NQ_SESSION.END_DATE)',1,10), 'yyyy-mm-dd')
    and here is the source from where I got this information
    Using OBIEE Session Variables in Select Tables in the Physical Layer

  • Passing a variable from one thread to another

    Hi. I'm trying to produce a chat program in Java but need to pass a variable between two threads. I have included a snipet of the code.
    import java.io.*;
    import java.net.*;
    class IndividualConnection extends Thread
         public Socket clientSocket;
         String userName = "";
         public IndividualConnection(Socket connectingSocket)
              clientSocket = connectingSocket;
    public login(String name)
    userName = name;
         public void messageUser(Socket socket, String msg)
              try
                   Socket newSocket = new Socket("192.168.0.162",5163);     
                   DataOutputStream outToServer = new DataOutputStream(socket.getOutputStream());
                   outToServer.writeBytes(msg + '\n');     
              catch(Exception e)
                   System.out.println("The connection with the client has been closed.");
                   this.stop();
    public void run()
         Socket global = clientSocket;
    // etc etc
    A number of threads are created based on code similar to the above. Each thread communicates to a different client on the chat program. However, I want to be able to send messages between the clients.
    Each thread has a method called messageUser(Socket socket, String msg). I should (hopefully) be able to send a message to anyone using the prog if I can access their socket. The problem is that the socket objects for each client is held in the clients own thread. I have tried writing some code to find the Socket object in another thread but to no success. The code I am trying is shown below.
         public Socket findContact(String name)
              ThreadGroup currentGroup = Thread.currentThread().getThreadGroup();
              int numThreads = currentGroup.activeCount();
              Thread[] listOfThreads = new Thread[numThreads];
              currentGroup.enumerate(listOfThreads);
              for (int i = 0; i < numThreads; i++)
                   String threadName = listOfThreads.getName();
                   if (threadName.compareTo(name) == 0)
                   //     Socket tempSocket = threadName[i].getClass().getField(clientSocket);
              return tempSocket;
    The line I have commented out does not work. Please could someone tell me how to carry out this task. I have spent many hours trying to solve this but am not able to. The chat server is nearly complete now. I just need to find a way of obtaining another threads socket.
    I hope the problem is comprehensible. I have found it difficult to explain clearly. Many thanks.

    Really simple, inelegant solution:
    class MyThread extends Thread {
    Socket socket;
    MyThread( Socket s ) { socket = s; }
    public Socket getSocket() { return socket; }
    }Better: create a master object that includes an array
    of sockets. Each time you create a Thread, update the
    master object's list of sockets with a reference to
    each Thread's socket. Under the current memory model, the socket field should be declared volatile. The proposed new memory model will guarantee that this will work if the socket field is declared final.
    Sylvia.

  • To capture the passed time in a TimedTrigger UI Element

    Hi, I want to capture the passed time in a TimedTrigger UI Element. I need to capture the passed time from init the application to the execution of an action of a button.
    ¿How can i do it?
    Regards.

    Marcel,
    You do not TimedTrigger for this at all.
    1. Create private variable startTime of type long in custom coding section of view controller (bottom of view controller source between //@begin other .. //@end):
    private long startTime;
    2. In wdDoInit of view controller assign current time:
    startTime = System.currentTimeMillis();
    3. In action handler you may get time passed as following:
    timePassed = System.currentTimeMillis() - startTime;
    The result is in milliseconds, to get seconds divide it by 1000.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • Please help!! Can I pass a variable between 2 swf's that are on different html pages?

    Hey,
    Does anyone know how to pass a variable (string) from one swf
    to another if there in separate html pages?
    I assume I’d have to send the variable from the first
    page and load it into the second but I don’t know what
    functions or code I should be using. Any suggestions would be a
    HUGE help.
    Thanks
    If it helps: I’m creating a log in and sign up sheet
    that can be accessed from several sites. I’d like to record
    which site the user has come from when they signup.
    Thanks

    if they are open at the same time (for the same user), you
    can use the localconnection class to communicate between the
    two.

  • Passing a variable into workflow

    I know u can pass variables from a form into a workflow using processInputs.....but let's say I have a update workflow and there's some attribute that has changed on the user that requires the update workflow to trigger the disable workflow.....let's say I use the disableUser workflow service does anyone know if it's possible for to pass a variable from the update workflow to the disable workflow??

    you do it the same way you would in any other workflow. but if. In fact, I THINK that you dont even need to pass it. The external workflow should be available to all internal workflows.
    otherwise define it in the disable and pass it in. We do this all the time. should work fine.
    Dana Reed
    AegisUSA
    Denver, Co
    773.412.3728

  • Passing Parameter/Variable into Dashboard URL

    Hi,
    Instead of having someone type in or search for a variable I was trying to determine a way to pass a variable directly into the URL
    I have tried:
    VARIABLE_SCREEN=X&BI_COMMAND_1-BI_COMMAND_TYPE=SET_VARIABLES_STATE&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE=VARIABLE_INPUT_STRING&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE_TYPE-VARIABLE_INPUT_STRING=XXXXXX&BI_COMMAND_1-VARIABLE_VALUES-VARIABLE_VALUE_1-VARIABLE=XXXXXXXXX
    added to the dashboard URL:
    pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?TEMPLATE=DASHBOARD
    But any time I try this method it just refreshes the variable screen...
    Am I missing something? Maybe I think its easier then it really is.
    Thanks,

    Mike,
    Variable_screen=x will always force the variable screen to display.
    Try just variable_Screen=&BI_command etc etc

  • How to pass a variable more than one values?

    How to pass a variable more than one values?

    You can't.
    During 1 session, 1 ODI variable can have only 1 value at a time.
    If you need more than 1 value, you will have to do somethink like a loop inside your package, and refresh the variable value each time.

  • CPM- Run Time variable

    Hi SEM Gurus,
    In CPM -BSC, there are two types of CPM variables, one is Design CPM variable which is used to define the char value at the time of designing the BSC and other is runtime (Presentation)CPM variable which can be used to pass the value of char at the runtime or executing the BSC. The problem is that The second variable ( Run time ) is not working i.e. in value field of measure designing we have to assign this created runtime cpm variable to char but we cant see this cpm variable while assigning this to char.
    Please help me to solve this problem.
    Could anybody will confirm that this is possible in BSC? basically this is possible in management cockpit and it must work in BSC but unfortunatly it is creating a problem for us.
    Thanks/ hari

    Hi Hari,
    I'm now starting a BSC implementation and I'm facing the same issue. I created a CPM run time variable and I can't assign it in the BSC.
    Did you find a way to do this?
    Thanks in advance.
    Best Regards,
    Sofia Silva

  • Upload Component, Pass extra Variable

    Hello all.
    I have been trying to get an upload component to work for some time now, but have been having a few troubles getting one to do what i need.  Recently i found a component that does pretty much everything i want bar one thing, pass an extra variable to the PHP script so i can name the files something unique.
    My Flex code is -
    <?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"
                   creationComplete="init()" width="600" height="300">
        <fx:Script>
            <![CDATA[
                private var urlRequest:URLRequest;
                private var fileReferenceList:FileReferenceList;
                private var serverSideScript:String = "http://www.davidtest.webcastglobal.com/upload/upload.php";
                [Bindable] public var ID:String;
                private function init():void {
                    urlRequest = new URLRequest(serverSideScript);
                    fileReferenceList = new FileReferenceList();
                    fileReferenceList.addEventListener(Event.SELECT, fileSelectedHandler);
                private function uploadFile():void {
                    fileReferenceList.browse();
                private function fileSelectedHandler(event:Event):void {
                    var fileReference:FileReference;
                    var fileReferenceList:FileReferenceList = FileReferenceList(event.target);
                    var fileList:Array = fileReferenceList.fileList;
                    // get the first file that the user chose
                    fileReference = FileReference(fileList[0]);
                    // upload the file to the server side script
                    fileReference.addEventListener(Event.COMPLETE, uploadCompleteHandler);
                    fileReference.upload(urlRequest);
                    // update the status text
                    statusText.text = "Uploading...";
                private function uploadCompleteHandler(event:Event):void {
                    statusText.text = "File Uploaded: " + event.target.name;
            ]]>
        </fx:Script>
        <s:BorderContainer width="300" height="96" horizontalCenter="0" verticalCenter="0">
            <mx:Label text="Upload Your CV" fontWeight="bold" horizontalCenter="0" top="10"/>
            <mx:Label text="Choose a file..." id="statusText" horizontalCenter="0" top="35"/>
            <mx:Button click="uploadFile();" label="Upload File" horizontalCenter="0" bottom="10"/>
        </s:BorderContainer>
    </s:Application>
    While my PHP code it
    <?php
    $tempFile = $_FILES['Filedata']['tmp_name'];
    $fileName = $_FILES['Filedata']['name'];
    $fileSize = $_FILES['Filedata']['size'];
    $id = $_POST["id"]
    $newName = '$id'.'.doc';
    move_uploaded_file($tempFile, "./" . $newName);
    ?>
    What i am trying to do is, when the user clicks the "Upload File" button on the flex app, after they pick a file, it currently uploads that file using the name of the given file.  But what i want to do, is to pass the variable "ID" to the PHP and use that as the file name instead.
    Im a little bit stumped as to how to do this ?  I dont know where to include the code to pass "ID",  normally i deal with HTTPSservice's where you declare such things in the function.
    Any help would be great.!

    You should be able to add a parameter using URLVariables, so change your init function to something like:
                private function init():void {
                    urlRequest = new URLRequest(serverSideScript);
                    var variables:URLVariables = new URLVariables();
                    variables.myFileName = "flexponential";
                    urlRequest.data = variables;
                    fileReferenceList = new FileReferenceList();
                    fileReferenceList.addEventListener(Event.SELECT, fileSelectedHandler);
    And then in your PHP file you should be able to access that data via the post variable.
    $myFileName = $_POST["myFileName"];

  • Is there someway to pass a variable to Event.SOUND_COMPLETE?

    Hello,
    How do I play a chain of events, sounds at the end of sounds?
    Is there someway to pass a variable to  Event.SOUND_COMPLETE?
    If I could pass an int along side it, I could know which sound to play next afterwards?
    I'm working on a nice game about to be published.  We have voice after voice playing, but I haven't found a way to do it properly so you can do two different sounds with events at the end of each of them.  I can only do one sound with an event at the end of it.  If I try another at the same time, unexpected things happen.
    The following code simply plays a sound, then calls clearpingmainapplication
    var sc:SoundChannel = Sound(sounds[soundName]).play();
    sc.soundTransform = soundTransform;
    sc.addEventListener(Event.SOUND_COMPLETE, clearpingmainapplication);
    Then this sends an event to the main application to know to do the next thing after the sound has played.
            private function clearpingmainapplication(e:Event):void
            SoundChannel(e.target).removeEventListener(Event.SOUND_COMPLETE, clearpingmainapplication);
            trace("soundmanager: call main stage");
            superstage.dispatchEvent(new InGameEvent(InGameEvent.SOUND_EVENT_FINISHED,new Point(1,1)));
    My code works, but you can only have one sound with event afterwards at a time.  If you try to send two different actors speaking at the same time, I only get one generic event with no data to signifiy the end, so theres no way to know which one to advance.  For this complicated sounds playing after sounds to work, or events happening after sounds, I need to be able to pass a variable along with Event.SOUND_COMPLETE

    I found the solution, but it is ugly.
    if(eventnum==1)
    sc.addEventListener(Event.SOUND_COMPLETE, clearpingmainapplication1);
    if(eventnum==2)
    sc.addEventListener(Event.SOUND_COMPLETE, clearpingmainapplication2);
    if(eventnum==3)
    sc.addEventListener(Event.SOUND_COMPLETE, clearpingmainapplication3);
    etc
            private function clearpingmainapplication1(e:Event):void
            SoundChannel(e.target).removeEventListener(Event.SOUND_COMPLETE, clearpingmainapplication1);
            superstage.dispatchEvent(new InGameEvent(InGameEvent.SOUND_EVENT_FINISHED,new int(1)));//this code may be wrong
            private function clearpingmainapplication2(e:Event):void
            SoundChannel(e.target).removeEventListener(Event.SOUND_COMPLETE, clearpingmainapplication2);
            superstage.dispatchEvent(new InGameEvent(InGameEvent.SOUND_EVENT_FINISHED,new int(2)));//this code may be wrong
            private function clearpingmainapplication3(e:Event):void
            SoundChannel(e.target).removeEventListener(Event.SOUND_COMPLETE, clearpingmainapplication3);
            superstage.dispatchEvent(new InGameEvent(InGameEvent.SOUND_EVENT_FINISHED,new int(3)));//this code may be wrong
    For every unique event I want to play after a sound, I need to make a new function.  It is ugly, but at least it works.  This whole ordeal could be fixed if the datatype SoundChannel had an unused integer, or if it wasn't cast as final so I could add an integer to it.
    I doubt anyone else is doing simultaneous sounds chaining with other sounds, or other people would be having this problem too.

  • Passing Presentation Variables to Guided Navigation

    I'm having trouble passing Presentation Variables (and Session Variables) to analyses called via a Guided Navigation link in 11.1.1.5.
    1. Created a dashboard prompt to select from a list of months. The prompt populates a Presentation Variable called pMo.
    2. Created an analysis that displays two columns: Month and '{pMo}'
    3. That analysis has this filter: Month is equal to / is in {pMo}
    4. Put the dashboard prompt and the analysis onto a dashboard page.
    5. Put an Action Link onto the dashboard page, calling that same analysis in a new window.
    6. View the dashboard page
    7. Initial analysis displays an error, which is expected since pMo has no value.
    8. Select a month, which populates pMo. Analysis displays properly. Month and pMo both show correctly.
    9. Click the Action Link.
    10. The new window shows the correct value of Month, but NOTHING in the pMo column.
    This is not logical. If the correct value of Month is shown in the new window, that means that Month MUST have been filtered using pMo. But the pMo column shows blank.
    I see the exact same behavior with Session Variables. The value of the variable is correctly used to filter the analysis, but that variable's value doesn't show up in the analysis column.
    In fact, if I assign a default value for the variable, the Month column shows the "correct" (i.e. selected) value, but the column containing the formula for the variable shows the variable's default value, not the value that was obviously used by the filter.
    The problem only occurs in the new window that appears with the Guided Navigation link. The original dashbord page shows correctly.
    Here's the error when using a Session variable. Similar error when using Presentation variable.
    Error getting drill information: SELECT "Channels"."Total Channel" saw_0, "Times"."Month" saw_1, VALUEOF(NQ_SESSION.Mo) saw_2 FROM "Retrospectives" WHERE "Times"."Month" = 'Mar-2005'
    Error Details
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Location: saw.views.evc.activate, saw.subsystem.portal, saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool, saw.threadpool, saw.threads
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. *[nQSError: 23006] The session variable, NQ_SESSION.Mo, has no value definition. (HY000)*
    So, if NQ_SESSION.Mo has no value, how did the Filter know that Mar-2005 should be used? NQ_SESSION.Mo DOES have a value. Why won't the column display it?
    By the way, in case you're wondering 'what's the big deal', it's this: I want to be able to type a Commission Percent into a text box, store it in a variable, and then use that variable in a calculation within a Guided Nav link. That's what I was originally testing. The description above is what I finally figured out is happening. The variable has a value that can be used as a filter condition, but that value is ignored when used in the columns of that filtered analysis.
    Edited by: Mark T. on Jan 7, 2012 7:15 AM

    Mark T. wrote:
    I'm having trouble passing Presentation Variables (and Session Variables) to analyses called via a Guided Navigation link in 11.1.1.5.
    1. Created a dashboard prompt to select from a list of months. The prompt populates a Presentation Variable called pMo.
    2. Created an analysis that displays two columns: Month and '{pMo}'
    3. That analysis has this filter: Month is equal to / is in {pMo}
    4. Put the dashboard prompt and the analysis onto a dashboard page.
    5. Put an Action Link onto the dashboard page, calling that same analysis in a new window.
    6. View the dashboard page
    7. Initial analysis displays an error, which is expected since pMo has no value.
    8. Select a month, which populates pMo. Analysis displays properly. Month and pMo both show correctly.
    9. Click the Action Link.
    10. The new window shows the correct value of Month, but NOTHING in the pMo column.
    This is not logical. If the correct value of Month is shown in the new window, that means that Month MUST have been filtered using pMo. But the pMo column shows blank.
    I see the exact same behavior with Session Variables. The value of the variable is correctly used to filter the analysis, but that variable's value doesn't show up in the analysis column.
    In fact, if I assign a default value for the variable, the Month column shows the "correct" (i.e. selected) value, but the column containing the formula for the variable shows the variable's default value, not the value that was obviously used by the filter.
    The problem only occurs in the new window that appears with the Guided Navigation link. The original dashbord page shows correctly.
    Here's the error when using a Session variable. Similar error when using Presentation variable.
    Error getting drill information: SELECT "Channels"."Total Channel" saw_0, "Times"."Month" saw_1, VALUEOF(NQ_SESSION.Mo) saw_2 FROM "Retrospectives" WHERE "Times"."Month" = 'Mar-2005'
    Error Details
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Location: saw.views.evc.activate, saw.subsystem.portal, saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool, saw.threadpool, saw.threads
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. *[nQSError: 23006] The session variable, NQ_SESSION.Mo, has no value definition. (HY000)*
    So, if NQ_SESSION.Mo has no value, how did the Filter know that Mar-2005 should be used? NQ_SESSION.Mo DOES have a value. Why won't the column display it?
    By the way, in case you're wondering 'what's the big deal', it's this: I want to be able to type a Commission Percent into a text box, store it in a variable, and then use that variable in a calculation within a Guided Nav link. That's what I was originally testing. The description above is what I finally figured out is happening. The variable has a value that can be used as a filter condition, but that value is ignored when used in the columns of that filtered analysis.
    Edited by: Mark T. on Jan 7, 2012 7:15 AMI don't have 11g so what I say may not apply to you at all. That being said, it appears that what you are describing is similar to how the Link or Image and Guided Nav. objects work in 10g. Bear with me for a sescond while I explain. In the Link or Image object, you can open a destination report in a new window, but PVs don't pass through. In the Guid. Nav. object, PVs pass through to the destination, but you don't have the option to open the report in a new window. The filtering works, which is why your destination report is properly filtered; it's just that the PV is not passed and therefor the pMo column is blank.
    Since you said your destination report opens in a new window, it is acting like the Link or Image object in 10g. So try doing this:
    1) Ensure that your dashboard prompt is set to "dashboard" scope. This being that the PVs with the same name will be set for all dashboard pages, once set in the parent page.
    2) Create a new dashboard page and include the same prompt as in the parent page, and your destination report. Hide the prompt on this page.
    3) Now in your Action Link of the parent report, instead of pointing to the report itself, point it to the dashboard page created in step 2).
    My theory is this: With the dashboard prompt set to dashboard scope, the PV of the prompt in the destination page will be set as soon as you hit the "Go" button. This will allow the report in the destination page to be set by the same variable, even though the value is not passed on directly through the Action Link.

  • Resetting movieclip between levels and passing required variables

    Hi there,
    I'm currently working on my first flash game and have managed to near enough get everything working...
    I can play each level individually by manually changing the variable 'level =' (to whichever level I want to play) in the actionscript..
    Now i need to find out the correct way to reset the movie after each level but still pass the 'currentTime' Timer variable and the 'level' variable over...
    Is there any usual practice way of doing this ??
    Would I use variables I have saved in the init() function...
    I really hope someone can help I'm so close to being finished..

    OK this is what I have done.. all the eventListeners from my function Main() copied into the levelEnd() function... is this reammy good practise ?? Is there not a way I can just call Main() again :-
    function levelEnd(event:Event):void {
                gamePage = new GamePage;
                removeChildAt(0);
                addChildAt(gamePage, 0);
                mainTimer.start();
                //Is this in between really good practice ??
                gamePage.helpIcons.visible = false;
                gamePage.help_txt.text = "Passez la souris sur les indices à droite pour connaître leur signification.";
                var persoArray:Array = [gamePage.a1, gamePage.a2, gamePage.a3, gamePage.a4, gamePage.a5];
                var animalArray:Array = [gamePage.b1, gamePage.b2, gamePage.b3, gamePage.b4, gamePage.b5];
                var persoHitArray:Array = [gamePage.h1, gamePage.h2, gamePage.h3, gamePage.h4, gamePage.h5];
                var animalHitArray:Array = [gamePage.h6, gamePage.h7, gamePage.h8, gamePage.h9, gamePage.h10];
                function addPersoListeners():void {
                    for(var i:uint = 0; i < persoArray.length; i++) {
                        (persoArray[i]).addEventListener(MouseEvent.MOUSE_DOWN,persoMouseDown);
                        (persoArray[i]).addEventListener(MouseEvent.MOUSE_UP,persoMouseUp);
                        (persoArray[i]).buttonMode = true;
                function addAnimalListeners():void {
                    for(var i:uint = 0; i < persoArray.length; i++) {
                        (animalArray[i]).addEventListener(MouseEvent.MOUSE_DOWN,animalMouseDown);
                        (animalArray[i]).addEventListener(MouseEvent.MOUSE_UP,animalMouseUp);
                        (animalArray[i]).buttonMode = true;
                function persoHitAreaListeners():void {
                    for(var i:uint = 0; i < persoHitArray.length; i++) {
                        (persoHitArray[i]).visible = false;
                function animalHitAreaListeners():void {
                    for(var i:uint = 0; i < animalHitArray.length; i++) {
                        (animalHitArray[i]).visible = false;
                addPersoListeners();
                addAnimalListeners();
                persoHitAreaListeners();
                animalHitAreaListeners();
                //Add event listeners
                buttons.rulesButton.addEventListener(MouseEvent.CLICK,onRulesButtonClick);
                buttons.startGameButton.addEventListener(MouseEvent.CLICK,onStartGameButtonClick);
                buttons.highScoresButton.addEventListener(MouseEvent.CLICK,onHighScoresButtonClick);
                buttons.infoButton.addEventListener(MouseEvent.CLICK,onInfoButtonClick);
                mainTimer.addEventListener(TimerEvent.TIMER, incrementCounter);
                countdownTimer.addEventListener(TimerEvent.TIMER_COMPLETE, levelEnd);
                gamePage.validerButton.addEventListener(MouseEvent.CLICK,onValiderButtonClick);
                gamePage.recommencerButton.addEventListener(MouseEvent.CLICK,onRecommencerButtonClick);
                gamePage.infoBox.l1i1.addEventListener(MouseEvent.MOUSE_OVER,l1i1MouseOver);
                gamePage.infoBox.l1i1.addEventListener(MouseEvent.MOUSE_OUT,l1i1MouseOut);
                gamePage.infoBox.l1i2.addEventListener(MouseEvent.MOUSE_OVER,l1i2MouseOver);
                gamePage.infoBox.l1i2.addEventListener(MouseEvent.MOUSE_OUT,l1i2MouseOut);
                if(level == 1) {
                    gamePage.difficulty.difficultyIndicator.scaleY = .01;
                    gamePage.house1.visible = false;
                    gamePage.house5.visible = false;
                    gamePage.a4.visible = false;
                    gamePage.a5.visible = false;
                    gamePage.b1.visible = false;
                    gamePage.b2.visible = false;
                    gamePage.b3.visible = false;
                    gamePage.b4.visible = false;
                    gamePage.b5.visible = false;
                    mainTimer.start();
                } else if(level == 11) {
                    gamePage.difficulty.difficultyIndicator.scaleY = .11;
                    gamePage.house1.visible = false;
                    gamePage.house5.visible = false;
                    gamePage.a4.visible = false;
                    gamePage.a5.visible = false;
                    gamePage.b1.visible = false;
                    gamePage.b2.visible = false;
                    gamePage.b3.visible = false;
                    gamePage.b4.visible = false;
                    gamePage.b5.visible = false;
                } else if(level == 21) {
                    gamePage.difficulty.difficultyIndicator.scaleY = .21;
                    gamePage.house1.visible = false;
                    gamePage.house5.visible = false;
                    gamePage.a4.visible = false;
                    gamePage.a5.visible = false;
                    gamePage.b4.visible = false;
                    gamePage.b5.visible = false;
                } else if(level ==31) {
                    gamePage.difficulty.difficultyIndicator.scaleY = .31;
                    gamePage.house1.visible = false;
                    gamePage.house5.visible = false;
                    gamePage.a4.visible = false;
                    gamePage.a5.visible = false;
                    gamePage.b4.visible = false;
                    gamePage.b5.visible = false;
                } else if(level == 41) {
                    gamePage.difficulty.difficultyIndicator.scaleY = .41;
                    gamePage.house1.visible = false;
                    gamePage.house5.visible = true;
                    gamePage.a5.visible = false;
                    gamePage.b1.visible = false;
                    gamePage.b2.visible = false;
                    gamePage.b3.visible = false;
                    gamePage.b4.visible = false;
                    gamePage.b5.visible = false;
                } else if(level == 51) {
                    gamePage.difficulty.difficultyIndicator.scaleY = .51;
                    gamePage.house1.visible = true;
                    gamePage.house5.visible = true;
                } else if(level == 61) {
                    gamePage.difficulty.difficultyIndicator.scaleY = .61;
                    gamePage.house1.visible = true;
                    gamePage.house5.visible = true;
                } else if(level == 71) {
                    gamePage.difficulty.difficultyIndicator.scaleY = .71;
                    gamePage.house1.visible = true;
                    gamePage.house5.visible = true;

  • How do I pass a variable from edge animate to an external JS?

    I need to pass a variable value from Edge Animate to an external JS file. How can I do it?

    Not sure if this is the best way ,but works
    Set the variable as a property of a global variable
    Like
    SET
    window.myVar = 'your value';
    AdobeEdge.myVar = 'your value';
    Read
    window.myVar
    AdobeEdge.myVar

Maybe you are looking for