ActionScript 2.0 :: Resetting X And Y On Draggable Movieclips

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


Similar Posts:


ActionScript 2.0 :: Resetting Multiple MovieClips?

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

ActionScript 2.0 :: Resetting Movieclips Position?

Sep 7, 2006

I have a setup where a girl is holding a card on there are words on each card and as time goes by they fall to the ground. The problem I am running into is that the cards never go back into the loop of cards, once they are out I am just left with a blank card. How could I have it reset this?

Code:
//CLASS IMPORTS
import mx.utils.Delegate;

[code].....

View 1 Replies

ActionScript 3.0 :: Stop Movieclips From Resetting When Switching Sections In Main Timeline?

Nov 28, 2011

So I have 2 frames at main timeline, one named "Game" and one is "Menu", they are just a movieclip eash does its own thing. I am in the "Game" playing, I want to change settings so I go to frame "Menu"... when I am back to frame "Game", everything is reseted!! I soon realized this is what Flash has been doing and it's a good thing... But I really want to know how to by pass the resetting now...

View 2 Replies

ActionScript 3.0 :: Making Copied Movieclips Draggable

Sep 28, 2010

When you click on a movieclip in the menu, it is then copied and added to the container_mc movieclip.

My problem is that I can't figure out how to make the movieclips draggable once they are in the container_mc.

I tried the following as a test but its only working for the existing movieclip, not the new one like I want it to[code]...

View 2 Replies

ActionScript 2.0 :: Duplicating Movieclips & Making Draggable?

Apr 16, 2003

I am basically trying to duplicate a movieclip by using a button.. (no probs there).however, i want to drag each movie clip individually.. ( my brain froze)here is my butchered code..// graphic is the mc i wanna drag, n is the textfield that i want to count up.

