A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Only on my Mac?

  1. #1
    Junior Member
    Join Date
    Mar 2006
    Posts
    3

    Only on my Mac?

    I have made a slideshow with a random starting point for every time the swf is loaded - and it works fine on my Mac, but on PC it starts with the same picture every time.

    This code is on frame 1 and after my animations there is at gotoAndPlay(2)

    labelarray = ["jumpstart1", "jumpstart2", "jumpstart3", "jumpstart4", "jumpstart5", "jumpstart6", "jumpstart7", "jumpstart8", "jumpstart9", "jumpstart10"];
    randomidx = random(labelarray.length);
    gotoAndPlay(labelarray[randomidx]);

    I Really would appreciate any help you might have.

    ++Mikado

  2. #2
    Member Pepember
    Join Date
    Jul 2001
    Location
    Berlin
    Posts
    886
    hi, use this:
    gotoAndPlay(labelarray[Math.floor(Math.random()*labelarray.length)]);
    Please sign here

  3. #3
    Junior Member
    Join Date
    Mar 2006
    Posts
    3
    Hi

    Thank you for your time, but it still doesn't work.
    You can check it here: http://www.michaeldomino.dk/jun/

    It is the small pic on the right.
    It works fine on my mac/safari, but not when I use mac/firefox...or the PC/*

    As far as I can see the code you suggest just finds the labelarray in another way?

    ++mikado

  4. #4
    Member Pepember
    Join Date
    Jul 2001
    Location
    Berlin
    Posts
    886
    in my code i just tried to make sure to use the math functions in the most up-to-date manner. deprecated code might have been the reason...but no...
    so...i'd have to guess...maybe the pc flash player can't handle numbers in frame labels? have you tried using frame numbers instead of labels?
    Please sign here

  5. #5
    Junior Member
    Join Date
    Mar 2006
    Posts
    3
    Hi

    Ok thanks..I will use yours :·)
    I havent tried the frame numbers yet. I wanted to keep the possibility to change the movielength etc..

    ++mikado

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center