ActionScript 2.0 :: Resetting Objects To Their Original Location?
Sep 2, 2009
I am making a presentation where the user can click and drag cubes around the stage. I was wanting some kind of reset function where the cubes would tween back to their original co-ordinates rather than just jumping back to frame 1 when they were all in order.
View 2 Replies
Similar Posts:
May 16, 2009
Right now I am in the beginning stages and I have it set up so you can drag different sounds to the timeline (in the game, not in flash) and it'll snap in place which works perfectly.
But here's my problem: When I try to click the reset button the sounds snap to their original places (which sounds good right?) but then they tween back to where you dragged them on the in-game timeline.
I have put in various codes and no matter what I try, when I click the reset button, they always go back to where you dragged them to the timeline, making the reset button pointless.
Here's my code on the Flash timeline:
Code:
function dragSetup(clip, targArray) {
clip.onPress = function() {
startDrag(this);
[Code].....
I know, I know, that whole s(N) thing is very beginner but I didn't know what else to use, and it worked fine.
View 1 Replies
Jan 27, 2011
I have the code below and am trying to set up a "reset" button that takes all the buttons back to its "up" state or original state. And I can't seem to get it to work. The last selected button remains in its "down" selected state.
This the code that sets up the buttons' up/down/over/out states:
var selectedButton:MovieClip = null;
setupButton( one_btn );
setupButton( two_btn );
setupButton( three_btn );
setupButton( four_btn );
[Code] .....
View 10 Replies
Dec 11, 2010
I have a movie clip for each piece of clothing that will be used to attach on the dog. These movie clips click and drag to add clothes onto a target and it automatically resets back to its original position each time you grab a different selection of clothing. All of my objects go the original position except for one. The "julyDress" movie clip automatically pops up to the top of the page and does not reset to the original position.
Below is my code:
stop();
var startJulyXPos:Number = JulyDress.x;
var startJulyYPos:Number = JulyDress.y;
[Code]......
View 1 Replies
Mar 16, 2011
I'm making a simple platform game in Flash CS5 and Actionscript 3.0. When the player loses all their lives, I want it to redirect the player to a "Game over" screen where they can select a "Try again" button to restart the game.
Set everything (player, background, etc) to visible = false
Set "Game over" movie clip to visible = true (it is invisible during gameplay)
Have the button in the "Game over" movie clip hide the movie clip then re-show all the gameplay elements.Reset position of player to start, set score to 0, lives to 3, etc..It's probably not a very good way of doing this but if it works, then I'm happy. I just want the "Game over" screen to show briefly and if the player clicks the "try again" button, they can play from the start.
Now, the problem with my implementation of the above is that when I set all the gameplay elements to visible = true after having them set to false, the game has stopped.. keyboard input doesn't reactivate and the game elements are shown but aren't active. Is there something about the visible attribute I don't know? Does it mess with the "state" of an object? Here's some snippets of code from the Actionscript file...
if(lives >= 0) {
//print number of lives
}[code]..........
View 2 Replies
Jan 3, 2011
I am trying to recreate an effect like the clouds on[url]...I would like to be able to click and drag on an object then once mouse is released the object would dynamically return to start position. I am struggling to get my script (AS3) to dynamically return it to original location.
View 1 Replies
Jan 3, 2011
I am trying to recreate an effect like the clouds on [URL] I would like to be able to click and drag on an object then once mouse is released the object would dynamicly return to start position. I am struggling to get my script (AS3) to dynamicly return it to original location.
View 2 Replies
Jul 6, 2011
I'm doing a simple rotation on a sprite but there's a weird behavior where the sprite does not rotate around it's top left. I think I'm rotating along the top left of the test class instead of the sprite child. I would like to rotate the rectangle around it's top left corner (kinda like a clock hand). The code is pretty short so I'll let the code + pictures explain my problem:
package
{
import flash.display.Sprite;
[Code]....
I've read a lot of stuff about rotating around a fixed point, I've tried doing it with movieclips instead of sprites, I even copy pasted a tutorial on rotation and nothing works.
View 3 Replies
Sep 28, 2009
I'm trying to create an application that will allow searching of a database and create resulting movie clips on the stage. Is there a way to select all the movie clips that fall within a certain region of the stage?
View 10 Replies
Feb 15, 2011
When running a flash application that I run locallyie I get to it from a browser but with a file pathNow, most of the time the shared objects are stored in%APPDATA%MacromediaFlash Player#SharedObjectsXXXX#localWithNetBut occasionally, it reverts and thinks this application is running on localhost%APPDATA%MacromediaFlash Player#SharedObjectsXXXXlocalhostwhich means all previous saved settings are gone.I'm wondering if anyone knows how flash decides if the application is infact localhost or localWithNet (local with Network access)
View 4 Replies
Dec 23, 2009
I have an object inside my flash file and i want to lock the object on 0 x-axis 0 y-axis but when i re-size my SWF file my object's location changed to another location how can i fix that?
View 1 Replies
Jul 3, 2011
When running a flash application that I run locally i.e., I get to it from a browser but with a file path
file:///C:/Projects/test/bin-debug/Main.html#
Now, most of the time the shared objects are stored in
%APPDATA%MacromediaFlash Player#SharedObjectsXXXX#localWithNet
But occasionally, it reverts and thinks this application is running on localhost
%APPDATA%MacromediaFlash Player#SharedObjectsXXXXlocalhost
Which means all previous saved settings are gone.
How flash decides if the application is infact localhost or localWithNet (local with Network access). Rebooting can sometimes make it revert, but I've also had it stay localhost for a few days then revert.
View 1 Replies
Aug 7, 2009
I've put together this simple code for an SWF with three roll over images (called: Training, Resources and Contact).When I roll over Training I would like the symbol Training_txt to tween its alpha to 1 (from 0) and tween its y axis to 220 (from 83).When I roll out of Training I would like to run the two tweens in reverse.
This works fine for each of the three roll over images, so long as each tween is allowed to fully execute before a new tween is started. The problem arises if i quickly move the mouse curser between the three roll over images before the previous tweens have finished executing.In this instance, the tweened objects start to behave erratically. They usually return to their original position as per the roll_out tween but then start jumping between y axis 200 and y axis 83 (without tweening - they just appear).
Code below -
stop();
import fl.transitions.Tween;
import fl.transitions.easing.*;[code]..........
View 1 Replies
Apr 27, 2009
I am trying to make an object tween from its starting location to the location of a mouse click. I have a script, but it has a very annoying ease to it.I would LIKE the object to mantain a certain speed during while traveling from its starting location to the mouse click location.
View 16 Replies
Aug 21, 2011
I created a simple button that displays an error messeage: "error opening 'url" when I test the movie, but does play and opens in browser after publishing. However, it won't open in the browser in a different location. I pasted the html code in a web page but it doesn't work there nor opens in the browser in a differnet location from where it was originally published and saved. Why is that?
View 13 Replies
Feb 16, 2005
How can I move my MC from one location (x, y) to another location (x1, y1) wirh action script..?.. and I would like to have my motion tween rounded to (x,y) so it will look sharp.
View 8 Replies
May 25, 2011
I'm very new to Flash, but I have been learning loads and getting some good results so far. Browsing these forums has been a massive help. However today I have hit a problem in what should be almost the simplest line of code I know how to write (variable = x), and could do with some advice. I have a simple program containing a button which will change a variable when pressed. There is also a text-box that will output that variable. However when I press the button, the variable will change, but then immediately revert to it's previous value.
[Code]...
View 3 Replies
Jan 1, 2011
I made a simple class that's keeping a history of strings, updating it with a push() method (like an array) and with a possibility to navigate with next() and previous().Therefore my class has an array and a integer indication the current position in the array. (See full code below)Now something very strange is going on. When coming into the push() method the position variable has some value, which I can change, but everytime I try to read that variable, it gives me a 0. I've never had this kind of problem before and I simply cant find out what's wrong.The push() method
ActionScript Code:
public function push(entry:String):void [code]......
View 3 Replies
Jan 14, 2010
I have a character on the stage in my fla that when hitting a particle created in an a particle.as removes the particle. I have the code for removing the particle and also a score counter that adds one everytime a particle is removed (located in my particle.as). My problem is the score keeps resetting or I get sporadic results (not sure which) for example here I traced the results[code]...
View 1 Replies
Mar 11, 2004
How do you reset the scrollbar in Flash? (I'm using the component, not a cusom scrollbar.)If you go here, scroll ALL the way to the bottom and then click on "Donations" - you'll see the scrollbar stays in place.How do I get it to refresh each time new text is loaded? I've tried refreshPane() and a few other things, but nothing works.
View 7 Replies
Jul 16, 2003
How do you reset combo-boxes?I have this form with combo-boxes and input textfields, and I want a button that can reset the form.The input textboxes are easy:TextBox1.text = "";
View 5 Replies
Jan 26, 2009
I have created a menu for an online café. The displayarea is limited, so the menu items need to scroll within a frame ofsome sort.
View 4 Replies
Nov 6, 2009
I've created a application where the viewer could change colours, add text, add logos, rotare them, etc... How do I create a reset button which resets everything to back normal in a specific FRAME? What functions do I have to use?
E.g.
Frame 5 is used to Add colours and text, etc...
Frame 10 is used to Add logos,scale them, rotate them, etc...
I need a reset button in Frame 5 to make only the things which were changed back to normal.
View 1 Replies
Jan 11, 2011
I am trying to move a movieclip down using Actionscript. Then when a user fires a back event [which is successfully firing] the movieclip is then required to go up again. The code is:
trace("fholder _y org: " + folioholdermc._y);
// THIS COMES OUT TO BE -601
var yDown1:Tween = new Tween(folioholdermc, "_y", Bounce.easeOut, -601, -449, 3, true);
trace("step 1 called");
trace("fholder _y down1: " + folioholdermc._y);
[Code] ......
View 3 Replies
Feb 3, 2009
I've got 6 draggable movie clips that snap to a target - which works fine. If they don't hit the target area they snap back to their starting point- which also works fine.
My problem is that they can all be dragged to the target one after another, but I only want one movieclip to be at the target at any one time.
So,when I start dragging a new clip toward the target I want the movieclip thats already on the target to reset itself to it's starting position, thus being replaced by the incoming clip.
I want this to happen for all the draggable clips.
function dragSetup(clip, targ) {
clip.onPress = function() {
startDrag(this);
this.beingDragged=true;
[Code].....
View 3 Replies
May 22, 2010
I'm making a flash game. when i open the dresser drawer, then leave, then come back the drawer is closed.
how can i make it so when i come back the drawer is still open?
View 1 Replies
Dec 29, 2010
im creating this game. I have a main class, which I use to call the menu class and the actual game(board) class.
I got the game working, but now when I try to reset the instance of the board, it doesnt actually execute the constructor again. So I get a fresh board, but the variables aren't reset.
ActionScript Code:
public function Resetboard(event:Passboolean){
board = null;
board = new Board();
application.addChild(board);
}
View 9 Replies
Jan 24, 2011
I've created this simple birthday game where the concept is to blowout 30 candles in 15 seconds.The candles are movieclips so that when they are clicked on, they blowout. However,when the option to "try again" begins, the candles are still out.
View 9 Replies
Oct 25, 2005
Just to start off, this isn't exactly an inquiry to a problem. It is moreso of a posting of a bug (or assumed bug) in the Flash player and how to get around it. Though if anyone else has a better method then share. Ok, well I very rarely ever work with the Sound() object in Flash, and I found myself working with it today. I was having a problem and I could not pinpoint it for the life of me.... my code appeared correct in every aspect.
After tracing many sections of my code to find out where it was going wrong I realized... that for some reason when you use Sound.stop(), the Sound.position doesn't get reset... it instead just increments from where it left off. This is quite annoying. And being that Sound.position is a read only property you can't reset it yourself. The only solution I have found for this is to delete or overwrite your Sound() object with a new Sound() object. Anyone know if this is indeed a bug, or if there was some reason Macromedia did it like this?
View 9 Replies
Jan 16, 2006
I know there are similar questions here that have been answered, but after trying to make sense of it, I still can't get this to work.Based on an array, I attach a number of MovieClips from the Library.On release they go to a certain frame, representing the "pressed" state of the button.The problem is, that I can't figure out how to reset the last pressed button back to it's original state...Here is the Actionscript code I have so far:
ActionScript Code:
stop();
daCap.play();
scrollUp._visible = false;[code]......
View 5 Replies