SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2003
    0 Post(s)
    0 Thread(s)

    MX perspective & load movie issues

    I am trying to create a starfield effect. I have gone through the tutorials here and elsewhere and come so far. I am attaching the fla file along with the code.

    The motion as you can see is jerky. Cant figure out what am i doing wrong. I had a look at every conceivable stuff available. The catch in my problem (i think) is that the starting point is inside the screen which emulates the perspective effect. Other stuff like snow flakes ,etc are 2D effects and can start of out side the screen.

    I tried to set _alpha = 0 at the duplication point and then make it brighther as it enlarges but still of no use.

    I created the duplication process into a function and tried to call it through the onenterframe event handler of the instance star - but that was horrible. felt like my televeision screen gone bad.

    isnt there a way that I can check at the star coordinates and set it to its original position if it goes beyond the screen limits. I tried to add that code earlier but it wouldnt work. I guess i must have been using the wrong conditions.


    Another thing. I am trying to load this swf into a main movie using the following script:

    movies._x = 227;
    movies._y = 145;
    movies._width = 250;
    movies._height = 245;


    However the the stars in the child movie do not respect the width and height restrictions. So I have those stars running all around the place in the main movie. Is there a way to curtail these stars besides using a mask (actually havent tried the mask so far, but i am assuming it would work)
    Attached Files Attached Files

  2. #2
    SitePoint Evangelist dalangalma's Avatar
    Join Date
    Aug 2002
    0 Post(s)
    0 Thread(s)
    Well, all that alpha can really slow down a movie... try just duplicating the stars into the starting point and then scaling them instead of changing the alpha. And yes, you can just loop through all the star objects and check their _x and _y properties to see if they've gone beyond the screen. Don't bother returning them to the start though, just use removeMovieClip to kill them, and make new ones at the start.

    As for your other problem, unless you're removing stars based on their position, you're gonna need a mask. But it's a good idea to get rid of the stars once you can't see them, since they take up memory and such.
    Web Design:
    Free Web Design Resources and Software:


Posting Permissions

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