Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Senior Member diciccod's Avatar
    Join Date
    Jan 2004
    Location
    East Lansing, MI... Michigan State!
    Posts
    121
    Member #
    4678
    I am creating a header for a band of a friend and it is done in flash. They have small images of flowers in a circular shape and i was wondering with actionscript, how i could get them to float across the background of the header. All it has to do is go in the x direction... so maybe an if statement saying that if it reaches a certain _x value, then make the _x value decrease by one?? im not to good with AS, just trying to learn what to use. Thanks!

    P.S. what would be really cool is if i could get the object o randomly appear at a different _y position each time after it completes its cycle.

    using MX2004

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    This should work...

    frame 1:
    Code:
    object_name._x--;
    if (object_name._x < -object_name._width) {
        object_name._x = Stage.width;
        object_name._y = Math.floor(Math.random() * Stage.height - object_name._height);
    }
    frame 2:
    Code:
    gotoAndPlay(1);


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:24 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com