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

ExternalInterface issue

New Here ,
Feb 06, 2009 Feb 06, 2009

Copy link to clipboard

Copied

Hello there,

Im using a js file to make a application communicate with my swf using the ExternalInterface.
in the javascript file i use something like so:

var ctlPlanta;
ctlPlanta = document.GetAxControl("filme");
ctlPlanta.CallFunction("<invoke name=\"mudarFilter\"><arguments><string>"+UltimoFi ltro +"</string></arguments></invoke>");

This works just fine if i call it this once in a while, the problem comes when i call it multiple times per second.. lets say around 1000 times per second the swf file dont do nothing.. not even freezes up its like he accepts the values 1 time and then just ignore the javascript.
Any sugestions?

i thought about making an array of values in the javascript and once in a while call the array from the actionScript the problem is that the externallInterface do not know what is the javascript in use because its a activeX control and its not embebed in some html page.
Seems that the call function in actionScript works only for html.. is there any solution to for this problem?

tks in advance.

Sincerely,
Pedro
TOPICS
ActionScript

Views

503

Translate

Translate

Report

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
LEGEND ,
Feb 07, 2009 Feb 07, 2009

Copy link to clipboard

Copied

I don't know how often Flash checks for ExternalInterface calls, but there's a good chance it's limited to the frame rate. That's limited to 120 fps, and you're trying to call it 1000 times a second.

What are you doing that you would expect to see updated 1000 times a second? The user's monitor is probably only going to update 60-75 times a second anyway.


Votes

Translate

Translate

Report

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
New Here ,
Feb 09, 2009 Feb 09, 2009

Copy link to clipboard

Copied

hi Colin,
Tks for reply, i really dont need that to update the user interface 65 or more times per second.. a couple of times per second would be ok, what i need to do is update several objects per second. the problem is the values arrive at javascript one by one (around 6000 values every 3 seconds), and im sending them to flash as they arrive. and the result is written above :P

Sincerely,
Pedro

Votes

Translate

Translate

Report

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
LEGEND ,
Feb 09, 2009 Feb 09, 2009

Copy link to clipboard

Copied

Even Javascript receiving 2000 events per second sounds unlikely, but if it does, could Javascript collect the data values together, and send them to Flash in groups?


Votes

Translate

Translate

Report

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
New Here ,
Feb 10, 2009 Feb 10, 2009

Copy link to clipboard

Copied

that was a solution i thought about.. send the values in a array from time to time. But unfortunately the problem is that this is a real time application.. i have to show the values by the time i receive them. Tks fot the replys tho.

i've managed to make it work but its very heavy load for the flash and takes a while to open the activeX obj. maybe because the JavaScript try's to send the values even before the hole swf opens. gonna try to put some kind of timer before JavaScript send the values.

Votes

Translate

Translate

Report

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
LEGEND ,
Feb 10, 2009 Feb 10, 2009

Copy link to clipboard

Copied

Is 1/30th of a second delay not real time enough? What sort of information is it that must be seen within 1/2000th of a second?

As I mentioned before, monitors only go at 60 - 75 frames per second, so at least 300 of your readings will have arrived since the last time the display was updated.


Votes

Translate

Translate

Report

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
New Here ,
Feb 11, 2009 Feb 11, 2009

Copy link to clipboard

Copied

LATEST
the kind of information that is vital to know by the second for example something like energy/electric power that does not accumulate in any warehouse and is vital to know how much u are producing / being consumed 😛 and your right even tho im updating the values as i received them with some sort of trigger they update (visually) by the frame rate. not much to do there.but none is loss because the next value update from the system is made every 3 seconds, so there is plenty of time to show it 😄

Votes

Translate

Translate

Report

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