Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
You'll need to show some code - preferably just enough to demonstrate the issue, and explain where that code lives.
Copy link to clipboard
Copied
Ned Murphy wrote:
You'll need to show some code - preferably just enough to demonstrate the issue, and explain where that code lives.
mkay
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
It's hard to say. What kind of error messages are you getting or what is otherwise not happening that you expect to.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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 >_>
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
thanks for the help, you have saved my arse
Copy link to clipboard
Copied
You're welcome
Find more inspiration, events, and resources on the new Adobe Community
Explore Now