ActionScript 3.0 :: "gotoandplay Function" - Red Lines

Apr 9, 2012

iam making a game and every thing is good except ((the hero )) when i moved it to the left its good,but when i moved to the right he just loop 1 time then he stop moving

more detail (the hero movie clip has 20 pictures left and right moves) the code i have the problem only with the red lines (i guess its from there) package

[Code]...

View 4 Replies


Similar Posts:


CS3 LINES Per FUNCTION LIMIT?

Jun 23, 2009

I have a function ( basically its the click on a reset buttons ) that sets back quite a loooooot of variables and text boxes. But after ( I think 200 lines ) , actionscript simply stops with that particular function and doesnt even give me an error.So it looks like there is a lines per function limit or something like that.I also tried it with an external .as but its the same.Creating functions for all these commands didnt work either.The only thing I can do is move a few lines up so that they get processed earlier.... ( but the last few still don't work )I even tried to make a function with 300 lines of myTextField.text = "hello"and a line: myTextField.text = "how are you" at the endDidnt work... it stayed at hello.

View 1 Replies

ActionScript 1/2 :: Where To Put GotoAndPlay Within Function

Jul 5, 2010

On my first frame, I have: 6 buttons (p1 through p6). A holder mc_holder, which holds mc_pages, {a movie clip that shows 6 pages (each their own movie clip, page1 though page6) tweened across the screen, made to look as if the pages are being "flipped" through).

The following code:
Code:stop();
var _holder = mc_holder.mc_pages;
var picked;p1.goal = 1;
p1.onRelease = goPage;
p2.goal = 10;
[Code] .....

The problem is, as soon as the movie loads, ALL these animations begin to play. I am looking for a solution so that the animations will not play until the page is viewed. I am thinking I can put a stop on the first frame of each page, and a frame label ("go") on the second frame. Can I add this (my knowledge is limited but say... gotoAndPlay (go")) to the code shown above? I have tried messing around with it but have not yet had any results.

View 3 Replies

GotoAndPlay Not Working In Function?

Sep 9, 2010

I'm having trouble getting a game to go to the end scene after a collison with a barrier.

Code:
function dead() {
clearInterval(ants); //stop spawning

[code].....

View 8 Replies

ActionScript 2.0 :: Create A GotoAndPlay Function?

Dec 28, 2007

is it possible to create a gotoAndPlay function?would this be valid?

_root.gotoAndPlay = function(){
}

View 1 Replies

ActionScript :: GetTimeout - Possible To Use Pause Function Between Lines?

Jun 10, 2009

Here's what I want to do in code.
Animate an MC of a car for a duration of x seconds.
After the car is done, move an MC of a dog for y seconds.
And so on...

With this code, all animations execute simultaneously.
car.slideTo(200,100,1);
dog.slideTo(200,100,5);
blimp.slideTo(200,100,2);
...
Is it possible to write a pause function to put in between those lines? I've tried using getTimeout, but I want to avoid having to define each animation as a separate function.

View 5 Replies

Flash 8 :: GotoAndPlay - Loop Function Between Frames

Jun 13, 2011

I am working with some actionscript that are spread out amongst different frames, and having changing conditions, determines whether to end the sequence (gotoAndStop(1)) or continue (gotoAndPlay(5))

(For easy example):
frame 4=
x=1
frame 5 =
x=x+1
frame 6 =
if (x=10){
gotoAndStop(1)
}else{
gotoAndPlay(5)
}

I understand this easy example could be done several ways on one frame easily, (while x<10, etc).. but my code is so long and complicated, that the way I wrote it, it was easier to have it sort of "loop" between frames. The problem with this is, I think the frame jumping is slowing the coding down. I tried functions, (like having all coding in frame 5 as a function, then calling that function with the "else" in frame 6), but that would only run the function once.. I need it to keep looping.

View 2 Replies

ActionScript 3.0 :: Flash Gotoandplay Function Not Working

Aug 16, 2010

I am using the below function in one of my application, but its not working. It says
1120: Access of undefined property btnTwo.

For button I have given the instance name as btnTwo
btnTwo.addEventListener(MouseEvent.CLICK, btn2);
function btn2(event:MouseEvent):void {
gotoAndPlay(24);
}

View 1 Replies

ActionScript 3.0 :: Making A Function Execute Different Lines At Different Time?

Feb 9, 2011

how can I execute different rows of a function at different time.

E.g.

ActionScript Code:
function ContentIn():void {
//First execute this line

[Code].....

View 2 Replies

ActionScript 2.0 :: Write A Function That If Some Movie Clips Are In Some X And Y Value Then GotoAndPlay('end');?

Sep 6, 2007

I would like some help on writing a piece of code.I need to write a function that if some movie clips are in some x and y value, then gotoAndPlay('end');

Code:

function gotoEnd() {
if
(tv_mc._x = 41.8;
tv_mc._y = 157.3;)
then
gotoAndPlay('end');
}

View 5 Replies

ActionScript 2.0 :: Tween Class - GotoAndPlay Function Not Working

Mar 12, 2010

I'm a bit rusty in flash.
import mx.transitions.Tween;
import mx.transitions.easing.*;
var mytween:Tween = new Tween(ball_mc,"_x",Strong.easeInOut,-320.10,47.90,5,true);
mytween.onMotionFinished = function() {
var mytween2:Tween = new Tween(ball_mc,"_x",Strong.easeInOut,47.90,-320.10,5,true);
} mytween2.onMotionFinished = function() {
gotoAndPlay(2);
}
It does the first and second tween but doesn't do the gotoAndPlay function?

View 6 Replies

ActionScript 2.0 :: Passing Parameter To GotoAndPlay In Custom Function

Dec 13, 2004

I have a custom function with parameter. I'm trying to pass the parameter to the gotoAndPlay as follows. This is where the function is called...

Code:
myButton_btn.onPress = function() {
myFunction("Apply");
}
This is the function...
Code:
myFunction = function (fLabel) {
trace(fLabel);
gotoAndPlay(fLabel);
}

Basically "Apply" is a frame label that I'm trying to send the playhead to. The fLabel paramater traces out properly, but the gotoAndPlay doesn't send the playhead to the appropriate frame label. It sends it to 4 frames before the end. It's really weird. Even if I add frames to the timeline, it still sends it to 4 before the end. I can get it to work perfectly in a "new" flash document, but not in my existing document.

View 11 Replies

ActionScript 3.0 :: Creating A GotoAndPlay Function On A Button In A Document Class?

Oct 27, 2011

I got a simple block of code that stops the main timeline on a certain frame, but so far I've been unable to form a code that would gotoAndPlay when mouse click happens on a button I made, and mind you I'm doing this in a document class. I've heard different instructions how to make the button, some say make it a movieclip, some say nest it in a movieclip

View 6 Replies

ActionScript 3.0 :: Flash - GotoAndPlay Function Not Working - Error #1009

Aug 4, 2010

gotoAndPlay function not working, I am getting this runtime error "Error #1009: Cannot access a property or method of a null object reference."I understand its meaning, what is the reference that is null here , even keyframe 3 exists.

[Code]...

View 3 Replies

ActionScript 3.0 :: Function - Button Will GotoAndPlay One Frame Beyond Where The Timeline Presently Is Stopped At

Feb 23, 2011

I'm taking a class on Flash right now but its set up in this strange manner where they barely teach you actionscript at all but expect you to be able to take the examples in class and work and amend them into your projects. I am trying to write a function for a button that will gotoAndPlay one frame beyond where the timeline presently is stopped at.

[Code]...

View 3 Replies

ActionScript 3.0 :: Current Function Returns Me To A Previous Frame - GoToAndPlay Stop Event?

May 8, 2011

I'm trying to get a quick replay command, "pressing space returns the scene to the previous frame".

[Code]...

The current function returns me to a previous frame (40), however the event does not stop, rather it keeps on adding new events ontop of each other once it returns to main frame. The main frame being where the actionscript is executed.

View 1 Replies

Actionscript 3.0 :: Blitting Lines - Draw Approximately 50000 Lines And Performance Is Poor?

Aug 17, 2011

I have been working on a map viewer based blitting technique. As part of the map I need to draw approximately 50000 lines and performance is currently really poor.

Code: Select allvar movie:Shape = new Shape();
for( ... )
{
movie.graphics.clear();[code].....

View 2 Replies

ActionScript 2.0 :: Goto And Play Scene - _root.gotoandplay And Even Scene1.gotoandplay Won't Work?

Nov 9, 2007

For some reason i'm having problems swapping scenes in my flash movie. At first i put the action in a "actions" named layer and a link to a button. So basicly when scene1 loads the frame 1 action is "stop ();". The viewer clicks on button1 which has a code of;

[Code]...

View 1 Replies

ActionScript 3.0 :: Drawing Lines Between Mc's, Getting Lines In Stage Co-ords, Not Mc's?

Nov 15, 2009

My code is on the main timeline.I call a function loop to draw lines between them.The lines are drawing between the right x, y values BUT between those values on the main stage, not those values within the kite.For example, dot1_mc is at x100, y0 inside kite. the line that should go from its center, draws from stage x100, 0.How do I draw the lines inside kite so that they draw between the dots?Heres my code that draws the linesPHP Code:

function loop():void{ lineDrawing.graphics.clear(); var a:Point = new Point(kite_mc.dot1_mc.x, kite_mc.dot1_mc.y); var b:Point = new Point(kite_mc.dot2_mc.x, kite_mc.dot2_mc.y); var c:Point = new

[code].....

View 4 Replies

ActionScript 3.0 :: Run A "gotoAndPlay" Function But Get TypeError: Error #1009?

Mar 27, 2011

Basically what is happening is that I have created a button that is simply meant to run a "gotoAndPlay" function and take me to the next scene, but for some reason I am getting the error "TypeError: Error #1009: Cannot access a property or method of a null object reference."

now I seem to have done something wrong, even though I have gone over my code 100 times.

Here is the Code:

ActionScript Code:
package  {
import flash.display.MovieClip;
import flash.display.SimpleButton;

[Code].....

View 4 Replies

ActionScript 3.0 :: External SWF GotoAndPlay From External Protected Function?

Jan 27, 2010

I have a problem I just can't seem to solve.I have an FLA .. (augmented.fla)I have a movieclip inside of augmented.fla with a class name of myMaterial that has the following code on it's timeline.

ActionScript Code:
var request:URLRequest = new
URLRequest("main.swf");

[code].....

View 0 Replies

AS3 :: Points & Lines - Getting Lines To Follow Points As They Are Dragged?

Jul 21, 2010

I am trying to create a mindmap where the user can drag points about the screen. I have gotten as far as drawing the line via actionscript, and drag+drop the points (defined as movie clips on stage). This is the existing script - I don't know how to get the lines to follow the points. Something to do with ENTER_FRAME or updateAfterEvent?

var line:MovieClip = new MovieClip();
line.graphics.lineStyle(1,1);
line.graphics.moveTo(ptOne.x,ptOne.y);

[code]....

View 1 Replies

Flash :: Delegate Function (Function).toString() Prints Function Function() {}?

Nov 1, 2010

I've got a Vector of ViewToActionMap objects, which have following constructor:

public function ViewToActionMap(_forModule:eModule,
_forAction:eViewAction,
_toFunction:Function,

[code].....

View 1 Replies

IDE :: Comparing The Two Lines?

Sep 2, 2009

I have two lines. One is straight and one is curved. Both were created with the Flash Graphics interface. How would I compare the different Y value for the curved line for any given X. In other words, how do I find a point on curve if I used the CurveTo method.

View 2 Replies

Gotoandplay Getting Complicated?

Mar 9, 2010

basically i'm trying to get something like this;

Code:
on (release) {
gotoAndPlay(1-30);

[code]....

View 1 Replies

Flash 8 - GotoAndPlay One After Another

Mar 11, 2010

I am currently creating a project in flash. Basically I have nearly a hundred frames. I want my next button to play scene 90 to 100 and then play 60-80 after the previous one has finished. I have already put action script in the top layer to make sure it will stop at 100 and stop at 80 but i cant get them to play after each other. I haven't a clue of what function to use only go to and play but then they would play at the same time right?

View 2 Replies

IDE :: GotoAndPlay Mc In A Loop?

Jun 21, 2009

How can I get a movie clip to play when pressing the right arrow key? The movie clip is called helicopter and it has stop(); on its first frame (with an animation following).

Here is the loop that tells the arrow keys what to do when pressed:

public function loop(e:Event) : void
{
vy += gravity;
y += vy;

[Code]....

View 5 Replies

IDE :: GotoAndPlay A Frame In An MC, Within A Swf Within A Swf?

Oct 22, 2009

hen you click on a button within my swf it loads an external swf into an MC that sits on top of the 1st swf, which continues to play underneath.Within swf2 I have lots of pages that you can navigate to, which works fine on its own, but not when I try to play it through swf1.When I click on any of the navigation buttons they don't work.I've tried making an MC within swf2, putting all the pages in there and on the navigation buttons doing:

on(release){
_root.swf2MC.gotoAndPlay("frame");
}

[code]....

View 2 Replies

ActionScript 2.0 :: GotoAndPlay Sometimes And Not Sometimes?

Feb 28, 2005

I am trying to perform a simple jump on a button with this basic code,

on(release) {
gotoAndPlay("ToMain");
}

This works most of the time. Other times it simply skips the jump and continues on. This jump is aimed to skip over an intro (so heavy image transitions with music and commentaries added). I am guessing the intense cpu processing is the cause of the skip. Is there a sure way of performing this jump?

View 3 Replies

Lines With Corner Radius

Mar 10, 2012

I am wondering about making lines with a corner radius. It seems that the smaller the scale, the corners sort of distort, and end up looking jaggy. Maybe its just the way it is, but is there any remedy? I tried shifting the registration points, etc, but still the only way it looks smooth is when enlarged.

View 2 Replies







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