Skip to main content
Participating Frequently
February 25, 2013
Question

having trouble with adobe flash cs6 accepting a variable for the scene calling gotoandplay

  • February 25, 2013
  • 4 replies
  • 1760 views

ive got a simple quiz going and i seem to have hit a bit of a brick wall, in order to avoid having a seperate wrong answer scene per question i decided to impliment a simple history system, with a string variable defined on the first scene as a global variable and set at every question, problem is whenever the function to go back is called flash spits out an error saying it cant accept a variable for this parameter, but surely that cant be right. i dont understand where im going wrong and as this is coursework i need to fix it quickly. any chance of help?

This topic has been closed for replies.

4 replies

anonymashAuthor
Participating Frequently
March 3, 2013

one last thing, is there a way to quickly convert a project from AS2 to AS3? ive put a great deal of work into this project and recreating it all would be a royal pain

Ned Murphy
Legend
March 3, 2013

You can quickly convert the file to be an AS3 file via the drop down selection in the Flash Publish Settings.  As far as changing the code goes, that's a line by line matter that no one has developed a tool for yet... and they'd be able to charge a hefty sum for it if they did.

anonymashAuthor
Participating Frequently
March 3, 2013

thanks for the help, you have saved my arse

anonymashAuthor
Participating Frequently
March 3, 2013

nevermind, i appear to have gone full retard for a moment when programming, the issue was with me misunderstanding what the trace() function does and adding an event listener to the wrong damn button >_>

anonymashAuthor
Participating Frequently
March 3, 2013

its just not going to the scene i specify in the textbox, it spits out this

TypeError: Error #1009: Cannot access a property or method of a null object reference.

    at test1_fla::MainTimeline/btnSetLVS_click()

the textbox in the functio i believe is the cause of the issue, but i dont know how, ive given it the instance name "txtIn", as referenced by the code

Ned Murphy
Legend
March 3, 2013

The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....

 

- is declared but not instantiated

- doesn't have an instance name (or the instance name is mispelled)

- does not exist in the frame where that code is trying to talk to it

- is animated into place but is not assigned instance names in every keyframe for it

- is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).

 

If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

If you are going to continue pursuing this using AS3 please start a new posting in the AS3 forum...

http://forums.adobe.com/community/flash/flash_actionscript3?view=discussions

Ned Murphy
Legend
February 25, 2013

You'll need to show some code - preferably just enough to demonstrate the issue, and explain where that code lives.

anonymashAuthor
Participating Frequently
March 1, 2013

Ned Murphy wrote:

You'll need to show some code - preferably just enough to demonstrate the issue, and explain where that code lives.

mkay

http://pastebin.com/fSbM8Fs5   

Ned Murphy
Legend
March 1, 2013

As best I can tell the error is telling the truth... you cannot use a variable for the scene parameter. 

What you should do is just not use scenes... they are a problematic entity carried over from the past in Flash that are really only suited for uses where navigation is not involved. 

Instead of scenes, either spread your content along the timeline in just one scene or use movieclips and control their visibility... or mix it up between those two.