ActionScript 2.0 :: Reset Object To Default Position?
Jun 1, 2010i wanted to make an object to reset to the default position, like i move it around and when i hit a button he goes to his position for example x: 233 and y:431
View 1 Repliesi wanted to make an object to reset to the default position, like i move it around and when i hit a button he goes to his position for example x: 233 and y:431
View 1 RepliesI used this tutorial to make an accordion for my website and I am trying to figure out if there is a way to make it reset to default when you mouse off of the accordion any help would be greatly appericated
View 4 RepliesI have an array of movie clip instance names:
[Code]...
What I want to know is how I would go about making them all their default colors when you hit a movieClip instance that acts as a reset button. I can't seem to get it.
ok - i'm totally confused here... this is probably a stupid noob question... just recently got flash 8 - upgrading from mx2004, but had previously been using flash 6 components and AS1, due to files that had already been written in mx... my problem is this - i have a dynamic text field, populated with data from a LoadVars object. When a button is pressed, different data is loaded into the text field, and the scrollBar is supposed to reset to the top (position=0)
[Code]...
I am trying to call a sound to play whenever the UP key is down. I want the sound to stop and reset to position zero when UP is released. Everything works except the sound will not reset to 0. Here is what isn't working:
if(Key.isDown(Key.UP)){
if(sound.position == 0){
sound.start(0,0);[code]....
When ran, the program plays the sound once, and will never play it again because I can't get the sound.position to reset to 0.
I have a moviclip duplicating 200 times and rising off the top of the screen. When it moves completely off the stage, and I want it to move back to the bottom of the screen and rise up again. Right now it just keeps going up off the stage and doesn't replace itself.Here is my code on my movieclip:
[code]...
I know this is a dumb question, but it would've taken me forever to search through all the rest of the posts regarding Scrolling Text boxes. So I have text scrolling in a dynamic text box. Buttons control it's movement, up and down with (scroll --) and (scroll ++). Let's say I read to the bottom of this text, and then load a new file into this same box. When I do this, the new text is scrolled to the bottom. My Question: How do I reset the scrolled position back to the top for each new file that I load??
View 6 RepliesI'm trying to get the handle on a slider to reset to its original position whenever the frame is changed.
View 2 RepliesI'm trying to make some manual transitions. Because I don't know AS3, and I'm building this from the help of Google, I've started with a simple "blind" transition just to figure out the works.
The issue is that when I expand the width, it seems as though all my AS3 created sprites seem to reset their x position, and sit on the left. That or 15 of the tweens aren't working.
Here's the code:
ActionScript Code:
function vBlinds(){
var tweens:Array=new Array(16);
[code]....
i'm trying to zoom in on a picture at the specific spot where the mouse is clicked. ie if the mouse is clicked in the lower left corner, the pic gets bigger from there, not the center of the pic. the only way i can think of to do this is to reset the registration point to the clicked position. is this possible? is there another way to go the job done?
View 12 RepliesI'm using the dynamic scroller found on the kiropa site found here [URL]..In the action script on the ScrollBar, I can't find what variable to change to reset the position of the bar to the top of the scroller when I use the same dynamic text area for other content. It loads just fine, but if the scroller was left at the bottom, it stays there on the new text until you move it a bit, then the text catches up.
I'm hoping to find the variable and reset it when the new text loads.
I've got 3 pages each with their own portfolio loaded dynamically from an XML file. Everything is working great with the thumbnails i added using the "adding thumbnail" tutorial. There's only one quirk I can't figure out. If you've scrolled to the end of the thumbnails on the first portfolio, the scroller stays in the same place when you go to the next portfolio rather than reloading back at the beginning. I hope that makes sense because it's hard to explain, but the site is [URL] here's the partial code for the thumbnails...
[Code]...
I've got this API loading on every page of the website. Can .SWF tell itself when it has loaded and thereby default to a loaded position? So that when a user moves to different web pages, the API defaults to its loaded point? NOT from scratch? [URL]...All the blurs and fade-ins are Methods that respond to a bunch of Timer Events. Once the .SWF is loaded how can it DEFAULT to its loaded point when a user changes web pages?
I know there would be a Javascript solution but is there an AS3 solution?
I've got this API loading on every page of the website. Can .SWF tell itself when it has loaded and thereby default to a loaded position? So that when a user moves to different web pages, the API defaults to its loaded point? NOT from scratch? All the blurs and fade-ins are Methods that respond to a bunch of Timer Events. Once the .SWF is loaded how can it DEFAULT to its loaded point when a user changes web pages?
View 1 RepliesIs it better to create a new Object or to reset the same object over and over again?
[Code].....
I'm working on a project for my class using flash as2. I want it to be able to, when you click on a button, it drops a movie clip down the screen, essentially just adding _y to it, but then when it reaches 300y coordinate it resets the movieclip to its original position so that you can click the button and replay the same function. I'm not sure if this would be create empty movie clip each time you release button. I'm quite lost in this area so i dont have any actionscript to show, I really dont know where to begin. <3
View 9 RepliesI am a student working on a project with flash. I am simply trying to make a flash game using Actionscript 3 in Adobe Flash CS5. Everything is working fine, i can walk and jump, but I want the game to restart if the Main character touches an object and dies (like spikes in a pit). I have a main menu in frame 1 and the first level on frame 2. The main character is called "player_mc" and the object that kills him is called "dies".
Code:
//The Code For The Character (Player_mc)
import flash.events.KeyboardEvent;
import flash.events.Event;
[code].....
with a "what should be fairly simple" problem I am having with the quiz template. I have a 5 frame quiz that I've developed from the template. All 5 interactions are Hot Object interaction types. The problem I am having is when I go from one frame to the next, the Hot Objects do not reset. Whatever the selection from the previous slide was, remains in a selected state.
I've tried renaming the Interactions in the Component Inspector, but that doesn't work. If I put some other interaction between two Hot Object Interactions, no problem. It's only when they are consecutive.
Just new in forum and just new in as3 programming. All i want to do is to make some physics simulations (i'm physics teacher...). So i made my first sim with the following code, just to simulate a simple motion with constant velocity. It works ok, except the part i need to reset the display by the means to start the motion all over again (reset button). Then the motion starts but the traces of the previous motion remains on stage. I tried the null command (sp=null) but the sim could not start again because the sp nedded to be non-null...
[CODE]...
I am new to flash and im trying to make a game. Im stuck on hitTest. I have many black boxes falling down and I want the game to reset when the black boxes touch my red circle. I used this code for my boxes:
[AS]
this.createEmptyMovieClip("canvas_mc",10);
myInterval = setInterval(addbox1,500);
function addbox1() {
[Code] .....
My red circle is controlled by the mouse. The code for that is:
[AS]onClipEvent (load) {
startDrag(this, true); }[/AS]
I have an issue with adding a reset button to my drag and drop movie clips.The problem is, if a student drags a movie clip to a wrong location on the SWF file I want them to be able to hit a reset button that would take them the same SWF that they opened and what would showup would a clear page for them to restart their drag and drop exercise.I know how to make the button for this just want the proper action script to be able for user to start over with no movie clip symbols on the page.
View 3 RepliesWould it be possible (Without being extremely inefficient) to loop through a display object and reset their children's ChildIndex based on their y value?
View 1 RepliesI'm trying to trace the path of an object by using setPixel on the object's position every frame in a BitmapData/Bitmap pairing. These pixels aren't showing up normally and I suspect I have a fundamental misunderstanding of the BitmapData class. Here's what I'm doing:
public var contrailBase:BitmapData;
public var contrail:Bitmap;
private var contrailColor:uint;[code].....
Using this code, the red pixels don't show up. If I initialize contrailBase to 0xFF000000 instead then I get a black screen on which the red pixels DO draw, but I need the bitmap to be transparent except for the contrail. What am I doing wrong?
i'm making a drag-drop "quiz" (not much of one yet..)
If i click/release the mouse anywhere on the scene when the movie first loads, the circle_MC moves to 0,0 - i assume because myFinalX and Y are defaulting to 0 until doing something changes them.
How can i set this "default" to 50,50 but only when it first loads? (so it can be changed later without reverting back)
here's my (terrible!) code:
[AS]
circle_mc.onMouseDown=function(){
mousePressed=true;
}
[Code].....
Lets say I want to call a function with an optional Object, how do I write that?If it was a String or a Number or some simple data type it would be:
Code:
function foo(s:String="Sample String", n:Number=100):void{}
But anything I try with an Object just throws an error. For example...
Code:
function foo(o:Object={x:10, b:10}):void{}
...makes the compiler barf, and so does every other version of this I've tried.
reset in google yields only its use for timers.However I have code bg.reset() which I suppose puts the background back to the beginning of its timeline.
View 3 Replieshow to set default property values for objects that are being created in a loop.
In the example below, these propeties are the same for each object created in the loop: titleTextField.selectable, titleTextField.wordWrap, titleTextField.x
If you pull these properties out of the loop, they are null because the TextField objects have not been created, but it seems silly to have to set them each time.
var titleTextFormat:TextFormat = new TextFormat();
titleTextFormat.size = 10;
titleTextFormat.font = "Arial";
[Code]....
In Ruby, I would like to select a default object for a block. An example in Actionscript is:
[Code]...
I'm studying a demo code and it seems to me that an instance of a class is never instantiated, in particular I have this line:
[Code]....
Is it possible to change the default destination of the SharedObject directory? If so, how do you do this?
View 9 Replies