A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [F8] Problem with vote button

  1. #1
    Junior Member
    Join Date
    Aug 2006
    Posts
    13

    Unhappy [F8] Problem with vote button

    The vote button displays onLoad instead of the number from http://topwebcomics.com/rankimages/p...x?comicid=8264.
    The code is as follows
    PHP Code:
    lv = new LoadVars();
    lv.load("http://topwebcomics.com/rankimages/plaintext.aspx?comicid=8264");

    lv.onLoad = function(){
    str unescape(this).split("\r\n").join("");
    arr str.split("=");
    rank_txt.text arr[0];
    }; 

    click_btn.onRelease = function(){
        
    getURL("http://topwebcomics.com/vote/8264/default.aspx""_top");

    Note that it displays properly on my computer but not when it's online.
    Check it out for yourself http://lazylonewolf.comicgenesis.com/
    Thanks for the help last time.

  2. #2
    Junior Member
    Join Date
    Aug 2006
    Posts
    13
    Wait, does AllowScriptAccess affect it? It's inside <param> with it's value on "sameDomain".

  3. #3
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    for online usage, you'll need to pass the remote server data
    via a proxy script that sits on your server.

    Flash will consider the remote data to have come from its
    own domain and will not fail silently due to security measures.

    i use PHP for this - proxy.php
    PHP Code:
    <?php 
    $dataURL
    =$_POST["dataURL"];
    readfile($dataURL); 
    ?>
    in Flash -
    PHP Code:
    lv = new LoadVars(); 
    lv.dataURL "http://topwebcomics.com/rankimages/plaintext.aspx?comicid=8264";
    lv.sendAndLoad("http://yourDomain/proxy.php",lv,"POST"); 

    lv.onLoad = function(){
    arr unescape(this).split("="
    myTxt.text arr[0]; 
    }; 
    example -
    http://www.jackleaman.co.uk/gameVote.html
    Last edited by a_modified_dog; 10-11-2008 at 08:55 AM.

  4. #4
    Junior Member
    Join Date
    Aug 2006
    Posts
    13
    Okay, can you check if what I did is right?
    1.Made a proxy.php file only containing the code you've given
    2.Changed the actionscript code from this
    PHP Code:
    lv = new LoadVars();
    lv.dataURL "http://topwebcomics.com/rankimages/plaintext.aspx?comicid=8264";
    lv.sendAndLoad("http://yourDomain/proxy.php",lv,"POST");

    lv.onLoad = function(){
    arr unescape(this).split("=")
    myTxt.text arr[0];
    }; 
    to this:
    PHP Code:
    lv = new LoadVars();
    lv.dataURL "http://topwebcomics.com/rankimages/plaintext.aspx?comicid=8264";
    lv.sendAndLoad("http://lazylonewolf.comicgenesis.com/proxy.php",lv,"POST");

    lv.onLoad = function(){
    arr unescape(this).split("=")
    rank_txt.text arr[0];
    }; 
    3.Uploaded the proxy.php and new .swf file to the FTP server.
    4.Updated the comic

    but it still displays onLoad
    Plus, I'm not sure if ComicGenesis' server supports php cause it's only for webcomics.
    Anyway thanks for all the help again.

  5. #5
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    upload this as phpinfo.php
    PHP Code:
    <?php
    phpinfo
    ();
    phpinfo(INFO_MODULES);
    ?>
    go to it in your browser
    do you see the info ?

    if not, check with your service provider.
    ask if they can enable PHP on your account.

  6. #6
    Junior Member
    Join Date
    Aug 2006
    Posts
    13
    Can't even access the file from the browser because of permission issues, displays a code 403 "Forbidden". Can't change the permission too

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