Be a Supporter!

help for actionscript

  • 575 Views
  • 26 Replies
New Topic Respond to this Topic
mdpreado
mdpreado
  • Member since: Oct. 17, 2009
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
help for actionscript 2010-05-08 14:24:53 Reply

ok, i have flash cs4 and whenever i try to add actionscript to anything it says current selection cannot have actions applied to it so....... why does it do that and how can i get around it?


BBS Signature
Callum123456
Callum123456
  • Member since: Mar. 7, 2009
  • Offline.
Forum Stats
Member
Level 24
Blank Slate
Response to help for actionscript 2010-05-08 14:27:43 Reply

At 5/8/10 02:24 PM, mdpreado wrote: ok, i have flash cs4 and whenever i try to add actionscript to anything it says current selection cannot have actions applied to it so....... why does it do that and how can i get around it?

It is because you made an as3 document and you have to code in the timeline or .as files. You need to go new->as2 document. Or a better option is learn as3.

mdpreado
mdpreado
  • Member since: Oct. 17, 2009
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to help for actionscript 2010-05-08 14:30:21 Reply

ohhhhhhhhhhhhhhhhh

cheers mate


BBS Signature
DragonSnare
DragonSnare
  • Member since: Sep. 30, 2003
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to help for actionscript 2010-05-08 14:39:51 Reply

you are under AS3 I'm guessing you are used to AS2/1, AS3 doesn't allow AS to be added inside of objects you have to use classes for that. change the actionscript setting to AS2

File>Publish settings>Flash>ActionScript drop down box.


Flash games / Game creation tools

BBS Signature
meneldil
meneldil
  • Member since: May. 27, 2004
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to help for actionscript 2010-05-08 14:40:26 Reply

If you're trying to add actions directly to Movie Clips or Buttons - you can't do it that way in AS3. You have to create class files instead.


Indescriptive topic names have left me in despair!

mdpreado
mdpreado
  • Member since: Oct. 17, 2009
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to help for actionscript 2010-05-08 16:30:10 Reply

what's wrong with this actionscript?

