How to modify the code to use the image on stage instead of in library?

Hi, The following code I found on website is for working with the image which is in library. But how to modify it to work with the image on stage. Because I don't want to use it from the library. The second question ------ Is it the AS2 code or AS3. If it is AS2 code then please let me know how to modify it to work with AS3. animator = CreateEmptyMovieClip('animator',1);
bg_1 = animator.attachMovie('bg_mc','bg_1',1);
bg_2 = animator.attachMovie('bg_mc','bg_2',2);
bg_1._x = bg_1._width/2:
bg_2._x = bg_2._width/2:
speed = 1;
cloudWidth = 380;
animator.onEnterFrame = function(){
bg_1._x -= speed:
bg_2._x -= speed:
if(bg_1._x <= -bg_1._width) bg_1._x = cloudWidth;
if(bg_2._x <= -bg_2._width) bg_2._x = cloudWidth;
} Thanks.

There is no need for attach the clip if it is not in the library and it is the AS2 code below is the relevant code in AS3 when it is in stage:
i) Convert your first image into a movieclip with the instance name "bg_1"
ii) Convert your second image into a movieclip with the instance name "bg_2"
iii) Actions:
    var speed:Number = 1;
    var cloudWidth:Number = 380;
    bg_1.x = bg_1.width/2:
    bg_2.x = bg_2.width/2:
    this.addEventListener(Event.ENTER_FRAME,fn);
    function fn(e:Event):void{
        bg_1.x -= speed:
        bg_2.x -= speed:
        if(bg_1.x <= -bg_1.width) bg_1.x = cloudWidth;
        if(bg_2.x <= -bg_2.width) bg_2.x = cloudWidth;

Similar Messages

  • Does anyone have the code to use an image button as the reset button?

    Does anyone have the code to use an image button as the reset button? I'm finally at the end of the form and got the submit button to work as an image button, but cannot do the same with the reset button.  Any help is greatly appreciated!

    I agree. 
    http://www.456bereastreet.com/archive/200909/almost_never_add_a_reset_button_to_a_form/
    Nancy O.

  • Can someone please tell me on how to modify this code so that I dont have to enter the file name at all?

    Hello
    can someone please tell me how to modify this code so that I dont have to enter the file path at all? When i give the same file path constants to both the read and write VIs I'm getting an error message.
    Attachments:
    read and write.vi ‏11 KB

    Yup use the low level File I/O opening the reference once, and closing it once.  
    As for the path selection you have an unwired input which is the path to use.  Programatically set that and you won't be prompted to select a path.  Usually this is done with a path constant to a folder, then using the Build Path, to set the file name in that folder.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • If i lock my Mac using iCloud "Find My.." with a code, but now i have forgotten the code i used but have my Mac bac.  How can i Unlock it????

    If i lock my Mac using iCloud "Find My.." with a code, but now i have forgotten the code i used but have my Mac bac.  How can i Unlock it????

    If you cannot remember the passcode, you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and resync the data from the device (or restore from a backup).
    If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present.
    You may have to force iPad into Recovery Mode
    http://support.apple.com/kb/ht1808

  • How to use the code posted in the thread

    Quick question. How do i use the code posted in the threads, because when I copy and past in the program it is not formatted well.
    Per example : In the below link there is some code which i want to use, but when i copy and paste in the ABAP editor i get lot of syntax errors.
    Re: BDC
    Thanks.

    Shiva,
    I dont think you can do much about this because the code which you mentioned in that thread should have been kept using markup 
    Thanks
    Bala Duvvuri
    Edited by: Bala Duvvuri on Jul 15, 2010 7:29 PM

  • How to login the Ebusiness suit use the code

    Hello,every one.I wanna login into the Ebusiness suit use the java code .
    <%@ page contentType="text/html;charset=GB18030"%>
    <%@ page import=" oracle.apps.fnd.common.*" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=GB18030">
    <title>
    Hello World
    </title>
    </head>
    <body>
    <%
    WebAppsContext wac = new WebAppsContext("xxxx.xxx.com","8000","/oraprodsys/prod/prodappl/fnd/11.5.0/secure/bxerp4_prod.dbc");
    boolean return_value=wac.createSession(5013);
    response.sendRedirect("http://xxx.xxx.com:8000/OA_HTML/OA.jsp?OAFunc=OAHOMEPAGE");
    %>
    <%=return_value%>
    <%=wac.getSessionCookieName()%>
    </body>
    </html>
    I found the return_value is true and the CookieName is not null.
    But the login page still appear. please help me thank you

    For example, in 10G, when you double click on an Actor, you get a really useful set of fields to fill in. In 11G, you get xml boilerplate that I don't know how to use, and has none of the fields on the 10G properties panel.
    Why did this change?

  • I don't have the option for using the design view or the code view? How do I open this view?

    When I open the Flash Builder I am not able to toggle to the different views. I am only able to see the code version of the mobile app I am building. How do I turn this feature on?

    Javascript?
    There is no design view, so you have to run your program to see what will happen. You only have the code editor.

  • Urgent:How to modify a script without changing the print programme

    Hi all,
    Can any body pls tell me <b>How to modify a script without changing the print programme</b>
    Give m esome real time examples.
    Good points willbe rewarded
    Thanks

    Hi
    You can write a external Subroutine to fetch the extra data into the script program
    see the following sample code
    How to call a subroutine form SAPscripts
    The Form :
    /:PERFORM CDE_CENT IN PROGRAM ZKRPMM_PERFORM_Z1MEDRUCK
    /:USING &EKKO-EBELN&
    /:CHANGING &CDECENT&
    /:ENDPERFORM
    The report :
    REPORT zkrpmm_perform_z1medruck .
    DATA : BEGIN OF it_input_table OCCURS 10.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_input_table.
    déclaration de la table output_table contenant les
    variables exportées
    DATA : BEGIN OF it_output_table OCCURS 0.
    INCLUDE STRUCTURE itcsy.
    DATA : END OF it_output_table.
    DATA : w_ebeln LIKE ekko-ebeln,
    w_vbeln LIKE vbak-vbeln,
    w_zcdffa LIKE vbak-zcdffa.
    FORM CDE_CENT
    FORM cde_cent TABLES input output.
    it_input_table[] = input[].
    it_output_table[] = output[].
    READ TABLE it_input_table INDEX 1.
    MOVE it_input_table-value TO w_ebeln.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = w_ebeln
    IMPORTING
    output = w_ebeln.
    SELECT SINGLE zcdffa FROM ekko
    INTO w_zcdffa
    WHERE ebeln = w_ebeln.
    it_output_table-name = 'CDECENT'.
    MOVE w_zcdffa TO it_output_table-value.
    MODIFY it_output_table INDEX 1.
    output[] = it_output_table[].
    ENDFORM.
    COPING SCRIPT
    There are some Standard Sap Scripts in SAP. We cant directly execute them in scripts we have to use some T-codes and by giving some input to the required fields we can see the output printform.
    I will show one example. There are some Standard Sap Scripts such as MEDRUCK which is a standard Sap Script for Purchase Order and RVINVOICE01 for billing and so on...
    To see oupt of MEDRUCK go to T-code ME9F give purchase order number and execute select one number and click on dislplay messages button on application tool bar you can find the print form of MEDRUCK.
    You cannot change the Standard Sap Scripts but you can use Standard Sap Scripts and Copy them to userdefined Script and can make changes to them and replace standard Sap Script with usedefind script.
    Ex: Go to SE71,
    on menu bar u find Utilities->copy from Client. click on it u ll find new screen showing
    Form name:
    Source Clinet:
    Target Form:
    give Form name as usedefined form name EX: ZFORM1
    Source client as 000 and
    Target form as MEDRUCK.
    execute.
    Now, the standard from MEDRUCK is copyied to your form ZFORM1.
    NOW, go to SE71 and give form name as ZFORM1 and do some changes to the form such as adding logo any thing. save and Activate.
    Now, you have done changes to the Form ZFORM1 and u have to replace your form with standard SAP Script.
    Go to NACE Transaction.
    on Applications select EF for purchase order and click Output types button on application tool bar.
    now select NEU as output types dobule click on Processing Routines.
    now click on Change option on application tool bar and on right side u find MEDRUCK in form place replace MEDRUCK with ZFORM1 and SAVE.
    go back twice and now go to T-code ME9F give the purchase order number and execute and select one option and click on display messges button .
    you will find the changes that you have done in ZFORM1. so we cant chage the standard Sap Scripts by copying the Standard Sap Scripts we can chage and replace with our forms
    Refer
    https://forums.sdn.sap.com/click.jspa?searchID=4089895&messageID=3239299
    Regards
    Message was edited by:
            Kiran Sure(skk)

  • How to get default values while using the transaction "BP"

    Hi Group,
    I have a query on how to get default values while using the transaction <b>BP</b>?
    The thing is:
    when I enter into the transaction "BP", I need to see some default values to some of the input fields in the screen.
    how can I achieve this?
    So please kindly let me know the procedure to achieve this.
    Thanks & Regards,
    Vishnu.

    Hi,
    The events of BDT can be used to default some fields on creating a partner.
    For this create a function module for ISDAT. attach that event in BUS7.
    In the ISDAT funtion modulethe following code should be used.
    For example to set the nationality:
    I_BUSDEFAULT-NATIO = 'DE.
    CALL FUNCTION 'BUP_BUPA_FIELDVALUES_SET'
    EXPORTING
    i_busdefault = I_BUSDEFAULT
    Regards, Smita.

  • How to rename a XML file using the file/FTP adapter

    Dear All,
    I am trying to rename a file using VARIABLE NAME SUBSTITUTION.
    My structure:
    <ns1:MSg xmlns:ns1="http://www.mycomp.inf.br/msr">
      <ns1:MSgVal type="A" Id="188549">
        <ns1:cab>
          <ns1:PO>4500000000</ns1:cPO>
          <ns1:BI>90000000011</ns1:cBI>
        </ns1:cab>
      </ns1:MSgVal>
    </ns1:MSg>
    How do I do to get the value 188549 from the field Id that is into the tag MSgVal?
    I created a variable var1 and my reference is:
    var1 --> payload:ns1:MSg,1,ns1:MSgVal,1,Id@,1
    I am getting the error:
    Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var1
    Regards,
    Fernando

    Hi,
    Like pinted by Michal, use Adapter Specific Identifers.
    In your mapping set the file name using the code in this link and then in your Receivr File Adapter select the Adapter Specific Identifiers --> FileName .
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
    Regards
    Bhavesh

  • How to move the code and deploy the code from Dev environment to SIT.

    Hi,
    I have a requirement.
    I want to move the components and deploy the code from dev Environment to SIT environment using Ant Script for AIA.
    Before doing this is any pre-requisites required?
    Can you please help on this,how to do?
    Thanks in advance.

    Further to add to Anish Statement follow the steps to easily migrate the code to different environment.
    Steps:
    First log on to the EM Console and export the Composite Flow as a SAR file to a location.
    In Jdeveloper create a project using the same name of a SAR file like - ProcessSalesorderFlow
    import the project using the option import the composite using a SAR File.
    After import , then click on the composite and then generate the config plan.
    In config plan add all the url changes using the search and replace Tags.
    And in case if you have a JCA Adapters the same has to be taken care in SIT environment why because during deployment a lookup happens and deployment fails if it dont find the JNDI Name.
    Take the SAR file adn config plan seperately from JDeveloper.
    Now open em console again and then deploy it using the config file and SAR file.
    Thanks,
    Venugopal SSS RAJA

  • I started to learn HTML, and I'm using text edit and everything is going fine, when I save the file with a .html extension and open it with safari I only view the code and not the webpage that was supposed to be created.

    I started to learn HTML, and I'm using text edit and everything is going fine, when I save the file with a .html extension and open it with safari I only view the code and not the webpage that was supposed to be created.

    That is because you don't have a web server configured and running to serve the html page. In order to see the page in a browser you need to access it using a url similar to http://localhost/~yourUserName if you are serving the page from your user account.
    Prior to Mountain Lion you could go into web sharing and turn on the web server. With Mountain Lion there is no option, other than using terminal, to turn on the web server. The web sharing menu item has been removed in Mountain Lion. Apache is still on your computer but it will take a little searching these forums or the Internet to find how to turn it on.
    If you want a graphic user interface to turn on/off the Apache server you could download and install a server application like xampp, http://www.apachefriends.org/en/xampp.html. I use this and it works well.

  • How to apply  special right  to the PDF  file using the LiveCycle Rights Management Server.?

    How to apply special right to the PDF  file using the LiveCycle Rights Management Server.?
    I want  to edit bar code field data using Adobe Reader. Bar Code field was designed and data was changing using Acrobat X1 Professional (Trial Version). But can't do so in adobe reader.

    I think that product has nothing to do with it. You would use LiveCycle Reader Extensions.

  • If the production database i down, how to switch to standby database using the replication environment in ASsE

    This question is in Business Continuity Plan (BCP)
    if the production database is down, how to switch to standby database using the replication environment in ASE

    Assuming you're referring to Sybase's Replication Server (repserver) product ...
    Repserver moves data changes from one database to another.
    Repserver can't 'switch' your application to use a different database; something outside of repserver has to do the actual switching.
    If your application happens to be connecting to your ASE via Sybase's OpenSwitch (or similar) product, then OpenSwitch would be responsible for switching your application to use the standby database.  Whether you have OpenSwitch perform the switch automatically, or via a manual command, is up to your BCP requirements.
    If your application connects directly to ASE then you'll have to decide how/when to get your application to switch to the standby database.  In the simplest form this would require shutting down the application, making sure replication is quiesced (ie, all in-flight transactions have been applied to the standby database), modify the interfaces/sql.ini file (used by your application) to point to the standby database, make any customized changes to the standby dataserver/database (eg, unlock application logins, take databases out of 'dbo use only' mode, etc), and startup the application (at this point it should connect to the standby database per the changes to the interfaces/sql.ini file).

  • How can I customize the toolbar when using the attribute browser

    In CVI 2012, the toolbar changes depending on the environment, e.g. it is different for the source window and the UI editor. The toolbar can be customized using the menu Options / Toolbar...
    Unfortunately, when using the attribute browser of the UI editor, another toolbar is displayed, i.e. not the UI editor toolbar.... I would have assumed that the attribute browser belongs to the UI editor, obviously it doesn't... So how can I customize the toolbar when using the attribute browser?
    Solved!
    Go to Solution.

    Luis,
    It's nice to have you back 
    Thank you for the clarification, so I'll elaborate a bit more: In the regular workspace toolbar, I have a disk symbol to save the file. This symbol is gone in the attribute browser...
    So I have three different toolbars, for source code (workspace), UI editor, and the UI editor displayed but the attribute browser clicked on (selected)... 
    Thanks
    Wolfgang
    Source code:
    UI editor:
    Attribute browser:

Maybe you are looking for

  • Java Version 1.4 vs 1.5

    I am about to start a big project for my college senior exit. I have been told that unless I can convice my sponsor to upgrade, I need to use 1.4. Is there anywhere that I can find a comparison of the pro's\con's of the two? If anyone can point me to

  • Internal Software Error: %0

    I get the following error message after Encore 2.0 prepares the slideshows and goes to the next step. All of the video material is prepared and, the progress window is in the middle of "Planning Audio for movie". Any suggestions for a fix? Adobe Enco

  • Reg: MRP Run for all Materials

    Hi Abapers, I have an issue where in using MD01( Material Run), i need to raise one PR for all materials below the re-order stock. Currently system creates one PR for each material below the re-order stock. Please throw any ideas regarding this. Than

  • ECC SPROXY Error: No connection to Integration Builder

    Helllo Experts, I am trying to run transaction SPROXY in ECC to connect to PI ESR and getting error: Do I need to create any PI users in ECC? Thanks.

  • Zen Sleek / Vista Compatability Er

    I've searched this forum and found only one post with an answer to the Zen Sleek / Windows Vista compatability problem Its a good thing NO ONE gives a straight forward answer to the situation all i'm looking for is a solution to this situation, my co