A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Random element display

  1. #1
    Junior Member
    Join Date
    Apr 2001
    Posts
    4

    Red face


    I have 84 elements (all logos in .jpg format), and I would like to have them show fading up in 1 second, then hiding in 1 second, then the next element and so on. Easy enough, but to do this for all 84 elements means creating 168 actions, which are all the same, albeit for different elements. Is there any way I can tell the program to select an element from random, and display it at a random place on the screen, following the show and hide conventions I require?

    Thanks in advance from a newbie to Flash.

    Kevin
    [Edited by Kevinede on 01-23-2002 at 10:37 AM]

  2. #2
    Senior Member zoranvedek's Avatar
    Join Date
    Aug 2001
    Location
    Wagoner OK
    Posts
    893
    Get a random number(1 more than as many images you have)and assign it to a varible(x,y,123,whatever you want to call it). Then use an "if" command to set your properties. Set the opacity for one element for each number at 100%,all the rest set to 0%. The element at 100% should then contain an 'x' and 'y' "set property" for position, set these at a random number with a maximum value as large as your movie. Do this for all of your images and let it go.

    Here is a working version with 3 images:
    http://members.aol.com/lucky13thday/ranpos.html

    If you would like to see the movie file(probably a lot less confusing than my description), email me using the email form at the bottom of this post, and I will send a zip containing the movie and the images I used.

    -Jason



    [Edited by zoranvedek on 01-23-2002 at 03:48 PM]

  3. #3
    Junior Member
    Join Date
    Apr 2001
    Posts
    4

    Wink It works!But now I have a second problem....

    Thanks for your help Jason.

    I have now got the files in, but I think I am pushing the boundaries of what this app can do.

    When I used the show option before, I did not use an action form, I simply created a Show Event, which scaled up the image over a period of 1 second. I then used a Hide Event, which faded out the image over a period of 1 second.

    Have you any idea how I can incorporate this into the system? I have been unable to find any way of doing this.

    Kevin

  4. #4
    Hi.

    Steps.
    1. Highlight all items that you wish to display.
    select the first one and then press shift click on the last one.
    2. Then add a show items and select 1 second delay between each item.
    3. do step 1 again.
    4. Then add a hide items with a 1 second delay between items.
    5. Then add a delay to the hide items of 1 second.

    This will then show all items 1 second after each other.

    Hope this makes sense.

    If you need an example let me know.
    email = freeflash@members.optusnet.com.au

    Regards,
    a_non_amous.

  5. #5
    Senior Member
    Join Date
    Jul 2001
    Posts
    173
    The new release contains JAVASCRIPT functionality that can handle this sort of logic. We are working to make it available within the week.

    Thanks for your support
    Regards

    InsaneTools

  6. #6
    Junior Member
    Join Date
    Apr 2001
    Posts
    4

    Red face

    Thanks for the type a_non_amouse.

    Unfortunately it does not quite do what I wanted, but thanks for the advice. When I selected all the items and added a show, it shows them all one after another with 1 second intervals as you said, but what I wanted was when the first item is show using a transition, that the same element is then hidden using a transition immediately after it had completed it's show transition.

    e.g.
    Element01
    Element02
    Element03 etc...
    (Imagine 84 elements listed above)
    Wait 0
    Show Element01 using Scale Up Transition over a period of 1 second, scale up from 0,0 , fade up from 0%.
    Wait 0
    Hide Element01 using Fade Out Transition over a period of 1 second, fade down to 0%.
    Wait 0
    Show Element02 using Scale Up Transition over a period of 1 second, scale up from 0,0 , fade up from 0%.
    Wait 0
    Hide Element02 using Fade Out Transition over a period of 1 second, fade down to 0%.
    Wait 0
    etc..

    As dkerr has said, the new version they are trying to get out in the next few days will do it in javascript, but I do not know javascript, so I still don't have a solution!

    AAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHH!!!!!! :-)

    Kevin

  7. #7
    hi,

    you didn't follow the rest of the instructions.

    give me your email address and I will send you a working test movie.

    my email = freeflash@members.optusnet.com.au

    Regards,
    FreeFlash.

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