ActionScript 2.0 :: Movieclip Move In Drawn Square?
Oct 7, 2009How would it be possible if draw a square, then put movieclip to move in it. It would move when rotate another movieclip..
View 0 RepliesHow would it be possible if draw a square, then put movieclip to move in it. It would move when rotate another movieclip..
View 0 RepliesI would like to change backgroundColor of an drawn object(square) by mouseover. I acutally found the function for mouseover in action scripts but BackgroundColor("#ccc") does not work.
View 3 RepliesI have a square that is a button symbol. There is a cirlce that is a movie clip symbol. I assigned the following actions to the button
on (keyPress "Left") {
currentX = this._x;
this._x = currentX - 2;[code].........
For some reason, the square and the circle both move. how can i just make the block move and not the circle.
note: the <> symbols are not put surroundin the key names
when creating a dynamic square with the api. 400 by 400. I am not sure why it wont draw the object
[Code]...
I have this game, and some levels have a moving square as the player, you move the square with your arrow keys.... I want to have an enemy square that chases the player square.... They only chased mario when you didn't look at them? Kinda like that...... but in this regards:
I only want the enemy square to chase the player square when the player square moves.... soo say the player square moves 5 pixels per movement (know how to do all that), I want the enemy square to move when the player square moves..... towards the player square at like 7 pixels per movement..... so eventually you won't be able to avoid the enemy square....
I am messing around to learn more about actionscript and I am trying to have a square movieclip resize itself so both sides are equal to 50 here is my code on the movieclip it does the resize and all but it keeps on going. I am not sure how to stop it.
[Code]....
If i draw a movieclip on a frame (root) as such:[code]This will draw a simple square from position 20,20 on root. Now if i trace penName_mc._x i would expect it to give me the distance from the root origin i.e. 20 however it always produces 0. My questions are:
1- Why doesnt it consider x as 20?
2- Is there no way to determine the x of this newly created movieclip from the origin? (besides drawing from 0,0)
I have a movieclip that I am using greensocks transformManager with so the user can rotate, skew, and scale the clip. This works fine, but I am trying to add a crop tool. If the image is rotated, when I send the image to the crop tool it measures the height of the image by the bounds of the rotated image, not the actual height of the image if it were square (re: not rotated).
So, what I tried to do what, after sending it to the crop tool, rotate it back to 0 before getting the bounds using this code:
[Code]....
I don't understand the math here. Shouldn't it just rotate 3rads in the positive direction to equal it out? How would I return it to 0;
I am trying to draw a triangle and square using a movieclip that follows the pen of a line.It works, both triangle and square draw together. But I keep getting a flicker of a movieclip in the top left corner.
View 0 RepliesI'm stuck with trying to target a movieclip dynamically from a loop. I'm using the square brackket syntax but I can't figure out why it's not working. Here's what I'm trying to do:
Code:
this.t1.t1._alpha=20;
And here's how I'm trying to do it:
Code:
this["t"+1+".t"+1]._alpha= 20;
hey guys, so, im going through colin moock's book, "the definitive guide", and im learning about global variables. so in his lesson he says to do this:
1. create a movieclip called square, with a square inside of it.
2. in the square mc's timeline, on frame 1, place this code :
_global.day = "tuesday";
3. go back to the main timeline and on frame one put this code:
trace(day); no according to moock, when i run the movie, it should output "tuesday", but all i keep getting is "undefined".i'm running mx 2004, so im wondering if that has anything to do with it.
I am having a problem getting color value of MovieClip's color on stage. This movie clip contains simple colored square drawn by Rectangle Tool.[code]...
View 0 RepliesI have some text placed on the 'canvas' in Flash. I also draw some stuff in an onEnterFrame function on the main timeline. The stuff I draw in the onEnterFrame gets placed behind the text I have on the canvas. I'd really like to have the stuff I draw in front, but I don't know how to accomplish this.
View 1 RepliesI am using an external custom class to draw xml driven shapes in a movieclip. take a look at [URL] for a better idea of what I am working on. I am looking to turn each shape (which would be a booth) into a button...so that I can click each booth and have some info come up about it. I am having a hard time calling the array from the main movie.
View 1 RepliesHow can I make an extrusion for a red square movieclip in flash or as3?
View 4 RepliesI have a circle_mc on the stage. Then I create randomly placed 20 squares (square_mc) on the stage. I can move my circle on that stage, and all I want is to check hitTestObject(or any *yet unknow for me* method that gives a result) if circle touches any of squares. Then I need to remove that touched movieClip (square) from the stage. hitTestObject checks if 2 specific objects are touched. My question is how to know which square is which, and then if it touches with circle_mc to remove it from the stage.
Code:
Select allif (circle_mc.hitTestObject( ?whatHere? ) ) {
?whatHere?.removeChild( ?whatHere? );
}
I'm making a program that lets the user draw shapes on the screen with the mouse. When they're done they press a button to finish. The user is only allowed to draw on a certain area of the stage, to control this on the timeline i have a movie clip that takes up all the space the user isnt alowed to draw in.When the user presses the button i want the programe to check that the shape the user drew isnt touching the moiveclip. I want it to do this without taking the border of the movieclip into account so i cant use hitTestObject()
heres what i have so far:
//------------------------------DRAW SHAPE------------------------------
private var shape:MovieClip = new MovieClip();
[code]....
I have a square movieclip named squarepad. What I want is when I click on it to do [some stuff] according to where the square is clicked. It should be something like this:
if ([mouseclickedx] > 1) and ([mmouseclickedx] < 10) then
[do this]
end if
Inside movieClip container, there are colored buttons on layer1 and on layer2 there is movieClip square which covers the buttons. I want to use the color efffects and blending options of movieClip square to make layer 1 alpha. There are some blending options called alpha, difference, lighten and substract but Im not getting the right combinations. I want to make layer1 alpha only by using layer2.
View 1 RepliesOkay I have a script in which I have added an image to the stage. It is absolute centered. I then have another with is on top but much bigger. I would like the big image to move opposite of my mouse position on the smaller image. ie: cursor is on bottom left corner the bottom left corner of the larger image is in the same spot. And the same thing for any other area.
I have tried many different ways but to no avail. I have done research but no one has been able to give me a solid answer. Anyone know of a way to accomplish this. Keep in mind this it needs to work regardless of the image size.
I load an image into a MovieClip. At a second time I want to move this image to another MovieClip.
View 1 RepliesI'm trying to make a movieclip move slower at a certent place in my movieclip. This means, that the speed needs to be lowered when e.g. showing af picture. Here is the situation. I have a movieclip running different pictures. E.g. the first runs for 115frames and fades out. Instead of runing 115 frames i want the movieclip to run 5 frames (picture fading in) and the stops or delays for 10sek and then goes to frame 6 from where the picture fades out. Where in the movieclip should i place this Action Script?
View 1 RepliesI am looking to move a movieclip (person) towards another movieclip(ball). I can do that fine but the ball is constantly moving and that gives me a lot of trouble.
View 6 RepliesThis may come across as beginner stuff: I'm working In ActionScript 3.0. I have a MovieClip called FloorStatusChanges and within it are two MovieClips called Floors and StatusChanges.The MC called Floors contains Three wireframe-looking floors(each floor has it's own MC).The MC called StatusChanges contains three buttons that have the Instance Names of FirstFloorButton, SecondFloorButton, and ThirdFloorButton.Within the FloorStatusChanges MC, I've set up a motion tween for these wireframe-looking floors to move into and out of the stage so that upon clicking one of the buttons in StatusChanges it would, in theory, cause this motion tween to happen. It has stop(); commands between every motion:Within the StatusChanges MC, there are 4 layers. 3 are for each button consecutively and 1 for the Actionscript. This is how they look:Here's the set of actions I've given for the first frame:
ActionScript Code:
SecondFloorButton.addEventListener(MouseEvent.CLICK, SecondFloorSelect);
function SecondFloorSelect(e:Event){
[code]....
I have made a movieclip and gave the frame this actionscript:
------------------------------------------------------------
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {[code]........
it moves fine and stuff but i was wondering how can i restrict the area in which the movieclip can actually move ? my flash file is 550px X 400px and i want to make it so that it can only move in 300px X 200px of the file if you understand ?
On the default page, I have scattered photos. Once "Clothes" is clicked, it contains a page flip. When the page flip is loaded, I would like for the scattered photos to hide. If this can't be done, then the page flip should be on top of the scattered photos. Right now it's not doing either. Reference: [URL]
View 15 RepliesI am working on an animated menu, and I have the animations for the submenus about how I like them. The only problem now is that you can work the menu in such a way that sometimes two menus are open at once. What I need as a solution is a bit of ActionScript that would work something like this on a button for Menu A:
on (rollOver) {
if Menu B or Menu C are at frame 15 (this is where the menu is fully expanded),
then have that menu gotoAndPlay(20) (where it will play till 25, clearing out the submenu).
}
I want to make a line, convert it to a movieclip and then put some as3 code that does this:When moving mouse only top of line follow the bottom of the line is always in its original position.
View 6 RepliesI got a movie clip, by motion i could able to move(motion) that around my stage.(500x350), but the same thing i need to do by actionscript.
View 3 RepliesIf I had a movieclip (_root.mc1.blah) and wanted to movie it to (_root.mc2) so I would end up with (_root.mc2.blah)
View 1 Replies