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?
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.
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
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?
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.
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.
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 😄