on (press) {
addmore = "graphic" add n;
duplicateMovieClip("graphic", addmore, n);

[code]......

View 14 Replies

Actionscript 3 :: Render Horizontally Draggable List Of Movieclips For A Flash To Ios Project

Aug 2, 2011

ActionScript Mobile Project.

Flash to IPad.

I am using Flash Builder 4.5.1

I have a row of movieclips that I need to drag horizontally. there could be up to 300 clips. Each clip is 100 px wide. Each clip has different content/text and animations. the viewable area will be the stage.[code]...

View 1 Replies

ActionScript 2.0 :: Controlling Duplicate Movieclips - Communicate With Those Clips Specifically To Make Them Draggable

Aug 5, 2004

how to communicate with those clips specifically to make them draggable and also to change the _rotation with Key.Right, Key.Left.

View 7 Replies

ActionScript 2.0 :: Controlling Duplicate Movieclips - Make Draggable And Change The _rotation With Key.Right, Key.Left

Aug 5, 2004

I found the tutorial on duplicating movieclips, especially the line-by-line translation of the code. how to communicate with those clips�specifically to make them draggable and also to change the _rotation with Key.Right, Key.Left.

View 7 Replies

Variable Changing But Then Resetting

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

ActionScript 3.0 :: Variable Resetting Itself?

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

Actionscript 3.0 :: My Score Keeps Resetting

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

ActionScript 2.0 :: Resetting The Scrollbar?

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

ActionScript 2.0 :: Resetting Comboboxes?

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

ActionScript 3.0 :: Combo Boxes Resetting?

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

ActionScript 1/2 :: Resetting Operations In Particular Frame

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

ActionScript 1/2 :: Tween Class Not Resetting Y Value

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

Actionscript 3 :: Resetting Objects In Flash CS5?

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

ActionScript 2.0 :: Stop Animation From Resetting?

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

ActionScript 3.0 :: Resetting A Class Instance?

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

ActionScript 2.0 :: Sound.position Not Resetting

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

ActionScript 2.0 :: Resetting Movieclip States?

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

IDE :: Scrollpane: Resetting Scrollbar Position?

May 18, 2009

In my main .fla I have a scrollpane which opens an external SWF, inside this external SWF I have 5 frames, each with a 'Next' button at the bottom, the problem is when the user clicks the 'Next' button the the scrollpane doesn't change the position of the scrollbar, so essentially the user is looking at the bottom of the next frame. Is there any way to reset the scrollbar position from either the external SWF (linking to the main SWF), or with some code in the main SWF?

View 3 Replies

ActionScript 3.0 :: For Loop Counter Not Resetting

Jun 16, 2009

so I have a class method that contains a for loop ... however, each time I call the class method, the for loop counter continues to count from where it left off! Agh - the loop counter get's reset?

[Code]...

View 10 Replies

ActionScript 3.0 :: How To Stop A Variable From Resetting

Dec 9, 2009

I've got a list in a flash app that when an item is clicked it should add a number to a dynamic text field, my problem is that the variable I declare to store the number in either always resets to 0/ doesn't add the numbers or returns NaN.

The variable in question is

Code:
var totalNum:Number;

What I want it to do is add the numbers when a list item is selected, e.g. totalNum starts at 0, if item 1 is selected totalNum should now be 1, if item2 is then selected totalNum should be (1+2 = 3), instead the label just displays 1, then 2.

I've tried declaring the variable outside of the event, but that resulted in the label showing NaN, unfortunately (as far as my understanding goes) declaring it inside makes it a local variable which resets each time the event is called and I'm not sure how to get around this (I can't seem to get the syntax for global variables right)

An example of my code is:

Code:
list1.addEventListener(Event.CHANGE, ItemChange);
function ItemChange(event:Event) {
var Item = event.target.selectedItem.data;

[Code]....

View 2 Replies

ActionScript 3.0 :: Resetting A Countdown Timer To A New Value?

Jan 12, 2010

I made a ten minute timer that starts at 600 and counts down to zero. It displays the current count in a textfield called "textfield_time". Here's what it looks like:

Code:

var timer:Timer = new Timer(1000, 600);
timer.addEventListener(TimerEvent.TIMER, countdown);
timer.addEventListener(TimerEvent.TIMER_COMPLETE, termin);

[Code]...

I have a time pickup that floats across the screen now and then. When your avatar makes contact with it, you get extra time - say 15 seconds. I already have working code that detects the collision of the avatar and the pickup, but I can't figure out how to add functionality to reset the timer to give an additional 15 seconds. I tried:

Code:
timer+=15;

which doesn't work. But you already knew that (hey, I'm new at this!). Maybe some way to get the currentCount value, increment it by 15 seconds, then update the timer value with it?

View 8 Replies

ActionScript 3.0 :: Highlight/Resetting MC Button?

Jan 20, 2010

What I'm trying to do is highlight a movieclip button when it is clicked, and then remove that highlight when another movieclip button in the same menu is clicked.I think the problem is arising from the fact that the buttons temporarily highlight when rolled over. I have used the 'ROLL_OVER', and 'ROLL_OUT' event listeners to initiate the animation, so any attempt to keep the current button highlighted is quashed when the mouse is moved off the button.here is some of the code i have used

[AS]overview_btn.addEventListener(MouseEvent.ROLL_OVER , highlightMenu);
photography_btn.addEventListener(MouseEvent.ROLL_O VER, highlightMenu);
overview_btn.addEventListener(MouseEvent.ROLL_OUT, UNhighlightMenu);

[code].....

View 1 Replies

ActionScript 2.0 :: Flash8 Resetting MC's To Original Place?

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

ActionScript 3.0 :: Resetting A Drag And Drop Game?

Jul 14, 2009

I'm having trouble reseting a drag & drop game. It is a movie clip with two pages: start_pg and game_pg. On start_pg is a start button (start_btn) that goes to game_pg. On game_pg is button (end_btn) that goes back to start_pg. Both buttons share the same layer, so I made each invisible when not of its page. The game works fine, but when the end_btn is clicked, all movie clips that have been dropped, stay there.How can I go back to start_pg and reset all movie clips to their original starting point?
 
// start game pagestop();
end_btn.visible=false;start_btn.visible=true;
start_btn.addEventListener(MouseEvent.CLICK, goGame);
function goGame (Event:MouseEvent): void{ gotoAndStop("game_pg");}

[code]....

View 12 Replies

ActionScript 1/2 :: Radio Buttons Not Working After Resetting

Mar 22, 2010

I have a form with two radio buttons for each question.  Each question is in its own frame "Q1," "Q2," etc.  I also have a btn_Reset created to reset the form, i.e. reset all radio buttons and return to "Q1" frame.  All buttons work as they should, including resetting the radio buttons, however, once I reset the radio buttons and return to "Q1" to start over, the actions associated with each radio button upon clicking on them do not work.  Here's my code:
 
//Frame "Begin"
gotoAndStop("Q1")  //I also define my variables in frame "Begin"
//Frame "Q1"
rbtn_YESQ1.onPress = function():Void

[Code].....
 
//Once I return to "Begin" frame, my variables are reset to their initial value since that's where I originally defined them, and I go to "Q1" because that's what the code in frame "Begin" says.  Here is where I click on rbtn_YESQ1 again and even though the button does fill in, it does not attach btn_Reset to the stage as defined by rbtn_YESQ1.onRelease function.

View 13 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved