A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Call A Javascript Function

  1. #1
    Junior Member
    Join Date
    Aug 2004
    Posts
    4

    Call A Javascript Function

    I'd like to do some thing that seems to be very simple for me, but I can't make this works. I'd like to call a javascript function that change the background color of the HTML page when determined frame is reached in my flash movie. I tried the getUrl("javascript:changeColor();"); putting it directly on the frame in the timeline to call the javascript but didn't work. I'm a graphic designer and at this moment I'm out of time to find the solution. Anybody can help me?
    Thank you very much.

    Marcelo.
    ----- o o o -----
    Marcelo Rocha de Souza
    Graphic Designer
    ------------------------
    Avenida Onze de Junho, 686 apto 42 A - 04041-002 - São Paulo - SP - Brazil
    Tel.: 5511 5082-2345
    E-mail: marcrock@uol.com.br
    ----- o o o -----

  2. #2
    The Flashman earl223's Avatar
    Join Date
    Sep 2000
    Location
    Marikina City, Philippines
    Posts
    876
    The code seems to be correct... soem problems i could think of is:
    1) Your javascript is the one that's wrong.
    2) maybe the playhead does not enter the frame with your getURL script???
    3) or maybe is because you used getUrl instead of getURL
    Last edited by earl223; 07-05-2005 at 10:22 AM.
    i eat actionscripts for breakfast

  3. #3
    Junior Member
    Join Date
    Aug 2004
    Posts
    4
    Thank you by your reply.
    1) My javascript function is very simple:

    <script language="JavaScript">
    <!--
    function changeColor()
    {
    document.bgcolor = "#FFFFFF";
    }
    //-->
    </script>

    2) The playhead reaches the frame, where I have a movieclip triggered by it

    3) I use getURL. Here I wrote wrong...
    ----- o o o -----
    Marcelo Rocha de Souza
    Graphic Designer
    ------------------------
    Avenida Onze de Junho, 686 apto 42 A - 04041-002 - São Paulo - SP - Brazil
    Tel.: 5511 5082-2345
    E-mail: marcrock@uol.com.br
    ----- o o o -----

  4. #4
    Senior Member
    Join Date
    Jun 2002
    Location
    Toronto, Canada
    Posts
    305
    thats strange, it should work... did you make sure that the javascript function works?? perhaps try calling it from html to make sure it works...

    Otherwise, i cant spot the problem :O

  5. #5
    Senior Member
    Join Date
    Jul 2003
    Posts
    156
    In your javascript try document.bgcolor = #FFFFFF;

    No quotes around color.

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