0
GOTO statement
Participant
,
/t5/animate-discussions/goto-statement/td-p/562705
May 09, 2007
May 09, 2007
Copy link to clipboard
Copied
I've seen in programming languages like Visual Basic, there
is a command.... GoTo label:
Then, the control will be shifted to the label referred and will start executing from that position.
I wonder why Actionscript doesn't have this feature?
Ex: (like this)
Then, the control will be shifted to the label referred and will start executing from that position.
I wonder why Actionscript doesn't have this feature?
Ex: (like this)
TOPICS
ActionScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/animate-discussions/goto-statement/m-p/562706#M286836
May 09, 2007
May 09, 2007
Copy link to clipboard
Copied
As far as I know there is no such future.
But using goto is always bad habit in programing language.
There is always way to avoid using of it.
Can you be more specific why u need to use goto ??
But using goto is always bad habit in programing language.
There is always way to avoid using of it.
Can you be more specific why u need to use goto ??
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/animate-discussions/goto-statement/m-p/562707#M286837
May 09, 2007
May 09, 2007
Copy link to clipboard
Copied
In actionscript:
that would be either:
gotoAndPlay("label");
or u may use
gotoAndStop("label");
that would be either:
gotoAndPlay("label");
or u may use
gotoAndStop("label");
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/animate-discussions/goto-statement/m-p/562708#M286839
May 10, 2007
May 10, 2007
Copy link to clipboard
Copied
you could absolutely goto a frame.
Also you can do what you want by writing another function, rather than a labeled point in the code.
Also you can do what you want by writing another function, rather than a labeled point in the code.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
MurMeeKeer
AUTHOR
Participant
,
/t5/animate-discussions/goto-statement/m-p/562709#M286841
May 10, 2007
May 10, 2007
Copy link to clipboard
Copied
Thank you all for the nice responses. I think RaGlitter's
idea is OK.
abrahamyan.com:
In some cases, I felt the difficulty of not having this feature.
But, absolutely........we have alternatives.
abrahamyan.com:
In some cases, I felt the difficulty of not having this feature.
But, absolutely........we have alternatives.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/animate-discussions/goto-statement/m-p/562710#M286843
May 10, 2007
May 10, 2007
Copy link to clipboard
Copied
gotoAndPlay() controls timeline, your question was about
jumping inside function scope i guess.
they are different things.
they are different things.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
MurMeeKeer
AUTHOR
Participant
,
/t5/animate-discussions/goto-statement/m-p/562711#M286845
May 10, 2007
May 10, 2007
Copy link to clipboard
Copied
Yes, you are right. I am asking about jumping from one line
to another line within a code and not in the timeline.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Explorer
,
/t5/animate-discussions/goto-statement/m-p/562712#M286847
May 10, 2007
May 10, 2007
Copy link to clipboard
Copied
Yes, I agree a goto is never really needed. There are always
better ways to go about it.
In your sample code, a simple if-else would work just fine. Inside your if-else, you could also call other functions as well if you find the code inside is long and reusable.
In your sample code, a simple if-else would work just fine. Inside your if-else, you could also call other functions as well if you find the code inside is long and reusable.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
MurMeeKeer
AUTHOR
Participant
,
/t5/animate-discussions/goto-statement/m-p/562713#M286851
May 10, 2007
May 10, 2007
Copy link to clipboard
Copied
Of course.......we can achieve this with an else block. I
think because of this only they might have not given importance to
the label.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/animate-discussions/goto-statement/m-p/562714#M286854
May 11, 2007
May 11, 2007
Copy link to clipboard
Copied
MurMeeKeer wrote:
> I've seen in programming languages like Visual Basic, there is a command....
> GoTo label:
>
> Then, the control will be shifted to the label referred and will start
> executing from that position.
>
> I wonder why Actionscript doesn't have this feature?
>
> Ex: (like this)
>
>
>
>
>
> function greater(a,b){
> if(a>b){
> goto lbl;
> }
> trace(b+" is greater than "+a)
> return b
> lbl:
> trace(a+" is greater than "+b)
> return a
> }
>
The bytecode that the Action Script is compiled into does support goto.
> I've seen in programming languages like Visual Basic, there is a command....
> GoTo label:
>
> Then, the control will be shifted to the label referred and will start
> executing from that position.
>
> I wonder why Actionscript doesn't have this feature?
>
> Ex: (like this)
>
>
>
>
>
> function greater(a,b){
> if(a>b){
> goto lbl;
> }
> trace(b+" is greater than "+a)
> return b
> lbl:
> trace(a+" is greater than "+b)
> return a
> }
>
The bytecode that the Action Script is compiled into does support goto.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
LATEST
/t5/animate-discussions/goto-statement/m-p/562715#M286855
May 11, 2007
May 11, 2007
Copy link to clipboard
Copied
Actionscript is based on ECMA. There is no GoTo statement in
the standard.
http://www.ecma-international.org/publications/standards/Ecma-262.htm
http://www.ecma-international.org/publications/standards/Ecma-262.htm
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

