Script_Goo_Roo
12 posts
|
Topic: Programming /
define a class in AS3
I am looking for a simple definition or explanation of a class. I am trying to figure out how to use them fluently and understand how it is done.
ex.
how items are passed back and forth.
how classes allow for addChild methods to be called without interference with another child.
thank you
Script_Goo_Roo
|
| |
Script_Goo_Roo
12 posts
|
Topic: Programming /
loader not working properly
I am using a Loader to load a previously made .swf. my code is as follows.
var my_loader:Loader = new Loader();
my_loader.load(new URLRequest(“truck_movement.swf”));
addChild(my_loader);
my_loader.x = btn.x;
my_loader.y = btn.y;
in the swf i have a previously made game that allows the player to pump concrete out of a truck. In the original .swf everything works great and there are no problems. However when i load this .swf into my .fla the concrete that is suppost to look like it is pumping out of the end of the truck pumps about 100 pixels to the right and down from where it is suppost to pump from.
any suggestions as to why it is doing this?
|
| |
Script_Goo_Roo
12 posts
|
Topic: Programming /
flash file won't test
I started copy and pasting all of my movieclips over to another file and found out that somehow a couple of my movie clips got changed and where 100% different than when I last saved.
I can’t really post a screen shot. When I test my movie it shows that it is exporting the file to play but when the progress bar fills up it does nothing. The progress bar basically vanishes and i am back to the same screen i was at when I pressed CTL+Enter or went to control -> Test Movie.
|
| |
Script_Goo_Roo
12 posts
|
Topic: Programming /
flash file won't test
after re-installing flash, it still doesn’t seem to work. It won’t publish nor will it allow me to test the movie.
any suggestions?
if i can’t figure anything out I am going to try and rebuild the site in a new file
|
| |
Script_Goo_Roo
12 posts
|
Topic: Programming /
flash file won't test
When I debug the file or I preview it as a flash file it gives me an error in the output not the compile box saying that it can’t find the URL even when the URL is in the directory.
any suggestions?
I am going to re-install CS3 now to see if that will resolve the issue
|
| |
Script_Goo_Roo
12 posts
|
Topic: Programming /
flash file won't test
I am working on a flash website and up until today I have been able to test my movie and it works fine.
Today I added new content to a page, which was simply 12 buttons, and now when I press control enter or go to control and click test movie the dialog box shows up that it is exporting the movie but after it finishes exporting nothing happens.
Is there an issue with the settings that got changed or is this a bug and I must simply re-install CS3?
any suggestions?
|
| |
Script_Goo_Roo
12 posts
|
Topic: Programming /
Button Inside MovieClip
I have multiple buttons inside my movieclip. My actionscript is as follows for the first frame of the stage.
gotoAndStop(1);
Conveyor.Home_Page.addEventListener(MouseEvent.CLICK, HomePage);
function HomePage(event:MouseEvent):void
{
trace(“BulkTrans”)
gotoAndStop(“BulkTrans”);
}
What i am doing is stopping the main stage at frame one and letting my movieclip play through. Inside the movieclip is where all of my buttons are located.
I have tried taking one of my buttons outside of the movieclip and putting it on the main stage. It works if I do it that way. My question is this:
1. Is there something I have to do when referencing my button inside the movielcip?
2. Is this even Possible to do?
3. should I use onClipEvent()?
Script_Goo_Roo
|
| |
Script_Goo_Roo
12 posts
|
Topic: Programming /
Help! Movieclip inside Button
I ran into the same issue today. I resolve it by going to publish settings and clicking on the “Flash” tab and then i noticed that my Omit trace actions radio button was checked. By simply making sure it is not checked resolved my issue. That might be able to resolve “your” issue.
Hope it helps
|
| |
Script_Goo_Roo
12 posts
|
Topic: Programming /
Many Nested Movie Clip's X and Y coordinates
Okay I am trying everything I know possible to get this to work and I appreciate your patients so far.
My code is as follows for the space KEY Event:
if(spaceKeyIsDown == true)
{
var point:Point;
var innerArm:MovieClip;
innerArm.x = this.Truck.A4.A3.A2.A1.A5.x;
innerArm.y = this.Truck.A4.A3.A2.A1.A5.y;
}
point = new Point(innerArm.x, innerArm.y);
innerArm.localToGlobal(point);
trace("The Co-ordinates are at " + point);
spaceKeyIsDown = false;
I have tried multiple things for the innerArm part:
innerArm = Truck.A4.A3.A2.A1.A5;
innerArm = Truck.A4.A3.A2.A1;
innerArm = Truck.A4.A3.A2;
innerArm = Truck.A4.A3;
innerArm = Truck.A4;
innerArm = Truck;
I have even tried to see if it would change if I changed the trace part to see what kind of results i would get.
trace(“The Co-ordinates are at ” + innerArm.x + ”,” + innerArm.y);
trace(“The Co-ordinates are at ” + point.x + ”,” + point.y);
I understand what you are saying and I don’t know why I had my code at CIC_Truck.localToGlobal(point); but it seems as though i am doing everything correct up to this point as you explained and still no correct results. When I have the innerArm point to Truck.A4.A3.A2.A1.A5 I believe it is giving me the co-ordinates or position of the final arm at its starting point. Even when I move the truck around the stage and the arm around the stage it never changes. I also had my innerArm pointing to Truck.A4.A3.A2.A1.A5 without the this.Truck…. . Do you have any suggestions as to what I should do … besides break my computer in half?
Once again I appreciate all your help so far!
Script_Goo_Roo
|
| |
Script_Goo_Roo
12 posts
|
Topic: Programming /
Many Nested Movie Clip's X and Y coordinates
Can you give me an example of what you are talking about. I am not sure I am grasping what you are saying.
If I want another instance of a concrete movieclip to show up at the end of the boom (being the fifth arm or A5) would I write my code as follows?
concrete.x = Truck.A1.A2.A3.A4.A5.x;
concrete.y = Truck.A1.A2.A3.A4.A3.y;
or another way I have tried which I am not sure but it sounds as if it is the way you are wanting to me to attempt this is …
concrete.x = Truck.x + Truck.A1.x + Truck.A1.A2.x + Truck.A1.A2.A3.x + Truck.A1.A2.A3.A4.x + Truck.A1.A2.A3.A4.A5.x;
concrete.x = Truck.y + Truck.A1.y + Truck.A1.A2.y + Truck.A1.A2.A3.y + Truck.A1.A2.A3.A4.y + Truck.A1.A2.A3.A4.A5.y;
If neither of the ways I have provided is the way you are describing, then can you please give me an example of what you are trying to tell me?
Script_Goo_Roo
|
| |
Script_Goo_Roo
12 posts
|
Topic: Programming /
Many Nested Movie Clip's X and Y coordinates
I tried this and the co-ordinates of the movieclip stay the same even after the user moves the boom of the truck.
Okay, so the truck is a Concrete Putzmeister Truck that has 5 extension arms on it. The user is able to move each individual arm by itself and after moving it the arm will now be away from the truck and in the air of a location the user chooses. At this point the truck is not able to move at all; however, the user can still move the arms wherever they please with the restriction of the area of the truck.
So to wrap up, the boom on the trucks are able to be in a different location that just on the back of the truck. The user can move them whenever they please and when they are moved they are away from their original location. This is where the problem lies. The co-ordinates of the boom at start are, lets say 76.2, 1.75, and after the user moves the boom the co-ordinates should change but they do not. they are still the same co-ordinates of 76.2, 1.75. That is the issue.
Any Suggestions as to finding the exact co-ordinates of the boom after it has been moved?
|
| |
Script_Goo_Roo
12 posts
|
Topic: Programming /
Many Nested Movie Clip's X and Y coordinates
All:
I have looked through the recent posts in this site and found that the discussion of nested movieclips has already been discussed. However, I am working with a different approach of a nested movie clip I believe.
My initial movieclip has 5 other nested movieclips inside it. I am trying to find the X and Y coordinates of my last nested movieclip. The reason being is that I want the user to be able to press the spacebar and concrete, bullets, ect. will come out from the x and y coordinates of the movieclip.
The game I am working with has a concrete pump truck that allows the user to move the concrete booms around in any position they want. The goal is to get the final boom of the concrete truck to shoot concrete into the correct job site, which will then give the user points, and leveling, ect.
I have read on other posts and saw that by doing:
var point:Object = {};
point.x = CIC_Truck.Arm_Four.Arm_Three.Arm_Two.Arm_One.Arm_Five._x;
point.y = CIC_Truck.Arm_Four.Arm_Three.Arm_Two.Arm_One.Arm_Five._y;
CIC_Truck.localToGlobal(point);
trace(“Converted co-ordinates are ” + point.x + ”, ” + point.y);
I am able to find the coordinates; however, when I do so I receive an error:
1118: Implicit coercion of a value with static type Object to a possible unrelated type flash.geom:Point.
My question is:
1. Is localToGlobal my only option to make this work?
2. Is it possible to make this work?
3. If possible, how will I find the x and y coordinates of my final nested movie clip at any given time (even after the user has moved it and it not has new x and y coordinates)?
Please be understanding, I am new to actionscript and I am just trying to get my feet wet.
Any Suggestions?
Script_Goo_Roo
|