Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Community Beginner ,
Aug 19, 2015 Aug 19, 2015

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

TOPICS
ActionScript
364
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Aug 19, 2015 Aug 19, 2015

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.

Translate
Community Expert ,
Aug 19, 2015 Aug 19, 2015

above that call, use:

import flash.external.ExternalInterface;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 19, 2015 Aug 19, 2015

import flash.external.ExternalInterface;

ExternalInterface.call("recordScore()”);

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 19, 2015 Aug 19, 2015

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 19, 2015 Aug 19, 2015

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 19, 2015 Aug 19, 2015

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 19, 2015 Aug 19, 2015

because you fixed one of those quotes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 19, 2015 Aug 19, 2015

oh i see...it was the smart quotes that did it? I didn't even notice that until you mentioned it! That's a huge help for the future.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 19, 2015 Aug 19, 2015
LATEST

you're welcome.

(p.s when using the adobe forums, please mark helpful/correct responses, if there are any.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines