Define AS for buttons on a different keyframe?

This probably has an easy answer, but I seem to be unable to find it myself.
On frame 1 in the Timeline (in CS4), I have this actionscript:
var clickAreaLink1:URLRequest = new URLRequest("http://www.example.com/?=1");
btn_clickArea1.addEventListener(MouseEvent.CLICK, clickArea_click1);
function clickArea_click1(event:MouseEvent):void
        navigateToURL(clickAreaLink1,"_blank");
On a different keyframe, I have my button labled “btn_clickArea1.” When I run the movie I get the error “Cannot access a property or method of a null object reference.”
My guess is because the button is on a different keyframe than the actionscript. However, I have four buttons that will need to be constantly updated, so I want the actionscript all in one place to easily update them. Is there a good way to get this to work?
Thanks for your help!

The objects you want to have involved with code have to be in the presence of that code when it is processed in order to work.  So if you want all your code in frame 1, then all your content that uses that code must be in frame 1.  There is nothing wrong with spreading your code out as needed though.  As long as you dedicate a layer or two for actionscript, it should be easy to locate.
You set the "visible' property of movieclips, buttons, etc to true or false to control their visibility

Similar Messages

  • Action Scripting for button

    I created a little 'movie clip' of a continuous animation and
    want to make it a button that can be used in dreamweaver. I was
    told I would have to link it from flash (as dreamweave can not link
    a swf file to a webpage). I was having a problem trying to action
    script the movie clip - when I selected the 'movie clip' graphic it
    said: Current selection can not have actions applied to it. How
    should this be done?
    Thanks

    you're right - that should work. my first thing that i test
    when something like that happens is that every keyframe in the
    tween contains exactly the same instance. A common problem is that
    the instance name of the clip may be slightly different(eg a space
    somewhere) in different keyframes.
    Rather than looking for the problem, I usually just clear the
    keyframes in the tween and then put them back in. In your case I
    cleared the keyframe on frame 12 on layer "see more" and then
    inserted keyframe(returning it to color: None) and tested the
    movie. The button works fine!
    So then i went back to your original movie to try to find
    what was inconsistent between the two keyframes in 'see more' and
    couldn't find the problem... so anyway, this looks like a situation
    where we may not know the reason for the problem but at least we've
    found the solution...

  • Defining styles for  my page layout.

    Is there any in depth resource for what styles are and how to define them for laying out a page in Pages? I am terribly lost!

    Hello Zenmind,
    there are three different kind of styles and you can work with them in every text area of Pages: in the main text area, in textboxes and in objects with inserted text.
    1) The paragraph style
    Paragraphs will be created by a new line character. This you insert in text areas by hitting the return key. So every inserted new line character (you can see them by showing the invisibles; menu: "View/Show Invisibles") creates a paragraph. To create a paragraph style, place the text cursor inside such a paragraph text and adjust the options in the "Text" inspector in the four tab panels "Text", "List", "Tabs" and more.
    After you are satisfied with the look of it, show the styles drawer (menu: "View/Show Styles Drawer") and click onto the down pointing triangle right beside the marked style name. In the appearing menu you can choose the top item "Create New Paragraph Style From Selection..." to get what it says. Give it a proper name and your new created paragraph style will appear in the styles drawer in the list of the paragraph styles.
    If you want to change an existing paragraph style, place the text cursor in the text of the paragraph you want to alter and adjust the options you want to have. Now show the same menu in the paragraph style drawer I mentioned above (to show you that there are changes, the triangle is red now) and choose the second item "Redefine Style From Selection".
    For changing the style of one paragraph to an other style, place the text cursor inside the paragraph text and use the style menu in the button panel of the document window or select the style name in the styles drawer. Now you can change the paragraph in two ways. a) Do a single-click and the bold and italic (color, etc.) marked words will remain if the font of the selected style is installed in bold and italic. b) Do a double-click and all characters of the paragraph will be changed into the font style of the selected paragraph style.
    2) The list style
    In the style drawer you can find a list of styles for lists (the button with the three lines at the drawers bottom border). The handling is the same as with the paragraph styles.
    3) The character style
    With this styles you can mark characters and words inside of paragraphs. You can show the styles with the button that displays the underlined "a" beside the show/hide "List" button. Unfortunately this function is not working correctly. You can choose by creating such a style which attributes you want to store in the style. By marking words and assigning this character style to them, ALL attributes will be assigned, not only the selcted.
    I know some feedbacks of this bug were sent to the developers and hopefully this will be corrected in the next version.
    I hope this helps you to understand styles and the creation/handling of them.

  • Using action script 2 how can i send a variable value to a dynamic textbox on a different keyframe?

    using action script 2 how can i send a variable value to a dynamic textbox on a different keyframe?

    Thanks for your swift response.
    That sounds like a good solution, but the code I have on frame 2 is this
    timer = 0;
    countup = function(){
    timer++;
    countupInterval = setInterval(countup,100);
    If I added the same actionscript to frame 3 which has a dynamic textbox with a variable timer attached wouldn't it just put the timer back to 0? What I want is the last known value that was given when it was in frame 2.
    I am thinking of temple run here, I am trying to caculate the total distance(set in the timer variable) from the previous try.
    Hope this makes sense.
    Chazwick

  • Defining Accounts for Materials Management

    Dear sir,
    Now, I have to Define Accounts for Materials Management, but I dont know what are procedure or group to match my account number. Can you explain the definition of following procedure:
    Expense/revenue from consign.mat.consum
    Expense/revenue from stock transfer
    Subsequent settlement of provisions
    Subsequent settlement of revenues
    Provision differences
    Inventory posting
    Change in stock account
    Inventory posting
    Revaluation of other consumables
    Del credere
    Materials management small differences
    Purchase account
    Purchase offsetting account
    Offsetting entry for inventory posting
    Account-assigned purchase order
    MM exchange rate rounding differences
    Differences (AVR Price)
    Cost (price) differences
    Price Differences (Mat. Ledger, AVR)
    Price differences (cost object hierarc.)
    Price Diff. from WIP Written Off (Mat.)
    Product cost collector price differences .....
    Many other, but you can explain some and give me example, and step by step giude me setup
    Thank you very much
    Faithfully,
    Hangvt

    Hi,
    Some of the companies are having a practice of paying payables with the rounding off rules. This rounding of in India could be from Rs.0.01 to Rs.10.00. For examble, there is a payable amount of Rs.125125.25 this can be rounded off to Rs.125125.00 or Rs.125130.00 while making payment. The balance amount should hit the rounding off difference account.
    The same things is applicable for receivables also.
    Over/under payment GL can be configured by using T Code OBXL
    There is an another use, for details see the below link,
    http://help.sap.com/saphelp_47x200/helpdata/en/01/a9b9a6455711d182b40000e829fbfe/frameset.htm
    There may be some more reason where you need to do this configuration,
    Disc. difference
    Incorrect cash discount rate
    To be paid without deduction
    Credit memo without backdated cash disct
    Cash discount period exceeded
    Reduction without doc.number allocation
    Incomplete payment advice note
    Payment amount is different
    Debit reduced not paid
    Debit reduced not paid
    Reduced twice
    Paid not reduced
    Damaged goods - disputed
    Goods damaged during transport
    Quant.delivered not same as order quant.
    Freight charges not paid
    Miscellaneous deductions
    Price variances - disputed
    Partial payment
    Returns
    Residual item creation
    Trade Promotion
    Payment differences on debit side
    Hope it clears your doubt.
    Regards
    A.Saravanan.

  • Problem creating user-defined metric for Database

    I am logged in to EM/Grid Control as SYSMAN, any user with superadmin privileges or a 'normal' user with operator/full privileges for my database target. When I go to set up user-defined metrics for the target db I get the following warning "You will only be able to view User Defined metrics because you do not have Operator Privileges on host <db target name>". The Create button is disabled.
    Can anyone offer any advise on where to identify the privilege problem?
    Thanks

    Well I did it with a host UDM calling a local script (which will be installed on shared drives for the development/test and production systems).
    The local script cats the /var/opt/oracle/oratab file eliminating lines beginning with # or $ then takes the second argument of each line and loops through all entries using a checkit procedure. The checkit procedure determines if the appropriate log directores exist for the oracle home and does a find on the diretory looking for alert*.log and *.trc. If there are any then global variables get updated with the count and directory name.
    There is an if statement before exit that checks of the count of files is greater than zero and write an appropriate em_result and em_message depending on the results.
    I then created the UDM in EM to call this script and check for critical/warning thresholds.
    Regards
    Tim

  • ICWC - define filters for case management 5.0

    If I want to limit the Cases linked objects and logs to BP's, sales order, & service tickets are the proper setting.
    1. SPRO > interaction center webclient > business transaction > case management > define filters for displaying case detail.
    2. Define filter = ZTEST,
    enter any heading descriptions 1- 5
    Navigation = RecFolderToRecordDetail
    3. Assign element types,  add entries
    CRM_BUSINESS_PARTNER
    CRM_SALES_TRANSACTION
    CRM_SERVICE_TRANSACTION
    Can BOL type, description, path to bol 1, path to bol 2, etc all stay blank? to default to SAP functionality?
    4. Define Filter profile = ZTEST1
    5. assign filter ZTEST1 = ZTEST
    Step #3 is the one I want to be sure I understand.  Will rewards points.
    6. assign the filter in a different SPRO entry.

    I'm guessing zdefault had same description default and it was picking up the default one in error.

  • TS3682 I started updating my iPhone 4, but it went black screan and then started turning on and off non stop. I tried to hold the two buttons, but nothing different happened. Please, help! What should I do?!

    I started updating my iPhone 4, but it went black screan and then started turning on and off non stop. I tried to hold the two buttons, but nothing different happened. Please, help! What should I do?!

    First see if placing the iPod in Recovery Mode will allow a restore.
    Next try DFU mode and restore.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    If not successful then time for an appointment at the Genius Bar of an Apple store. You are not alone with this problem.

  • Question for customs "Define rules for default document data"

    Hello all,
    we would like to set up the data for AES. We set the country of origin, as you can see on the below screenshot.
    The problem is that the country of origin is not forwarded to AES. In the export declaration under the item detail there is an empty field at the country of origin.
    What do we have to change in the set up "Define rules for default document data"?
    Thanks in advance.
    Sven Sklarek

    Hi Sven,
    Sorry to take the conversation in a different direction, but it's very unusual to propose the Country of Origin (CofO) by default, and not usually accepted by the Customs authority.  Generally the CofO depends on where you obtain the goods.  If that doesn't change much, it's usual to set the CofO on the Material Master record in the ERP system - in that case the value copies automatically into the GTS Export Declaration item.  That is why there is no standard configuration having IT_CUCOO as a Target Field.
    Also, in many countries, CofO is not mandatory in the Export Declaration (although always mandatory in the Import Declaration).  You might want to check the situation in your area.
    Regards,
    Dave

  • Pre-define filter for query in a BEx Report

    Hi all experts, I have a question, I have created a report with WAD and Query Designer, and I need a pre-define filter for different user or different role. Anyone knows where should I set this pre-define filter to the query ? In the WAD itself, or must do it in backend ? My scenario is, lets say User A login to this report, he will have value A, B, C as filter value in characteristic Z, User B login to this report, he will have value D, E, F as filter value in characteristic Z. Perhaps you guys can understand what I trying to say.

    Hi,
    You can set a customer exit variable on characteristics Z. the value for Variable is populated in customer exit written in CMOD using I_STEP = 1.
    You also need to maintain a mapping table for value of characteristics Z to user. Now if user A checks the Report, using the sy-uname you lookup to the mapping table and get the corresponding values of characteristics Z and populate the default value of the variable or straight away restrict it in the query by not making it ready for input.
    Hope it helps....
    Regards,
    Umesh

  • Timers for button in jsp?

    Hello,
    I am farily new to JSP and I want to know if it is possible to add a timer event (complete with actionlistener for button and for the timer) for a button created in the jsp page. ie I have a button created as:
    <INPUT ID="Button1" TYPE="BUTTON" VALUE="something" ONCLICK="doSomething()">
    (doSomething is writing some data to file say abc.txt)
    IN addition to this doSomething function I would also like to start a timer to write timestamp into abc.txt about every 10 min.
    can it be done? pls help me ....
    thanks.

    Nope - not with java.
    A JSP is a java SERVER page.
    The java bit of the code runs on the server, and builds an HTML page, which it sends back to your browser.
    From that point on, you just have a standard web page - you can't run any code on the client.
    Listeners, timers etc etc on the CLIENT side have to be done in javascript, which is a totally different language.
    Cheers,
    evnafets

  • Accesskeys for buttons work inconsistently - why?

    When using accesskey attributes for buttons, they work sometimes and not others. Three behaviors are observed:
    - using the accesskey both shifts focus and clicks button (correct behavior)
    - using the accesskey shifts focus only - not clicking button
    - using the accesskey does nothing
    These behaviors occur without changing setup, restarting, etc.
    What could cause this?
    By the way, 3.6.28 works fine with the exact same web application.

    Yes, we configure Firefox to use just Alt+key, which works fine for us. Configuring it to use Alt+Shift+key does not change the behavior we're seeing.
    At any point in time we might have several different data entry panels configured with the same set of Alt+keys, but only one is visible at a time. I'm wondering if the "hidden" panels are a problem now, but weren't in the older version?

  • Need assistance with buttons pulling in different MC's

    Hi I would like to have a screen with multiple buttons and
    when the button is clicked different MC's will be imprted into the
    .fla file. For instance button 1 will import 1_MC, button 2, 2_MC,
    button 3, 3_MC etc.
    Can someone point me to a tutorial or give me a down and
    dirty example using AS3?

    You don't need to make the buttons as movieclips, but you
    could if you had a reason for it. Like if you wanted to load the
    images into the buttons themselves... then you'd need them to be
    movieclips. You can use the same code for the event listeners for
    movieclips as you would for buttons...
    myButton1.addEventListener(MouseEvent.CLICK, addMovie1);
    But you don't add this code to the buttons (like you used to
    be able to sort of do in AS2)... it sits in the actions layer you
    create in the timeline where most of your code goes. As long as
    your button in in the same timeline and has the same instance name
    assigned to it as the code (ex. myButton1 above), the code will
    play for the button.
    You can position instances using AS by setting their x and y
    coordinates, even before they appear. You can pretty much set any
    property before you add it to the stage....
    function addMovie1(e:MouseEvent):void
    var myMovie1:Movie1 = new Movie1();
    myMovie2.x = ...
    myMovie2.y =...
    myMovie1.name = ...
    myMovie1.alpha = ...
    etc...
    mcContainer1.addChild(myMovie1);
    I think I've handled all of your questions with the snippets
    I just provided, so give it a go. Tutorials are handy, but you're
    doing the right thing if you find yourself struggling to figure
    stuff out without them... it's a better learning process... it
    tends to burn in better and last longer from having to solve
    it.

  • Rich Symbol feature for Buttons?

    Im making a site with menu links where the text size and font
    is the same, but the color is different for each one. So I can play
    about with changing the font etc ive used a simple script to make
    the colour editable, attached to the graphic type of symbol.
    This is working but what I really want is to do the same
    thing, but with the button type of symbol. This would allow me to
    design the rollovers and down states, while still having the font,
    size etc easily updatable.
    Is there a way of using the rich symbol feature for buttons
    or is it for graphics only?
    thanks

    I think i could get round this by making a button with a roll
    over state (say italic), then applying a style to the whole button
    and using the style to control the appearance. ( I know that styles
    are only updatable in CS4 but im thinking of upgrading).
    When a style is applied to a button it seems to override the
    appearance setting of the button (font, colour, etc).
    Say I wanted to have some buttons different colors, but have
    the other appearance elements controlled by the style applied,
    could i override the colour (or similar feature) some way? I would
    still need to have the style linked to update it.
    thanks

  • How to use pre-defined scenarios for RosettaNet with XI 3.0

    Hi all.
       I am working in Comgroup Shanghai co. ltd. which is partner of SAP China.
       We have a potential customer who use RosettaNet as their Supply Chain EDI system.
       I would like to make a demo for demostrate the pre-defined scenarios for RosettaNet RNIF 2.0 packages.
       Where can I find such guideline ? I have checked the article: implementing RosettaNet with XI 3.0, but it cannot help me.
       Another question is how I can develop my own scenarios for the RNIF standards which are not included in XI RosettaNet business package ?

    Hi Andy,
    See the instructions below after you installed the RosettaNet STK.
    Below given is the sample config for PIP3B2 Scenario. Part I is using STK and Part II is using 2 XI systems.
    <b>Part I. Test Using STK</b>
    In your XI ID:
    1) Define both the parties 1) Shipper(Your Partner) 2) Receiver(Your company) with identifiers like DUNS Number.
    2) In ID goto>Tools>Transfer Integration Scenarios from IR-->select the scenario "PIP3B2_Receiver" from the drop down list.
    3) Follow the 4 steps in the config wizard.
    4) While creating your CC, create it from the channel template delivered with the RosettaNet BP.
       4.1) Specify the URL for STK which should be in the following format
    http://<STK Server>:<port>/rosettanet/servlet/listenerServlet?userId=<Party Name>
       4.2)In the location fields, enter your location and your partner location.
    In your STK
    1) Start the RosettaNet STK.
    2) enter the UserID<Partner Name in XI>
    3) Select the Test Scenario, 3B2V01.01-AdvanceShipmentNotification-0001-Scenario-Shipper
    4) Enter Global Business ID(DUNS Number) and Location ID for both the partners. These fields should be same as in your R/3 Party configuration.
    5) Enter the URL as follows:
    http://<XI Server:<J2EE_Port>/MessagingSystem/receive/RNIFAdapter/RNIF
    If everything is configured correctly as mentioned, you should be able to test your single-action scenario.
    <b>Part II Test using another XI System</b>
    For these follow the steps above for XI Config.
    Configure one XI System as PIP3B2 Shipper using the Scenario "PIP3B2_Shipper" and config wizard as mentioned above.
    Configure the other XI as PIP3B2 Receiver using the scenario "PIP3B2_Receiver" and config wizard.
    In the Url field, specify the URL as follows:
    http://<XI host>:<J2EE_Port>/MessagingSystem/receive/RNIFAdapter/RNIF
    Hope this helps.
    Regards,
    Sam Raju

Maybe you are looking for