User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Javascript to SWF... stuck :-(

  1. #1
    No Products Registered

    Join Date
    Jul 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript to SWF... stuck :-(

    Hello, can anyone tell me how to send a variable to a flash file created in the SWF exporter whilst it is running?

    I have experimented with the following JS code:
    SetVariable("/:param1","test string");

    But the 'A string has been received' event never triggers? I've read the help files about sending params on start up, but I want to send variables to the flash file whilst it runs.

    Thanks,

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    SoftWarewolf's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    929
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Javascript to SWF... stuck :-(

    use functions

    in the html your game is embedded into:
    function data() {
    var myval = "datahere";
    return myval;
    }

    in mmf:
    call function "data"
    then the data is found immediately on JSStrResult$( "Flash® Player" )

    you don't need a condition to wait for it

  3. #3
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Jan 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Javascript to SWF... stuck :-(

    Wrote this tutorial a while ago. You might find it helpful. Its about JavaScript interactions and cookies. I think the JS is what you're looking for. Hope this helps!

    http://www.clickteam.com/website/usa/img/uploads/tutorials/download/FlashJSFunctionsAndCookies.zip


  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall Creator Pro

    Join Date
    Aug 2006
    Posts
    540
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Javascript to SWF... stuck :-(

    Hello cage244 , ( or hello to all of you who might help

    thanks for writing the javascript tutorial.
    I have run into several issues, however : there's a problem with the php file

    a)setcookies.html : it works fine, I am asked to set cookie 1 and cookie 2 , then I press the button "set cookies"
    b)problem 1 : from there it seems to WANT TO go to SWF-JS-app.php AND NOT getcookies.php as mentioned in the tutorial , so I renamed getcookies.php to SWF-JS-app.php
    c)after doing so, I get this error message :
    "syntax error, unexpected T_LNUMBER in ......../javatest/SWF-JS-app.php on line 46"
    I checked the line 46 in the php, and it says :
    $CookieExpire = time()7200;
    which of course I don't understand.
    Maybe I should change the 7200 value ??

    thanks for helping ,
    eric


  5. #5
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Javascript to SWF... stuck :-(

    I believe for the $CookieExpire you should have time(7200);

  6. #6
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall Creator Pro

    Join Date
    Aug 2006
    Posts
    540
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Javascript to SWF... stuck :-(

    thanks Rickycombo, I no longer get the error message!

    However , the swf that appears ( "called"by the php file I figure ) doesn't work as intended by the tutorial.

    I was supposed to set the strings for two cookies in setcookies.html.
    Then the strings I had set were supposed to appear in the swf file after clicking buttons. But that doesn"t work. I uploaded the swf file from the tutorial, it didn't work.

    You can try the "process" from this address :
    test page
    The tutorial itself is hosted by clickteam in the tutorials page.
    eric

  7. #7
    Clicker SWF Export Module

    Join Date
    May 2010
    Location
    Tennessee, USA
    Posts
    247
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Javascript to SWF... stuck :-(

    Nice ESL site!

  8. #8
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall Creator Pro

    Join Date
    Aug 2006
    Posts
    540
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Javascript to SWF... stuck :-(

    Thank you Drcooper!
    However , it badly needs updating , and there's a lot of unfinished business in this project.

    If you're interested in ESL, there are two apps I made with mmf in the downloads area : one for irregular verbs ( hence the name od the website ) and the other for phonetics.

  9. #9
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall Creator Pro

    Join Date
    Aug 2006
    Posts
    540
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Javascript to SWF... stuck :-(

    Hello ,
    I am still testingjavascript tutorial ( which is here : tutorial
    but I can't get it to work.
    When the file : SWF-JS-app.php is "launched" , I get the error messages below :

    Warning: Cannot modify header information - headers already sent by (output started at /homepage...........3903/htdocs/irregularstuff.com/javatest/SWF-JS-app.php:3) in /homepages/.....htdocs/irregularstuff.com/javatest/SWF-JS-app.php on line 48

    Warning: Cannot modify header information - headers already sent by (output started at /homepages/42/d176943903/htdocs/irregularstuff.com/javatest/SWF-JS-app.php:3) in /homepages/42/d176943903/htdocs/irregularstuff.com/javatest/SWF-JS-app.php on line 49

    In the code,here is the php part :
    <?php

    $Cookie1Value = $_POST['CookieA'];
    $Cookie2Value = $_POST['CookieB'];

    $CookieExpire = time(7200);

    setcookie('CookieA', $Cookie1Value, $CookieExpire); //line48 above
    setcookie('CookieB', $Cookie2Value, $CookieExpire);
    //line49 above

    ?>

    CookieA and CookieB are global strings I set in mmf ( after following the tutorial).
    Thanks for helping !!
    eric

  10. #10
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Phi's Avatar
    Join Date
    Jan 2010
    Location
    England
    Posts
    1,840
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)

    Re: Javascript to SWF... stuck :-(

    I think you need $ at the start for variables, 'CookieA' will always be "CookieA". Or is that what you wanted?

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Javascript and MMF 2
    By nameless in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 18th December 2012, 03:23 AM
  2. Javascript example
    By Jeff in forum Vitalize
    Replies: 16
    Last Post: 13th September 2010, 03:27 PM
  3. communicate with javascript?
    By Chokito in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 8th June 2008, 05:28 PM

Posting Permissions

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