Skip to main content
Participant
August 19, 2015
Answered

Newbie scratching head...is my syntax wrong here?

  • August 19, 2015
  • 1 reply
  • 441 views

Hi. I am really new to flash. I have created a simple container app whose purpose is to:

1) play an embedded flv by clicking a button onscreen

2) activate an external interface call (this records the fact that the person has watched the video)

That's it.

I have it working partially. I have a button on scene 1 with the "click and go to next scene" code snippet attached to it. I click it and it happily moves on to scene 2 where the flv video plays beautifully. The problem happens when I try to insert the code that the external developer told me to use to make the connection between my flash file and IT's back end work.

Here is the recommended code:

ExternalInterface.call("recordScore()”);

Unfortunately, as soon as I enter this code, there is a syntax error and the movie no longer plays. I added the code on a frame at the end of the movie.

I am no sure that the syntax the developer sent was correct, nor do I know where to insert this code into the proper place.

Any feedback would be helpful.

Regards,

Jarrett

This topic has been closed for replies.
Correct answer srtowe

you have some errant code in your file, or it could be that you copied some weird mac quotes.  replace both those quotes and retest.

if there's still a problem,

click file>publish settings>swf>tick 'permit debugging'.

retest and double click the error message to find the problem.


ExternalInterface.call

(

"recordScore()"

);

This one worked. I'm not sure why...but the person that was here before me left it buried in a folder of notes. Hopefully it connects with the database.

1 reply

kglad
Community Expert
Community Expert
August 19, 2015

above that call, use:

import flash.external.ExternalInterface;

srtoweAuthor
Participant
August 19, 2015

import flash.external.ExternalInterface;

ExternalInterface.call("recordScore()”);

is now what i have, but it breaks the playback still.

srtoweAuthor
Participant
August 19, 2015

it gives me a syntax error:1095 a string literal must be terminated before the line break