| Welcome to Brackenwood. We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| The Flies Component Won't Go Away!; I have flies where I don't need them... | |
|---|---|
| Tweet Topic Started: May 18 2005, 09:24 AM (173 Views) | |
| Ramiel | May 18 2005, 09:24 AM Post #1 |
|
Brackenwood Newbie
|
I'm using the Flies component (seen in Prowlies) in my latest animation, and it looks great where it is. Problem is, when the component is no longer in any frames and the movie goes on, the flies are still in the exported movie in the later parts, immobile. How do I fix this? (Using Flash MX, not 2004) |
![]() |
|
| Ramiel | May 21 2005, 10:37 AM Post #2 |
|
Brackenwood Newbie
|
Anybody? |
![]() |
|
| Mr. Jiggmin | May 21 2005, 10:49 AM Post #3 |
|
made of tulips
|
eeerrrrrrrrrrrrrrr....................... cover them up with something? Or maybe you can bump the alpha down to zero or set its _visible property to false. Sorry I can't offer you any real advice... I'm afraid I've never used Sham's component before. |
![]() |
|
| Ramiel | May 25 2005, 02:05 PM Post #4 |
|
Brackenwood Newbie
|
Nope, nothing. Nothing seems to be working. I can't cover them up because they appear in a spot where I need to have stuff. Is there anybody that can fix this??? |
![]() |
|
| KWarp | May 25 2005, 04:51 PM Post #5 |
![]()
Brackenwood Middleweight
|
Here's the problem. Anything you set up in Flash will have it's own place on the Z-axis, which determines which objects on the screen go in front of each other. However, when flash runs actionscript and objects are created at run time, they get their place on a seperate z-axis which is ALWAYS in on top of the normal one. Thus you can never cover up the effect and actually have to stop it. I have no solution. <(-_-)> |
![]() |
|
| Ramiel | May 26 2005, 05:50 AM Post #6 |
|
Brackenwood Newbie
|
Well, okay. That tells me what was happening, but is there anybody out there who has a solution?
|
![]() |
|
| chluaid | May 26 2005, 08:18 AM Post #7 |
![]()
Bitey's Daddy
![]()
|
Make sure you're using them in Flash MX 2004, also that you're exporting as Flash7 AS 2.0, and that you've got the latest Flash Player. Sham wrote code in there which removes the flies from the stage at the end of the scene, so it should do it automatically. If not, just go into the flies component and in the actions, make sure that the last line says:
The most important thing is to be sure you're using Flash MX 2004 and exporting as AS 2.0 (unless there's someone out there who can convert the code to AS 1) |
![]() |
|
| Ramiel | May 26 2005, 01:26 PM Post #8 |
|
Brackenwood Newbie
|
Well, I'm using MX, I don't have MX 2004. IS there any way to get it to work in MX? If not, than is there a way to modify the code for MX? And if all else fails, I'm scrapping them completely. Thanks for the help though. Any more? |
![]() |
|
| chluaid | May 26 2005, 03:34 PM Post #9 |
![]()
Bitey's Daddy
![]()
|
There's your problem then.. the code is AS 2, so I suggest heading over to the Actionscript forum and asking for help there. I'll move this thread there now and maybe someone can convert it for you. Don't worry... I'm sure someone will get it working for MX
If all else fails, when you've finished your movie you could download the trial version of MX 2004, export the movie with Actionscript 2.0. That'd do it. |
![]() |
|
| Vector | May 26 2005, 06:41 PM Post #10 |
|
Resident Actionscript Guru ♂
![]()
|
Hey mate! If you post the code here, I'd be more than happy to translate it for you
|
![]() |
|
| Squidclops | May 26 2005, 06:56 PM Post #11 |
|
Guy with a hat.
|
Maybe try giving the component an instance name then try removing it with unloadMovie() or something. That will work if the flies are children of the component. Or it should anyway. |
![]() |
|
| Ramiel | May 27 2005, 01:42 AM Post #12 |
|
Brackenwood Newbie
|
Okay, here's the script that's in the component... function flyInit() { this.speedX = Math.random()*speed; this.speedY = Math.random()*speed; this.onEnterFrame = flyMove; } function flyMove() { this._x += this.speedX; this._y += this.speedY; if (Math.abs(this._x-sX)>sWidth) { this.speedX = -this.speedX; this._x = this._x+this.speedX; } if (Math.abs(this._y-sY)>sHeight) { this.speedY = -this.speedY; this._y = this._y+this.speedY; } if (Math.random()<jitter) { this.speedX = Math.random()*speed-speed/2; this.speedY = Math.random()*speed-speed/2; } } function flyDie() { for (var i = 0; i<numFlies; i++) { var fly:MovieClip = _parent["fly"+i]; fly.removeMovieClip(); } } var sWidth = this._width/2; var sHeight = this._height/2; var sX = this._x; var sY = this._y; for (var i = 0; i<numFlies; i++) { var fly = _parent.attachMovie("fly", "fly"+i, i); fly._x = sX+(Math.random()*sWidth*2)-sWidth; fly._y = sY+(Math.random()*sHeight*2)-sHeight; fly.onEnterFrame = flyInit; } this._visible = false; this.onUnload = flyDie; A conversion would be great! Thanks! |
![]() |
|
| Mr. Jiggmin | May 27 2005, 08:10 AM Post #13 |
|
made of tulips
|
I think the only thing in there that is incompatible with AS 1.0 is the line that reads:
try taking out the ":MovieClip"
I never did much coding when I had flash MX, so I'm not to sure weather or not there's anything else in there that would cause problems. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Actionscript · Next Topic » |









12:27 AM Jul 12