Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Feb 25, 2013 Feb 25, 2013

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?

TOPICS
ActionScript
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 25, 2013 Feb 25, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2013 Feb 28, 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   

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 01, 2013 Mar 01, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 01, 2013 Mar 01, 2013

fair enough, thats kind of annoying seeing how ive got a project outline i cant really stray that far from, anyone know if this can be done in AS3? i tried myself but i cant into AS3 and i appear to be goofing hard

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 01, 2013 Mar 01, 2013

In AS3 I am able to use the variable for the scene parameter, but _global was dropped in AS3.  You have to create a separate "global" class to help get around that.  If you search Google using "AS3 _global" you will no doubt find an example you can follow.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 01, 2013 Mar 01, 2013

gah, tried testing this out in AS3 but it isnt working, i have 4 scenes, s1, s2, lel and finally s3 in that order

s1 has a button to go to s2

s2 has a button to go to s1, an input text field and a button to go to whatever frame is specified in the input textbox

what am i doing wrong?

http://pastebin.com/vw7fwdrH

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 01, 2013 Mar 01, 2013

It's hard to say.  What kind of error messages are you getting or what is otherwise not happening that you expect to.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 03, 2013 Mar 03, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 03, 2013 Mar 03, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 03, 2013 Mar 03, 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 >_>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 03, 2013 Mar 03, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 03, 2013 Mar 03, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 03, 2013 Mar 03, 2013

thanks for the help, you have saved my arse

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 03, 2013 Mar 03, 2013
LATEST

You're welcome

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines