dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: LocalConnection....

  1. #1
    Animal Flasher RobbieC's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    242

    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

  2. #2
    Product Designer keyone.it's Avatar
    Join Date
    Aug 2001
    Location
    Rome, Italy.
    Posts
    1,625
    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.
    Altruism does not exist. Sustainability must be made profitable.

  3. #3
    Animal Flasher RobbieC's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    242
    aha, yes indeed that is the score...... got it sorted now. Thanks for your help[ and advice

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center