How to get Results.ScorePercent value from SL to SWF

Oct 11, 2013

Good day

i´ve a simple quiz project, then in the results slide i need pass Results.ScorePercent to swf custom file, then i try using into swf

import flash.external.ExternalInterface;

Object(this).name_03.text = ExternalInterface.call('GetPlayer().GetVar','Results.ScorePercent');

also reading other posts here i try using Adjust Variable, (Create one variable and assign value from scorepercent) from Trigger Wizzard on triggers panel from slide but when i´m try test this i get "Results.ScorePercent" in text on the swf file

If i try to get other variable for example Attempts

import flash.external.ExternalInterface;

Object(this).name_03.text = ExternalInterface.call('GetPlayer().GetVar','Attempts');

it works!.. i like to receive some help

4 Replies
Steve Gannon

Hi Carlos,

Try this:

1. Create a custom variable called 'scorePercent' (or whatever you want to call it). Be sure it is a 'Number' variable and not a 'Text' variable.

2. On your Results slide, create a trigger that assigns 'scorePercent' (or whatever your custom variable is named) to Variable: 'Results.ScorePercent'. (Be sure that your making the assignment to Variable and not Value.)

Now use scorePercent as the variable you pass to your SWF. I'm thinking this should work.

Steve Gannon

Create a text box anywhere on your Results slide and type in %ScorePercent%. When you run through the quiz and reach the Results slide, does the value of ScorePercent properly appear?

If so, then it might be in your Flash syntax. Make sure your using quotes properly in the ExternalInterface.call syntax and that you have the value being retrieved in a numeric variable in Flash. 

This discussion is closed. You can start a new discussion or contact Articulate Support.