Be a Supporter!

Problem with my ActionScript?

  • 331 Views
  • 6 Replies
New Topic Respond to this Topic
Pookeh
Pookeh
  • Member since: Jul. 22, 2008
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Problem with my ActionScript? 2008-07-22 07:07:56 Reply

Hey, I'm sort of new to Newgrounds and to ActionScript I know how to tween and use the Tools, but the Actionscript has me confused. I've looked up a few Actionscript Tutorials, and noticed a problem every time I try to post this script:

http://i36.tinypic.com/1hyoie.png

Or any script with a ClipEvent in it.

I've tried adding it to the frame on the main Timeline, or to the Timeline of the Movie Clip I have individually. In the window below I tried putting it in both and got the same Error:

http://i36.tinypic.com/2vs40mh.png

I'm using Flash 8 and I'm trying to make a small, and pretty simple game.

WolfAkela
WolfAkela
  • Member since: Dec. 19, 2005
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to Problem with my ActionScript? 2008-07-22 07:10:45 Reply

Just read the error.

Clip events are not permitted in movie clip instances

You wrote your code on the timeline.

Making a movieclip == highlight a drawing, F8, MovieClip option, OK.

Click on that MC, open the Actions window, paste your code.

Ctrl+Enter

Cthun
Cthun
  • Member since: Jun. 25, 2008
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to Problem with my ActionScript? 2008-07-22 07:11:37 Reply

Uhmm, Do you have the actionscript on the MovieClip?

WolfAkela
WolfAkela
  • Member since: Dec. 19, 2005
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to Problem with my ActionScript? 2008-07-22 07:12:30 Reply

And just in case, the equivalent of

onClipEvent(enterFrame){

for the timeline is

this.onEnterFrame = function(){

I would recommend writing your code on the timeline rather than in the movieclip, so if you ever move on to ActionScript 3.0 in the future, you won't get boggled, since it does not allow code inside movieclips.

Pookeh
Pookeh
  • Member since: Jul. 22, 2008
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Problem with my ActionScript? 2008-07-22 07:17:58 Reply

I put the code in the Movie Clip(Not on the Main Timeline) and the error still comes up.

dELtaluca
dELtaluca
  • Member since: Apr. 16, 2004
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to Problem with my ActionScript? 2008-07-22 07:22:04 Reply

At 7/22/08 07:17 AM, Pookeh wrote: I put the code in the Movie Clip(Not on the Main Timeline) and the error still comes up.

did you put it 'on' the movieclip, or 'in' it, if you went inside the movieclip, and put it on a frame inside the clip then you are just doing the same thing again basicly, you have to click on the movieclip (to highlight it, not go inside of it) and put it on the actions then so its 'on' the clip rather than 'in' it


using ShamelessPlug; NapePhysicsEngine.advertise();

BBS Signature
Pookeh
Pookeh
  • Member since: Jul. 22, 2008
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Problem with my ActionScript? 2008-07-22 07:34:14 Reply

I tried what you said and it didn't come up with the error anymore, but it says the class or interface cannot be loaded. I think I might be able to figure it out from there though. Thanks!