This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#51 2008-08-07 17:50:06

F18
Scratcher
Registered: 2008-07-08
Posts: 16

Re: coding in flash actionscript 2.0 for beginners

Thanks everyone for the basic coding! On newareagle (my main account)  I made a little short animation and set it up as my icon. I had to export it as a .gif image. (Took me a few minutes to figure out how.)

Last edited by F18 (2008-08-07 17:50:33)

Offline

 

#52 2008-08-07 17:54:45

Cyclone103
Scratcher
Registered: 2008-03-20
Posts: 500+

Re: coding in flash actionscript 2.0 for beginners

Bluestribute wrote:

Cyclone103 wrote:

Ok, problem. The text box is not displaying any text. What do I do? I set it to dynamic, and it is supposed to display the variable.

Did you do

_root.var (replace with your variable)

Yes I did. Life in this case, as per the example. Btw archmage, how do you do shape tweens with the timeline thing and play them?


All your base are belong to us

Offline

 

#53 2008-08-07 18:02:17

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

whats the equivilant of

[blocks]
<repeat( 10

<end>
[/blocks]
in flash action 2

Last edited by deatheater (2008-08-07 18:02:38)

Offline

 

#54 2008-08-07 18:03:46

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

deatheater wrote:

whats the equivilant of

[blocks]
<repeat( 10

<end>
[/blocks]
in flash action 2

Or:

<repeat until>

or (yeah, watch this  tongue ):

<switch to costume[ (I know it's frames, but how do I make it for 1 instance only, not all of them?)


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#55 2008-08-07 18:06:05

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

Hobbs1100 wrote:

I meant around what age? I'm 12, so would that be a good time to start?

The younger the better.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#56 2008-08-07 18:07:13

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

Bluestribute wrote:

deatheater wrote:

whats the equivilant of

[blocks]
<repeat( 10

<end>
[/blocks]
in flash action 2

Or:

<repeat until>

or (yeah, watch this  tongue ):

<switch to costume[ (I know it's frames, but how do I make it for 1 instance only, not all of them?)

I think repeat until is equivilant to:
do {_x-=1;
} while (_root.var=1);

which changes the x by -1 until var doesn't equal 1  smile

Last edited by deatheater (2008-08-07 18:07:49)

Offline

 

#57 2008-08-07 18:10:28

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

Cyclone103 wrote:

Bluestribute wrote:

Cyclone103 wrote:

Ok, problem. The text box is not displaying any text. What do I do? I set it to dynamic, and it is supposed to display the variable.

Did you do

_root.var (replace with your variable)

Yes I did. Life in this case, as per the example. Btw archmage, how do you do shape tweens with the timeline thing and play them?

Not sure for CS3 but in flash 8 you can click a timeline with a tween and in the bottom left corner there is a box where you can change the type of tween.

Also, unlike scratch there are tons of resources for actionscript programmers so ask google before anyone else next time.

And the first link for shape tween CS3 is
http://edutechwiki.unige.ch/en/Flash_shape_tweening_tutorial


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#58 2008-08-07 18:13:39

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

deatheater wrote:

whats the equivilant of

[blocks]
<repeat( 10

<end>
[/blocks]
in flash action 2

Use a for loop

for (i=0;i<10;i++){
//do whatever
}

Scratch loops unlike flash loops have a built in wait before each loop. This is a bit of a pain sometimes.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#59 2008-08-07 18:16:22

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

archmage wrote:

deatheater wrote:

whats the equivilant of

[blocks]
<repeat( 10

<end>
[/blocks]
in flash action 2

Use a for loop

for (i=0;i<10;i++){
//do whatever
}

Scratch loops unlike flash loops have a built in wait before each loop. This is a bit of a pain sometimes.

so whats the stuff in the middle mean???

Offline

 

#60 2008-08-07 18:18:54

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

deatheater wrote:

Bluestribute wrote:

deatheater wrote:

whats the equivilant of

[blocks]
<repeat( 10

<end>
[/blocks]
in flash action 2

Or:

<repeat until>

or (yeah, watch this  tongue ):

<switch to costume[ (I know it's frames, but how do I make it for 1 instance only, not all of them?)

I think repeat until is equivilant to:
do {_x-=1;
} while (_root.var=1);

which changes the x by -1 until var doesn't equal 1  smile

Your code is wrong.

it should be

do{_x-=1;
}while (_root.var==1)

= is for setting variable values and == is for checking to see if 2 variables are of equal value.

Here is a small list of diffrent ones

== //equal
!= //not equal
>= greater than or equal
<= //less than or equal

and for the <<  <and>  >>   <<  <or>  >>   <<  <not>  >>

use this   

|| //or
&& // and
! // not

like this

if (_root.one!=1 && _root.two!=2){
//do stuff
}


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#61 2008-08-07 18:24:10

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

deatheater wrote:

archmage wrote:

deatheater wrote:

whats the equivilant of

[blocks]
<repeat( 10

<end>
[/blocks]
in flash action 2

Use a for loop

for (i=0;i<10;i++){
//do whatever
}

Scratch loops unlike flash loops have a built in wait before each loop. This is a bit of a pain sometimes.

so whats the stuff in the middle mean???

That is a for loop. As a person working with scratch you have probally never seen one before. They are very useful.

each for loop has its own private variable that can only be using within the loop. This is declared in the first part of the loop
i=0

The loop will run if the condition in the second part of the loop is met. In this case the condition is that i is less than 10.
i<10

The last part changes the loop variable each time the loop is run. ++ is a post increment operator that will increase a variable by 1.
i++

You people should try looking at google for answers more often.

Or you can consult the newgrounds encyclopedia of AS2 knowledge
http://www.newgrounds.com/bbs/topic/229808/50
I have the link bookmarked. I recommend you do the same.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#62 2008-08-07 18:36:38

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

archmage wrote:

deatheater wrote:

Bluestribute wrote:


Or:

<repeat until>

or (yeah, watch this  tongue ):

<switch to costume[ (I know it's frames, but how do I make it for 1 instance only, not all of them?)

I think repeat until is equivilant to:
do {_x-=1;
} while (_root.var=1);

which changes the x by -1 until var doesn't equal 1  smile

Your code is wrong.

it should be

do{_x-=1;
}while (_root.var==1)

= is for setting variable values and == is for checking to see if 2 variables are of equal value.

Here is a small list of diffrent ones

== //equal
!= //not equal
>= greater than or equal
<= //less than or equal

and for the <<  <and>  >>   <<  <or>  >>   <<  <not>  >>

use this   

|| //or
&& // and
! // not

like this

if (_root.one!=1 && _root.two!=2){
//do stuff
}

well I was close  smile

Offline

 

#63 2008-08-07 20:22:36

Cyclone103
Scratcher
Registered: 2008-03-20
Posts: 500+

Re: coding in flash actionscript 2.0 for beginners

I made a newgrounds account to help get meh flash stuffs up, as soon as I figure it out! http://cyclone103.newgrounds.com/ I have nothing up. Anyone know how to download project people have made?


All your base are belong to us

Offline

 

#64 2008-08-07 20:35:57

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

Cyclone103 wrote:

I made a newgrounds account to help get meh flash stuffs up, as soon as I figure it out! http://cyclone103.newgrounds.com/ I have nothing up. Anyone know how to download project people have made?

Don't think u can on newgrounds, plus they don't want new begginer projects  smile , so I'm making a maze game  smile

Offline

 

#65 2008-08-07 21:04:31

Cyclone103
Scratcher
Registered: 2008-03-20
Posts: 500+

Re: coding in flash actionscript 2.0 for beginners

deatheater wrote:

Cyclone103 wrote:

I made a newgrounds account to help get meh flash stuffs up, as soon as I figure it out! http://cyclone103.newgrounds.com/ I have nothing up. Anyone know how to download project people have made?

Don't think u can on newgrounds, plus they don't want new begginer projects  smile , so I'm making a maze game  smile

Lol, I was hoping to get a local copy of bubble tanks 2. Oh well. I know they don't want beginner projects, but I made the account to ask people questions, and eventually post once I get my projects in Flash up to par, or close to it.  And, I wanted to have my claim on my username  tongue


All your base are belong to us

Offline

 

#66 2008-08-07 22:37:47

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

Cyclone103 wrote:

deatheater wrote:

Cyclone103 wrote:

I made a newgrounds account to help get meh flash stuffs up, as soon as I figure it out! http://cyclone103.newgrounds.com/ I have nothing up. Anyone know how to download project people have made?

Don't think u can on newgrounds, plus they don't want new begginer projects  smile , so I'm making a maze game  smile

Lol, I was hoping to get a local copy of bubble tanks 2. Oh well. I know they don't want beginner projects, but I made the account to ask people questions, and eventually post once I get my projects in Flash up to par, or close to it.  And, I wanted to have my claim on my username  tongue

have u noticed ur character autimatically scrolls, off screen, if u push him off

Offline

 

#67 2008-08-08 01:32:49

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

hey archmage I'm trying to make a maze game,but when I make a wall symbol, there's this blue square that covers the whole maze, do I have to do each wall seperately, can u change that square, or can I do colour sensing, thanks

Offline

 

#68 2008-08-08 12:22:07

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

Basic hittests check for collisions of bounding boxes while shapeflag hitTests check for collisions at a specific coordinate. Also check out the links I posted at the bottom of the first post in this thread. They have info that can answer most of your questions.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#69 2008-08-08 12:56:30

newareagle
Scratcher
Registered: 2008-06-10
Posts: 100+

Re: coding in flash actionscript 2.0 for beginners

archmage, i was wondering how hard it would be to make my "Factory Escape Saga" Game in Flash. i would like to try to make it with a lot nicer grpahics, then maybe see what It is worth. I was wondering if you could download it and see if it would be possible to make in Flash, and how long it would take a master/beginner. Thank you.


My Guitar Hero Game.
8/9 Projects on the Front Page at Once!

Offline

 

#70 2008-08-08 19:47:04

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

Newareagle, it wouldn't be too difficult for someone who knows the basics of flash.

I went ahead and remade your project with the first level into flash. It took me about 2 hours but most of the programming that flash will need is done.
http://spamtheweb.com/ul/upload/080808/70709_demo.swf

Here is the fla
http://spamtheweb.com/ul/upload/080808/70912_factory_escape.fla

This would take me no more than a day to complete since you already have all the levels already made. If you want I can work with you to make a complete flash version of it, then get it sponsored for cash and submit it to newgrounds.

If you want to do this yourself you should go to this link and learn everything in the basic section.
http://www.newgrounds.com/bbs/topic/638183

Also, the guys at NG are very good with flash so you can ask for help if the flash forums if you need it.

Last edited by archmage (2008-08-08 19:47:25)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#71 2008-08-08 19:49:07

Cyclone103
Scratcher
Registered: 2008-03-20
Posts: 500+

Re: coding in flash actionscript 2.0 for beginners

I am now using NG for all of my flash needs, but I still need help with hiding a mouse.


All your base are belong to us

Offline

 

#72 2008-08-08 19:54:23

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

Cyclone103 wrote:

I am now using NG for all of my flash needs, but I still need help with hiding a mouse.

Mouse.hide


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#73 2008-08-08 19:55:47

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

Use Mouse.hide();

Pretty simple command.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#74 2008-08-08 19:56:48

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

Bluestribute wrote:

Cyclone103 wrote:

I am now using NG for all of my flash needs, but I still need help with hiding a mouse.

Mouse.hide

That won't work.

You forgot the brackets.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#75 2008-08-08 19:59:17

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: coding in flash actionscript 2.0 for beginners

archmage wrote:

Bluestribute wrote:

Cyclone103 wrote:

I am now using NG for all of my flash needs, but I still need help with hiding a mouse.

Mouse.hide

That won't work.

You forgot the brackets.

Lol, you know what i mean (you should at least)


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

Board footer