Pulling Variables from Flash AS3
March 14, 2013 12:00 AM
I have a flash file that has a string variable I would like to display on the screen in Lectora 11. I have tried using ExternalInterface.call, but can't get it to work.
Any help would be greatly appreciated.
FYI, I have imported flash.external.ExternalInterface.
Thanks, Ramona
Discussion (6)
More info:
In my flash file, I have:
ExternalInterface.call("VarLessonTitle('Password Training')");
In Lectora 11, I have:
A button that 'get Variable' with Flash Command - Name: LessonTitle Variable: flashTitle
I also have an action on the same button that 'Change Contents' in a Text box Targer: textTitle Value: flashTitle
I'm getting an "Invalid Flash Variable Name!!" error.
Any help would be greatly appeciated. I've been fighting this for a day now. :mad:
~Ramona
All you need to do is
ExternalInterface.call("VarLessonTitle.set('Password Training')");
Your variable in Lectora will change. You don't need any actions in the title to do that.
You have to use the variable on the same page where you're trying to access it with Flash. Otherwise Lectora won't initialize it and Flash communication will fail. Can it be the case that you don't use it anywhere on the page?
Ssneg,
If I understand you, I don't have to GetVariable in Lectora if I set the value from Flash? I've tried this and it didn't work. Any other ideas??
Also, I want to make sure that I understand that in the variable I put Var in front of it in Flash, but not in Lectora?
Thanks, Ramona
Ssneg,
Thanks for you help. I have figured why your idea wasn't working for me. I was trying to view it in the Preview/Debug and not published out. One would think that the Preview or Debug would work.
We just got this NEW version and was using SABA publisher before hand, but not doing as much in the publisher as we are trying now. Not impressed with Lectora v11.
~Ramona
FYI, I did see the post of all the things that won't work in Preview/Debug. Joy joy!
~Ramona
Discussions have been disabled for this post