Random button code help

I am working with a small flash file that plays a short
animation that ends on frame 42 and displays a button.
The button has the following code:
on (release) {
var zufall = random (6 );
if (zufall == 1) {
tellTarget ("") {
gotoAndPlay(43);
if (zufall == 2) {
tellTarget ("") {
gotoAndPlay(44);
if (zufall == 3) {
tellTarget ("") {
gotoAndPlay(45);
if (zufall == 4) {
tellTarget ("") {
gotoAndPlay(46);
if (zufall == 5) {
tellTarget ("") {
gotoAndPlay(47);
if (zufall == 6) {
tellTarget ("") {
gotoAndPlay(48);
The next 6 frames (43-48) have different movie clips on them
and a stop actionscript. And when the user clicks the button on
frame 42 one movie clip will play randomly and then after finishing
goes back to frame 42 and displays the button again.
The flash works perfectly, except the button is only randomly
playing the movie clips on frames 43-47. It is ignoring frame 48.
Does anyone have any ideas as to why?

i don't understand why tellTarget(""){...}
i don't understand why if... if... if... if... if...
i don't understand why not
on (release) {
var zufall:Number = 43+Math.floor(6*Math.random());
gotoAndPlay(zufall);
to settle everything...
if you are using AS1
on (release) {
var zufall = 43+random(6);
gotoAndPlay(zufall);
}

Similar Messages

  • Dreamweaver CS3- Add this button code help

    Hi, I have a problem in Dreamweaver CS3. The problem is that when I insert my add this button code, in to the codeing area, it does not work.
    When I open my page in chrome, it simply says 'more shraeing services'. I will copy the code, in to this discussion. I would be greaftful if someone
    can help me resolve this problem, so I can get the add this button to work on my site. The final bits of code are as follows-
    <!-- AddThis Button BEGIN -->
    <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
    <a class="addthis_button_preferred_1"></a>
    <a class="addthis_button_preferred_2"></a>
    <a class="addthis_button_preferred_3"></a>
    <a class="addthis_button_preferred_4"></a>
    <a class="addthis_button_compact"></a>
    <a class="addthis_counter addthis_bubble_style"></a>
    </div>
    <script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
    <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4dd57258352fac8e"></script>
    <!-- AddThis Button END -->
    <!-- Place this tag where you want the +1 button to render -->
    <g:plusone></g:plusone>
        </div>
       </form>
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script>
    <script type="text/javascript" src="http://www.google.com/cse/t13n?form=cse-search-box&t13n_langs=am%2Cel%2Cml%2Cpa%2Cta%2Car% 2Cgu%2Cmr%2Cru%2Cte%2Cti%2Csa%2Cne%2Chi%2Cbn%2Cen%2Ckn%2Cfa%2Csr%2Cur"></script>
    <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script>
    <script type="text/javascript" src="http://www.google.com/cse/query_renderer.js"></script>
    <div id="queries"></div>
    <script src="http://www.google.com/cse/api/partner-pub-5783950232732081/cse/4522012035/queries/js?oe=UT F-8&callback=(new+PopularQueryRenderer(document.getElementById(%22queries%22))).render"></script>
      </div>
      <div align="center"></div>
    </div>
    <script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
    <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4dd57258352fac8e"></script>
    <!-- AddThis Button END -->
    </div>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </body>
    </html>
    Is there anything in this piece of code I should edit in order to make the add this button work? Many thanks

    A link to your page would be the best possible way to get help with this. 
    Code fragments don't tell the whole story.
    Nancy O.

  • Random Integer - Code help

    Hi, I'm having a bit of a problem with a program I am making for class. I'm not asking you guys to do my work for me, I just simply need some guidance as to what I am doing wrong.
    Alright, what I am suppose to write as a program that takes two user defined integers and then prints a random integer from between the two user numbers. This is the code I have thus far:
            int a = Integer.parseInt(args[0]);
         int b = Integer.parseInt(args[1]);
         double r = Math.random();
         int low = a + (int) (r * a);
         int high = a - (int) (r * b);
         int result = low + high;
         System.out.println(result);For the most part it seems to work, however it will only work if the two user defined numbers are more then 10 digits of each other. I.E. 10 20 will work fine, however 1 5 will not, 10 15, etc.
    Any help would be greatly appreciated!
    Edited by: KnivesACE on Sep 18, 2008 11:32 AM

    Stianbl wrote:
    lower = 1000;  // your lower integer value
    upper = 2000; // the larger one of your two integers
    double rand = Math.random();
    int result = lower + (int)((upper - lower)* rand);
    http://forums.sun.com/thread.jspa?threadID=590266&messageID=3948731
    The question here is whether the two limits are to be included in the random range? In your solution 2000 will never happen. If you want it to it should look like this,
    int result = lower + (int)((upper - lower + 1)* rand);

  • When ever i touch for example appstore it touches safari. i press home button the my phone does what ever it wants, like goes to settings and presses random stuff please help. :(

    when ever i touch for example appstore it touches safari. i press home button the my phone does what ever it wants, like goes to settings and presses random stuff please help. :(

    Try restarting it. If this does not work, then hard restart it which is holding the power and home button until the product ***** off. If this does not help either, plug it into the computer and restore it. Make sure you back up the device before you restore it though! Here are instructions on how to restore and back up an apple device. http://support.apple.com/kb/ht1414

  • Blackberry Curve 8520 - random buttons?

    So I dropped my phone in water yesterday and the trackpad wasn't working, I just pulled the battery out and put it back in. It started working fine then all of a sudden today whenever i'm texting it presses random buttons. It keeps asking me if I need to change the time, etc , etc.
    Solved!
    Go to Solution.

    I'll warn you, that the longer you keep the device powered up and the battery in, you're likely gonna end up with a totally non-working Blackberry.
    Electricity + water does not mix. Never good.
    1. Remove the battery immediately!! Do not attempt to turn on your BlackBerry.
    2. Let the device dry in a warm, dry place for 3 to 5 days* (see below)
    3. DO NOT "check it each day" by placing the battery in. Leave it be to dry completely. This takes time. Replacing the battery to check it can only damage it more (moisture + electrical current = disaster).
    4. If the device is warm after the drying period, allow it to cool to room temperature before placing the battery back in.
    Suggestions on drying your BlackBerry in a warm place (open, with the battery out):
    *Place the BB in a container of dry UNcooked rice, and then you might also place it in any of the locations mentioned below.
    *On top of any dry heat emitting electronic component: TV cabinet or CRT, LCD, cable TV/Satellite converter box or plasma monitor
    *On the dashboard of your car on a sunny day
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Random Button ActionScript 2?

    I'm trying to make a random button in my flash game, and nothing I try works. I can't post the file either becausde it's too big. The button is in a movie clip where everything else is. Someone help please.

    Here's what I'll suggest--I haven't looked at your file yet.  I do't know if having those _global variables is significant, so I am leaving them in, but if they are only for the purpose of indicating which frames the movieclips should go to, then they can go as well.  In either case, you will get rid of the onclipevent code you have attached to each movieclip
    For starters, you will need to assign an instance name to each of the movieclips.  Instance names are assigned in the properties panel.  I will use names that reflect the global variables, with _mc appended....
    on(release){
         _global.Head = Math.floor(Math.random() * 4) + 1;
         head_mc.gotoAndStop( _global.Head );
         _global.Body = Math.floor(Math.random() * 4) + 1;
          body_mc.gotoAndStop( _global.Body );
         _global.Beak = Math.floor(Math.random() * 4) + 1;
          beak_mc.gotoAndStop( _global.Beak );
        etc....
    OR, if you don't need the _globals...
    on(release){
          head_mc.gotoAndStop(Math.floor(Math.random() * 4) + 1);
          body_mc.gotoAndStop(Math.floor(Math.random() * 4) + 1);
          beak_mc.gotoAndStop(Math.floor(Math.random() * 4) + 1);
        etc....
    Note that I have added Math.floor into the mix.  This produces an integer value out of what the Math.random creates.

  • How to create authorisation object for save button please help in abap

    how to create authorisation object for save button please help in abap

    Hi
    In general different users will be given different authorizations based on their role in the orgn.
    We create ROLES and assign the Authorization and TCODES for that role, so only that user can have access to those T Codes.
    USe SUIM and SU21 T codes for this.
    Much of the data in an R/3 system has to be protected so that unauthorized users cannot access it. Therefore the appropriate authorization is required before a user can carry out certain actions in the system. When you log on to the R/3 system, the system checks in the user master record to see which transactions you are authorized to use. An authorization check is implemented for every sensitive transaction.
    If you wish to protect a transaction that you have programmed yourself, then you must implement an authorization check.
    This means you have to allocate an authorization object in the definition of the transaction.
    For example:
    program an AUTHORITY-CHECK.
    AUTHORITY-CHECK OBJECT <authorization object>
    ID <authority field 1> FIELD <field value 1>.
    ID <authority field 2> FIELD <field value 2>.
    ID <authority-field n> FIELD <field value n>.
    The OBJECT parameter specifies the authorization object.
    The ID parameter specifies an authorization field (in the authorization object).
    The FIELD parameter specifies a value for the authorization field.
    The authorization object and its fields have to be suitable for the transaction. In most cases you will be able to use the existing authorization objects to protect your data. But new developments may require that you define new authorization objects and fields.
    http://help.sap.com/saphelp_nw04s/helpdata/en/52/67167f439b11d1896f0000e8322d00/content.htm
    To ensure that a user has the appropriate authorizations when he or she performs an action, users are subject to authorization checks.
    Authorization : An authorization enables you to perform a particular activity in the SAP System, based on a set of authorization object field values.
    You program the authorization check using the ABAP statement AUTHORITY-CHECK.
    AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'
    ID 'ACTVT' FIELD '02'
    ID 'CUSTTYPE' FIELD 'B'.
    IF SY-SUBRC <> 0.
    MESSAGE E...
    ENDIF.
    'S_TRVL_BKS' is a auth. object
    ID 'ACTVT' FIELD '02' in place 2 you can put 1,2, 3 for change create or display.
    The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.
    This Authorization concept is somewhat linked with BASIS people.
    As a developer you may not have access to access to SU21 Transaction where you have to define, authorizations, Objects and for nthat object you assign fields and values. Another Tcode is PFCG where you can assign these authrization objects and TCodes for a  profile and that profile in turn attached to a particular user.
    Take the help of the basis Guy and create and use.
    Regards
    ANJI

  • Paypal button code

    Hello,
    I have Paypal code that allows me to sell 3 books, listed on one menu, all for the s.ame price, $17
    I need to add another book that costs $22.
    Please, can someone help me with the code?
    Thanks
    Alida

    If the block of code for the paypal button is basicly unreadable, then it is encrypted and you need create the button in the PayPal account. If you go to the account, you will see that it's all pretty intuitive. Then copy/paste the code PayPal generates into your web page in code view.
    If the button code is readable, then you can create a new button just by changing the obvious values, such as
    <input type="hidden" name="amount" value="22.00"/> for the amount.
    . . . or, you can also create a non-encrypted button in PayPal, just like an encrypted button, and paste the code into your page (in code view of course).

  • When button clicked help

    I have buttons for help, back, next, finish, cancel.
    initially I have the back and finish buttons setEnable(false)
    but when I click on Next button I want the Back button to be setEnable(true)
    I wrote the following
    //ActionListener for jButton_Next Of NavigationButtons Panel
    newNavigationButtonsClass.jButton_Next.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    newNavigationButtonsClass.jButton_Back.setEnabled(true);
    When I click on the jButton_Next the jButton_Back is not enabled. May I know what I can change in this to get this working. Thanks.

    Is the code where you initially disable the button
    getting called again somehow? I'd check to make
    sure this code isn't getting called again after you
    enable the button within actionPerformed.

  • My iPod touch 2nd generation keeps turning the volume up and then turns off, by itself randomly. Please help!!, My iPod touch 2nd generation keeps turning the volume up and then turns off, by itself randomly. Please help!!

    my iPod touch 2nd generation keeps turning the volume up and then turns off by itself randomly. Please help!

    Try the standard fixes in order:
    - Reset:
    Reset iPod touch:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    - Restore the iPod from backup via iTunes
    - Restore the iPod to factory defaults/new iPod
    - Make an appointment at the Genius Bar of an Apple store.

  • When my iPhone is connected (via the Lightning cable) to the usb port in my car, the alert tones are no longer played through the car speaker or the phone.  This previously worked, but has randomly stopped working, help!

    When my iPhone is connected (via the Lightning cable) to the usb port in my car, the alert tones are no longer played through the car speaker or the phone.  This previously worked, but has randomly stopped working. help!

    I took my iPhone to the Service center of M/s RSG INFOTECH PRIVATE LIMITED on April 17, 2014.
    Why are you posting in this forum about what occured with an independent service provider?  How is is at all relevant to Apple??  In fact, service by any person or business not authorized by Apple voids any waranty.

  • After I installed iOS7.7 on my iphone 4, it only works when plugged in, overheats and plays random music. HELP!!!

    My iphone 4 has been acting up since I installed iOS7.1. It only works while it's plugged in, overheats while charging and randomly plays music.HELP!!!

    Place the iPhone into recovery mode and restore the iPhone with iTunes on your computer.
    http://support.apple.com/kb/HT1808

  • Survey creation abap code help needed

    hello experts,
    I need to create a survey in crm, by taking values from end-user from a webpage
    A sample code help is needed.
    Thanks in advance

    Take a look at this SAP note - It does a pretty good job of detailing the steps for you.  No coding necessary, it worked out of the box for us after patching this note.
    https://service.sap.com/sap/support/notes/638320

  • I'm getting a similar message: There was an error opening the database..." and the only option I get is a "quit" button. Help!

    I'm getting a similar message: First it offers me chance to repair - but if I it repair, it crashes.  Then if I select do not repair I get the following warning: There was an error opening the database..." and the only option I get is a "quit" button. Help!

    From the path in the error message you posted it appears that the library is not on your internal (root) drive.
    What type of disk is the library on and how is it formatted?
    The crash log Léonie is referring to is what is printed out when Aperture crashes. You wrote that Aperture crashes in your first post so if the app crashes you must have gotten a crash report.
    Message was edited by: Frank Caggiano

  • How to "un-grey" the "Updates" button under Help in PS CS6?

    I had uninstalled the CS5.5 and installed the CS6 Master collection. But the "Updates" button under Help in PS is greyed out, that means I cannot update the ACR to 7.1 or any subsequent updates. How can I overcome this problem? BTW, my computer is windows based.

    " Sure you can - simply download them from the support pages/ download section.”
    What should I download from that page?
    ATongT

Maybe you are looking for

  • Optimize a loop in a SAP standard program

    Hi gurus, Iv been optimizing this code.. inlcude workarea but still the same. It has 1000 records after retrieving the data from the select statement for less than 1 minute. It takes 10-12 mins in looping. I already debug it and PERFORM takes half a

  • Purchase Credit memo - G/L Account is missing

    I purchased some items (not the service) from a vendor, but i like to return it so I wants to create a A/P Credit Memo.  I am copying all the information into the A/P Credit memo from Goods Receipt document.  When I click add button the system throws

  • Simple AIR ajax question? One html file or many?

    I am a new ajax air developer and was wondering if it's a better practice to use one html file in my app or many html files? So far I have been testing with many html files using javascript location.href to send the user to another html page when the

  • Camera Raw Download for CS5

    I am using CS5 and need a download for Camera Raw. The only thing that I can find online is an update or a download for CS6 users. Is there a link that I can go to to download an older version of Camera Raw for MAC, CR2 files? This link no longer hel

  • What is the usage of Request Variable ? and how we can use it ?

    Hi All, What is the usage of Request Variable ? and how we can use it ? Thanks in advance