ActionScript 2.0 :: MoveTo Function - Move The Movie Once To A Defines X-value
Dec 5, 2006
I am working on a simple eportfolio for one of my college classes. I am trying to made one movieclip (instance: main) move horizontally when you click on buttons. I have two buttons one of the left side of the the stage (Instance: show) that slides "main" to the right; and one of the right side of the stage (instace: hide) that slides "main" to the left.
Problem: According to my script now, I can only move the movie once to a defines x-value. How can I get it so when the button is clicked it continues to move "main" multiple times?
[Code]....
View 7 Replies
Similar Posts:
Apr 12, 2004
I have four buttons on the stage which I want to move 20 pixels up (easing) and fade in from 0 to 100. But I want them to appear with a interval of 1 second. I came up with the following function:
Code:
function showClips(yPos, alpha, speed) {
var endY = yPos - this._y;
this._y += eindY /speed;
[Code]...
View 3 Replies
Apr 2, 2005
I am making a game that involves a function that makes a bottle randomly explode in all directions. The function is on the main frame of my game and is linked to several movie clips inside the bottle. When the conditions are right, the movie clips should call the function and then fly out in random directions. The problem is, when i put the code directly onto the movie clips it works fine, but when i attempt to use it as a function is makes the entire movie move in random directions instead of the glass shard. My only guess as to why this happens is because this '_this.' command somehow applies to my main frame because that is where the function originates.
View 4 Replies
Jul 25, 2011
I'm just wondering if there is a way to define some global variables that I can use throughout different .as files. For example, I make a file called 'Defines.as', declare some variables in it, then use those variables in a file called 'Player.as' Is something like that possible? Any links to a site explaining that sort of interaction? I just don't know what to Google to find it.
View 3 Replies
Jan 20, 2010
I'm creating a new look for the xspf player: [URL]The playlist highlights the current song being played. I'd like to change the color but can't find where that option is listed in the .flv file, or in the actionscript file.
View 2 Replies
Nov 5, 2009
Below is what I'm doing, But I need to add a "close" button that will move the tabBtn back.And also replay the video?
Code:
tabBtn.addEventListener(MouseEvent.CLICK, buttonClickHandler);
function buttonClickHandler(event:MouseEvent):void {
[code]......
View 1 Replies
Dec 2, 2009
I'm making a shape (christmas tree) which i can't make with rectangles and circles exc, so i made it with moveTo/lineTo, the problem now is that i can't "call" for it to fill the area inside the shape... how would you do it? Also, i hope i did this the wrong way, because its a really tiresome way of making it. What I've got so far is:[code]
View 3 Replies
Oct 10, 2008
. As far as I could see in the reference manuals, the beginFill() method of the flash.display.Graphics class ends any previous incomplete (i.e., not ending back at the start point) fills by automatically drawing a line to the latest MoveTo() location.But, it seems it also ends any previous incomplete drawing even without fills, by drawing that final line.
But that's ok. The weird part is, even when I draw just one line and begin a fill immediately after that, I guess it tries to complete that line by drawing one more line back to the starting point and the messes up the display with the fill color in the following beginFill() call.
public class MyContainer extends Container
{
public function MyContainer()
{
[code]....
The output is as in the attachment.The first part creates a weird fill along the side of the line till the end of the container object.I even tried a endFill() at line 4, but same result. The only way to prevent this is to explicitly moving to some point as in line 11.
View 0 Replies
Mar 21, 2010
I've built a drawing application. Because I've programmed the option to insert symbols (new movieclips), I needed to create a new movieclip each time I start drawing. The problem is that I now completely messed up my lineTo and moveTo sequence, and it just draws from coordinates which I don't understand where is gets them from.The code section is basically:
stage.addEventListener( MouseEvent.MOUSE_DOWN, startDrawing );
stage.addEventListener( MouseEvent.MOUSE_MOVE, drawer );
function drawer( e:MouseEvent ):void[code].....
I have a main lineDrawing movieclip into which i'm creating a new shDrawing each time the mouse moves. The problem is, because it starts a new movieclip each time - it messes up the coordinates of the line drawing.(btw, I can solve this if I could only do some kind of "lineTo" function on a movieclip, so that it "lines-to" from mouse down to mouse up seamlessly, regardless of the speed of moving the mouse.
View 3 Replies
Jan 29, 2003
is it possible to write a function to move an object and then call that function on a clip event for instance
function (bounce){
script;
script;
}
and then call it by saying
on(mouseOver){
this.bounce;
}
View 2 Replies
Aug 29, 2003
i have 2 movieclips: i want to move both of them but the second movie clip will only move if the first clip reach his final destination how do i do that?
View 2 Replies
May 21, 2007
I was reading the 'Isometric Transformations' tutorial by Danko Kozar and I have a few questions. I understand what all the code does, but not how it does it. First of all, how does the following code work:
transforms x,y,z coordinates into Flash x coordinate
xFla = function (x, y, z) {
// cartesian coordinates[code].....
I understand that it converts 3d coordinates to 2d coordinates, but I don't understand how. What numbers whould be punched into x, y, and z to acquire certain desired effects?Also, what's the difference between moveTo and lineTo:
red line
style(1, "0xFF0000", 100);
plot(0, 0, 0);
draw(200, 0, 0);
View 4 Replies
Mar 27, 2012
I have a motion tween user icon (UImovingM1) moving from one point to another when I add its child. Once that user icon gets to the exact x and y coordinates that I want, I want to go into another function where that child (UImovingM1) is removed (along with a background) to add a new background. Now my small problem is that when I get into my goToMoneyTemp function, where the motion tween user icon is added, it plays the movie of the user icon moving over and over again. It will not go into my goToMoney function.[code]...
View 3 Replies
Feb 20, 2010
package {
import flash.display.;
import flash.events.;
[code]....
View 1 Replies
Feb 10, 2011
I need to create an animation and provide some results of the move function at the END of the animation. However, i am not able to control the output till the move function is completed
I tried the isPlaying- that doesn't seem to detect that the animation is completed... so continues to output resukts before the animation is complete
sample code I tried
private function mvbut():void{
var mv:Move= new Move;
mv.xFrom=Math.random()*300;
[Code]....
View 1 Replies
Mar 11, 2005
I've got this button that sets _xdest = 450. What I am trying to do is set an If move._xPos>= 450 then a function is activated like this
move.onEnterFrame = function() {
if (_root.move._xPos>= 450) {
out();
}};
View 3 Replies
May 14, 2004
Alright so... I really don't know the best way to approach this. I had a LOT of code that I thought could be generalized into a function. I don't know how to explian it... here is the code:i attached it...I know it's a lot of code... I just... I don't know what to do with it anymore! When it was in a bunch of small functions, it worked (sort of) just seemed reallly messy and annoyed me.Oh btw its causing the hero to jsut go to 0,0 and then a hit symbol appears there, and then nothing happens, the hit doesnt even dissappear.
View 7 Replies
Jan 20, 2011
I am trying to create a similar effect to what is used in CityVille for dropping coins and experience icons, they do a custom move animation and it first moves a little bit up and then down. It looks like it is following a spline or a sine function.
View 2 Replies
Apr 20, 2011
While a user is in a frame, I have the user press F1 to gotoAndPlay another frame, press F3 to gotoAndPlay another frame, etc. But when the user presses the F1 or F3 function key, they get the IE browser search screen or IE keyboard shortcut. How do I use AS3 to have the action taken when the user presses F1 perform the function within my flash file and not the IE process for the function key?
View 0 Replies
Feb 7, 2008
[URL]Did u notice that the video automatically became fullscreen if the mouse doesn't move for a specified time.How can trigger a function if the mouse doesn't move for sometime?
View 4 Replies
Feb 12, 2011
I have an mxml pie chart, which I would like to rotate slowly prior to a button click, however on click it needs to stop immediately (or at least reasonably quickly) and then the callout labels are introduced with a fade.
I have experiemented with both a timer function to achieve this:
[Code]...
View 1 Replies
Apr 1, 2006
I'm trying to call a function that will slowly move/fade an object and it doesn't seem to want to work.
Here is the code
Code:
mypos = 1;
position = function () {
mypos++;
[Code].....
View 2 Replies
May 14, 2006
i trying reuse a function many times so i decide to put it inside the timeline and whenever the movieclip move it will call the function, but it dont work. -_-
[Code]...
View 4 Replies
Jun 25, 2005
just wondering why this isn't working :
Code:
var nav:Boolean = true;
var element:String = "home"; [code]....
Its so that a menu will move right across the screen if the variable is true, and if its false, it'll move left back to its original position.... i achieved this using a motion tween and telling the mc to go to the frame and play, but that didn't work in the end because if the menu bar was on the left side, and it was told to move to the left, then it would disappear,and appear on the other side.... so in other words it screwed up
View 10 Replies
Apr 1, 2011
Im just wondering is there a way I can load flv's externally into flash and then move them around like a drag and drop function?
View 4 Replies
Oct 23, 2010
it seems simple enough but i have no idea on how i could get a movie clip to slowly move to the coordinates of another existing movie clip
View 5 Replies
Feb 18, 2004
is there a way to refer to all movie clips on the stage or apply a function to all movie clips without applying the function to all manually?
View 3 Replies
Mar 19, 2011
suppose one has two buttons "left" and a "right ".the 'left' moves to the leftand the "right" to the rightand the goal is to move the object "ball"based on this potential requires that script to do this?
View 1 Replies
Aug 9, 2011
Overview: I'm creating a menu where buttons have a sub-menu that pops-up when you hover over the main buttons. The menu will eventually be populated by scanning labels in the timeline, and that seems to be working fine so far. Everything works good enough except you can't move your mouse up and down a popped-up sub-menu without the mouse_out function triggering. The mouse_out listener seems to be applied to all individual sub-buttons when I'd like it to apply only to the parent MC container of each sub-menu.
Is there a problem with the way I'm assigning sub-buttons to container MC's ? I've explored using an array to store the MC's as well, but still had the same listener issue. Could someone look at my FLA? If you do a find for "PROBLEM", that is a good place to start.
View 1 Replies
Jun 30, 2009
it isn't such a big problem bur for a beginner like me it is.I have a movie clip called "Lion_beginning_mc", inside of it I have 3 Key Frames and Inside each and one of them I have different shapes.For example:Key Frame number 01 - DogKey Frame number 02 - CatKey Frame number 03 - MouseI want to move this movie clip "Lion Beginning_mc" form Key frame number 1 to Key frame number 20.I want the Dog,Cat and a mouse to change between each other only once while moving from Key Frame number 1 to 20.And then when the movie clip "Lion Beginning_mc" reaches his goal another movie clip or a frame (with a shape) will start.
View 5 Replies