These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Load and save swf states

ekschperte
Registered: Jun 12 2010
Posts: 29

Hi,

I have a SWf embed in a PDF and I am trying to load and save the state of the SWF at opening and closing the acrobat reader. The following code does not work... It doesn't save the state and fails to load the text field inputs. Why? :)
Also the variable "result" is everytime null.
Sorry, since HMTL tags are not allowed, I had to replaced the tags bei a "-". ;-)

... applicationComplete="loadInput()" ...

...
public function saveInput():void
{
var theXML:XML =
-inputForm-
-name-{nameInput.text}-/name-
-firstName-{firstNameInput.text}-/firstName-
-age-{ageInput.text}-/age-
-/inputForm-;
var result:Object = ExternalInterface.call("multimedia_saveSettingsString", theXML.toXMLString());
}

public function loadInput():void
{
var result:Object = ExternalInterface.call("multimedia_loadSettingsString");
if (result)
{
debug.text = "test";
var resultXML:XML = new XML(result.toString());
nameInput.text = resultXML.name.toString();
firstNameInput.text = resultXML.firstName.toString();
ageInput.text = resultXML.age.toString();
}
}

...
-mx:Form-
-mx:FormItem label="Name:"-
-mx:TextInput id="nameInput" change="saveInput()"/-
-/mx:FormItem-
-mx:FormItem label="First Name:"-
-mx:TextInput id="firstNameInput" change="saveInput()"/-
-/mx:FormItem-
-mx:FormItem label="Age:"-
-mx:TextInput id="ageInput" change="saveInput()"/-
-/mx:FormItem-
-/mx:Form-
...

ekschperte
Registered: Jun 12 2010
Posts: 29
Has anyone an idea? I already read http://pdfdevjunkie.host.adobe.com/RMA2_stateSave.shtml but it does not work for me... :-(