-
LocalConnection....
I've successfully got 1 move to talk to a seperate movie on the same html page, and I can use a button to 'send' the relevant info.
However, I cannot make the movie send the info 'on load' instead of clicking the button to send it.
This is the code that successfully sends the info and I have it on the button:
Code:
on (release) {
sendingLC = new LocalConnection();
sendingLC.send("showConnect", "myFunction");
}
but if I just put this code on the first frame, nothing happens:
Code:
sendingLC = new LocalConnection();
sendingLC.send("showConnect", "myFunction");
Can anyone tell me what I'm doing wrong.... Thanks
-
I'm just guessing, but many times you get this kind of issues in Flash: the reason is that until the movies are fully loaded or something, the LocalConnections are not broadcasted.
You should create an asynchronous script to cast the LocalConnection, so that it doesn't fail if it doesn't manage to make the connection the first time, while the movies are still not ready for it.
A setInterval function should work great, the .send(); function should return true or false, or something. If it doesn't you should create a backcall from movie #2 to movie #1 to a function that tells you that the connection was good, in such case the loop can end.
Hope this helps,
Ascanio.
p.s. You should give a look at the JavaScript XmlHttpRequest (just google it to find a bunch of resources) object and it's inner workings, if you don't fully understand what I've said.
-
aha, yes indeed that is the score...... got it sorted now. Thanks for your help[ and advice :)