Skip to main content
May 10, 2013
Question

Quotation marks in ActionScript

  • May 10, 2013
  • 1 reply
  • 652 views

Hi,

I'm a complete flash novice and I'm having a few issues. Some friendly advice would be really appreciated!

When I've used actionscript to, for instance, link to another  scene or to input a personalised welcome message for the user it seems  to ignore the green text in quotation marks (in the first instance,  which scene it is to go to, and not displaying the  word welcome before the input data.

I don't know if I've described the problem adequately but does anybody have any idea what I've done wrong?

Thanks.

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
May 10, 2013

If you show the code that doesn't work it will be easier to say whether it's the code or not.

May 10, 2013

on (release) {
    gotoAndPlay("Scene 2", 1);
}

Ned Murphy
Legend
May 13, 2013

The code looks okay, except I will recommend two things...

1) Don't place code 'on()' objects.  Use the timeline and instance names instead.

ex:  yourBtn.onRelease = function(){

             gotoAndPlay("Scene 2", 1);

      }

2) avoid using scenes unless some instructor is demanding their use.  Use movieclips and/or sections of the scene 1 timeline.

As far as troubleshooting your issue, if the code is suposed to stop at that frame then use gotoAndStop() instead of gotoAndPlay()

If it is supposed to play starting at frame 1 of scene 2, then put a trace in the first frame to see if it goes there... ex: trace("in scene 2"); ...  it is possible it is going there but leaves so fast you never see what is there.