onClipEvent (enterFrame) {
// right
if (Key.isDown(Key.RIGHT)) {
_rotation = _rotation+move;
}
// left
if (Key.isDown(Key.LEFT)) {
_rotation = _rotation-move;
}
// up
if (Key.isDown(Key.UP)) {
if (move<8) {
move++;
}
} else if (move>0) {
move--;
}
// down
if (Key.isDown(Key.DOWN)) {
if (move>-10) {
move--;
}
} else if (move<0) {
move++;
}
// enter
if (Key.isDown(Key.ENTER)) {
_x = 200;
_y = 200;
_rotation = 0;
move = 0;
}
// _x & _y position
if (_rotation>180) {
_y = _y+(move*Math.cos(Math.PI/180*_rotation)
);
_x = _x-(move*Math.sin(Math.PI/180*_rotation)
);
}
if (_rotation<180) {
_y = _y-(move*Math.cos(Math.PI/180*_rotation)
);
_x = _x+(move*Math.sin(Math.PI/180*_rotation)
);
}


BBS Signature
Callum123456
Callum123456
  • Member since: Mar. 7, 2009
  • Offline.
Forum Stats
Member
Level 24
Blank Slate
Response to help for actionscript 2010-05-08 16:38:39 Reply

At 5/8/10 04:30 PM, mdpreado wrote: what's wrong with this actionscript?

Are you getting errors? or is it just not working as expected? a bit more information is needed.

Archawn
Archawn
  • Member since: Sep. 9, 2007
  • Offline.
Forum Stats
Member
Level 27
Game Developer
Response to help for actionscript 2010-05-08 18:26:10 Reply

At 5/8/10 04:30 PM, mdpreado wrote: what's wrong with this actionscript?

Well...

- You didn't use code tags
- You are coding on a MovieClip
- You are coding in AS2

- You didn't explain what it is supposed to do
- You didn't explain what is happening instead
- You didn't post any relevant error messages

Please, post more information.

mdpreado
mdpreado
  • Member since: Oct. 17, 2009
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to help for actionscript 2010-05-10 13:28:11 Reply

Statement block must be terminated by '}'
Syntax error.

i copied this code so i don't get know all this jiba jaba


BBS Signature
4urentertainment
4urentertainment
  • Member since: Aug. 1, 2008
  • Offline.
Forum Stats
Moderator
Level 13
Game Developer
Response to help for actionscript 2010-05-10 13:32:18 Reply

At 5/10/10 01:28 PM, mdpreado wrote: Statement block must be terminated by '}'
Syntax error.

i copied this code so i don't get know all this jiba jaba

Did you try...terminating the statement block by adding "}"? As in, put '}' at the end of the code.

Also, you blatantly state that you copied the code, and that you have no idea how it works...

You won't learn anything like this. It's a really counter-productive way of practicing Actionscript.

mdpreado
mdpreado
  • Member since: Oct. 17, 2009
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to help for actionscript 2010-05-10 13:49:28 Reply

there is one


BBS Signature
4urentertainment
4urentertainment
  • Member since: Aug. 1, 2008
  • Offline.
Forum Stats
Moderator
Level 13
Game Developer
Response to help for actionscript 2010-05-10 13:52:48 Reply

At 5/10/10 01:49 PM, mdpreado wrote: there is one

Another one maybe?

I copied and pasted your code into FlashDevelop, and the snippet you posted is missing a curly bracket at the end. The clipEvent is never closed this way.

mdpreado
mdpreado
  • Member since: Oct. 17, 2009
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to help for actionscript 2010-05-10 13:58:37 Reply

thats not a snippit?


BBS Signature
4urentertainment
4urentertainment
  • Member since: Aug. 1, 2008
  • Offline.
Forum Stats
Moderator
Level 13
Game Developer
Response to help for actionscript 2010-05-10 14:09:32 Reply

At 5/10/10 01:58 PM, mdpreado wrote: thats not a snippit?

Yes, yes it is. Do you even know what that means?

This is completely irrelevant. Your problem is that you're missing a curly bracket at the end. That's it.

mdpreado
mdpreado
  • Member since: Oct. 17, 2009
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to help for actionscript 2010-05-10 14:33:08 Reply

mayb im stupid

help for actionscript


BBS Signature
milchreis
milchreis
  • Member since: Jan. 11, 2008
  • Offline.
Forum Stats
Member
Level 26
Programmer
Response to help for actionscript 2010-05-10 14:35:39 Reply

At 5/10/10 02:33 PM, mdpreado wrote: mayb im stupid

yes you are, that one closes the if statement's block.

indent your code!

4urentertainment
4urentertainment
  • Member since: Aug. 1, 2008
  • Offline.
Forum Stats
Moderator
Level 13
Game Developer
Response to help for actionscript 2010-05-10 14:37:29 Reply

At 5/10/10 02:33 PM, mdpreado wrote: mayb im stupid

*Facepalm*

I have no idea what you've written on that picture. But please, for the love of Joe. Just add. Another. Curly. Bracket.

There is a missing curly bracket. Add it. It's after the one already there. You need to add another one. Just put a curly bracket at the end. To close the clipEvent statement. Just add one more curly bracket at the end, after the one that's already there.

It's not that hard really...

mdpreado
mdpreado
  • Member since: Oct. 17, 2009
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to help for actionscript 2010-05-10 14:45:09 Reply

yeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee h

cheers i know its hard helping a stupid person


BBS Signature
Callum123456
Callum123456
  • Member since: Mar. 7, 2009
  • Offline.
Forum Stats
Member
Level 24
Blank Slate
Response to help for actionscript 2010-05-10 14:51:02 Reply

At 5/10/10 02:45 PM, mdpreado wrote: yeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee h

cheers i know its hard helping a stupid person

It's even harder to help you.

mdpreado
mdpreado
  • Member since: Oct. 17, 2009
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to help for actionscript 2010-05-10 16:06:30 Reply

that maded me sad


BBS Signature
mdpreado
mdpreado
  • Member since: Oct. 17, 2009
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to help for actionscript 2010-05-11 16:29:17 Reply

MODERATOR CLOSE THIS NOW CAUSE ITS POINTLESS


BBS Signature
Innermike
Innermike
  • Member since: Sep. 11, 2009
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to help for actionscript 2010-05-11 16:59:53 Reply

At 5/11/10 04:29 PM, mdpreado wrote: MODERATOR CLOSE THIS NOW CAUSE ITS POINTLESS

It should be left open to make an example of people like you. Its not often callum gets angry, you've been very naughty , let this thread be open to people so that we may mock you.

that is all gents

nobody

BBS Signature
JoSilver
JoSilver
  • Member since: Sep. 21, 2007
  • Offline.
Forum Stats
Member
Level 17
Melancholy
Response to help for actionscript 2010-05-11 19:46:59 Reply

At 5/8/10 02:24 PM, mdpreado wrote: ok, i have flash cs4 and whenever i try to add actionscript to anything it says current selection cannot have actions applied to it so....... why does it do that and how can i get around it?

In AS3 object can't have code placed on them. trust me... it's better that way.

mdpreado
mdpreado
  • Member since: Oct. 17, 2009
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to help for actionscript 2010-05-12 14:44:04 Reply

At 5/11/10 04:59 PM, HDXmike wrote:
At 5/11/10 04:29 PM, mdpreado wrote: MODERATOR CLOSE THIS NOW CAUSE ITS POINTLESS
It should be left open to make an example of people like you. Its not often callum gets angry, you've been very naughty , let this thread be open to people so that we may mock you.
that is all gents

k im a attention seeker


BBS Signature
mdpreado
mdpreado
  • Member since: Oct. 17, 2009
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to help for actionscript 2010-05-16 13:20:25 Reply

........................................
........................................
........................................
........................................
........................................
........................................
........................................
........................................
........................................
........................................
........................................
........................................
........................................
........................................
............ hum


BBS Signature
mdpreado
mdpreado
  • Member since: Oct. 17, 2009
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to help for actionscript 2010-05-22 16:59:57 Reply

booooooooooooooooooooop


BBS Signature
Yambanshee
Yambanshee
  • Member since: Oct. 5, 2008
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to help for actionscript 2010-05-23 14:56:20 Reply

obvious troll is obvious?
ahhh... how i missed ng


AS2||AS3||Motox
Thanks to hdxmike for the sig :]

BBS Signature