Send variable from Flash to HTML

Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default Send variable from Flash to HTML

    I have a quiz in Flash. I want to take the quiz results (testscore) and send it to an HTML page to be assigned to a variable. How do I send variables from a .swf to HTML?

    Here is my Flash script to get the testscore variable:

    correctText = correctQuestion;
    numberQuestionText = questionsPerQuiz;
    testscore = 100* (correctQuestion / questionsPerQuiz);
    stop();

    Thanks in advance.
    Andrew


    AndrewTexas webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. Send Variable From ASP to Flash to ASP
      I'm really, really new to Flash and using Flash 8 Pro. This is what I'm trying to do. I have a list of cars, when someone clicks on a car, they...
    2. send a variable from flash to flashcom
      Hi All, I'm trying to send a variable from my flash project to the flash comm server. In my main.asc file, I use some remoting code to update a...
    3. Using Javascript to send a variable to FLASH
      Hello... If I send a variable to my site... Example --> http://mysite.com/?variable=test How do I import that variable into my FLASH...
    4. Way to send variable from Flash to parent HTML page?
      HTML page (with FORM on it) opens new window with interactive Flash; want to send info. on Flash page back to HTML. Saw one post with about 200...
    5. flash variable send to director
      I have a problem, I needs send since flash to director a string but i can't. I found a example in director support that send a variable numeric to...
  3. #2

    Default Re: Send variable from Flash to HTML

    Basically this can be done using javascript, but maybe you should elaborate
    on what you want to achieve finally. Anyway; basically you could do
    something like this.

    This will put 'testscore' in a form field:
    In head tag of our HTML page write this javascript function
    <script language="JavaScript" type="text/JavaScript">
    // <!--
    function passFlashVar(whichVar){
    document.forms.form1.textfield.value = whichVar;
    return;
    }
    // -->
    </script>

    Then create a form:
    <form name="form1" method="post" action="">
    <input name="textfield" type="text" size="25">
    </form>

    Then in your flashfile write:
    getURL("javascript:passFlashVar(" + testscore + ");");

    either attached to a button or a frame.
    Then do an HTML preview of yoru movie

    --
    ----------------------------------------------------------------------------
    -----------
    RESOURCES
    [url]http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash[/url]
    ----------------------------------------------------------------------------
    -----------
    TUTORIALS at
    [url]www.laiverd.com[/url]
    Flash & PHP Emailform
    Using textfiles in Flash
    ----------------------------------------------------------------------------
    -----------
    "AndrewTexas" <webforumsuser@macromedia.com> wrote in message
    news:bu1c4q$k8b$1@forums.macromedia.com...
    > I have a quiz in Flash. I want to take the quiz results (testscore) and
    send it to an HTML page to be assigned to a variable. How do I send
    variables from a .swf to HTML?
    >
    > Here is my Flash script to get the testscore variable:
    >
    > correctText = correctQuestion;
    > numberQuestionText = questionsPerQuiz;
    > testscore = 100* (correctQuestion / questionsPerQuiz);
    > stop();
    >
    > Thanks in advance.
    > Andrew
    >
    >

    Laiverd.COM Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139