A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: JavaScript integration

  1. #1
    Junior Member
    Join Date
    Oct 2001
    Posts
    3
    I implemented a real-time clock using Flash, ActionScript and JavaScript. The ActionScript code calls a getURL() function that calls a JavaScript function to start the clock. The JavaScript function uses a setTimeout() function to set/refresh the time string displayed in the Flash movie by calling setVariable() function. I named the Flash object "clock", so in the JavaScript function, the statement goes like this: window.document.clock.setVariable(<variable name>, <value>). The thing works like charm in IE but doesn't work in Netscape. Netscape thinks, "Java object has no field or method named setVariable". Do any of you guys have any ideas how to make this thing work in Netscape?

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    use swliveconnect=true within the <embed> thing for N4.x nd forget about N6
    The real name might be TSetVariable() and it is likely to be case-sensitive as well
    Apart from that - while this is a nice project to have things communicate with each other, why dont you just make a clock in flash? It would run on any browser and take much less resources

    Musicman

  3. #3
    Junior Member
    Join Date
    Oct 2001
    Posts
    3

    Thank you

    Originally posted by Musicman
    Hi,

    use swliveconnect=true within the <embed> thing for N4.x nd forget about N6
    The real name might be TSetVariable() and it is likely to be case-sensitive as well
    Apart from that - while this is a nice project to have things communicate with each other, why dont you just make a clock in flash? It would run on any browser and take much less resources

    Musicman
    Thank you very much for the quick reply. Well I have the string swliveconnect=true in the tag. I guess the problem is that Netscape doesn't recognize "SetVariable" method. I think you are right: I should develop the thing in Flash. Since I am a programmer but new to the Flash world, I just need to find an ActionScript function or something else in Flash that can read system clock.

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    check Date() object in AS dictionary
    current = new Date();
    hours = current.getHours();
    it is very much the same as in javascript

    Musicman

  5. #5
    Junior Member
    Join Date
    Oct 2001
    Posts
    3
    Originally posted by Musicman
    Hi,

    check Date() object in AS dictionary
    current = new Date();
    hours = current.getHours();
    it is very much the same as in javascript

    Musicman
    Hi, Musicman,
    Thank you very much. I will check it out. I am sure I am going to come back with more questions to bother you the heck out of it... :-D

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