A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: [CS3] Script not working!

  1. #1
    Junior Member
    Join Date
    Jan 2008
    Posts
    6

    [CS3] Script not working!

    Hello, I'm trying to make this script work with my whmcs domain checker. This script works when I use the Flash provided "ACTUAL SUBMIT" button, but when I try to put this code on a button transformed image, it doesn't want to work for me!

    Code:
    function clicked()
    {
        var my_lv = new LoadVars();
    	my_lv.domain = domainname.text;
    	my_lv.ext = ext.text;
    	my_lv.direct="true";
    	my_lv.submit="Go";
    	my_lv.send("http://www.evadehost.com/client/domainchecker.php","_self","POST");
    }
    my_search.addEventListener("click",clicked);
    Why it doesn't work? I think those commands (clicked) are for the flash button. I'm not sure though. But for now, this is bs!


    Thanks in advance!
    - Mike

  2. #2
    Senior Member
    Join Date
    May 2002
    Posts
    1,017
    Click is only an event for the Simple Button component.
    use onRelease event eg:

    Code:
    function clicked()
    {
        var my_lv = new LoadVars();
    	my_lv.domain = domainname.text;
    	my_lv.ext = ext.text;
    	my_lv.direct="true";
    	my_lv.submit="Go";
    	my_lv.send("http://www.evadehost.com/client/domainchecker.php","_self","POST");
    }
    my_search.onRelease = clicked;
    while (2+2 == 4) {
    drink ("bourbon");
    }
    gotoAndStop("bed");

  3. #3
    Junior Member
    Join Date
    Jan 2008
    Posts
    6
    Hmm, I'm getting these following errors:

    function clicked()
    • Statement must appear within on/onClipEvent handler


    my_search.onRelease = clicked;
    • Statement must appear within on/onClipEvent handler


    Thanks for the reply!

  4. #4
    Senior Member
    Join Date
    May 2002
    Posts
    1,017
    Don't put the code on the symbol but on a frame. if you want to put it on the button use this:

    Code:
    on (release) {
    
            var my_lv = new LoadVars();
    	my_lv.domain = domainname.text;
    	my_lv.ext = ext.text;
    	my_lv.direct="true";
    	my_lv.submit="Go";
    	my_lv.send("http://www.evadehost.com/client/domainchecker.php","_self","POST");
    
    }
    while (2+2 == 4) {
    drink ("bourbon");
    }
    gotoAndStop("bed");

  5. #5
    Junior Member
    Join Date
    Jan 2008
    Posts
    6
    How do you put it on a frame? Because I think it needs a listener. (total noob here ). Thanks a ton for your time.

  6. #6
    trace("AKA: Biro Barna");
    Join Date
    Oct 2007
    Location
    RO.Timişoara
    Posts
    1,403
    You simply select the frame ( click it ) and press F9 ( paste the code there ).



    | Windows MSN: birobarna [at] hotmail [dot] com | Skype: barna.biro |
    WebLog: http://blog.wisebisoft.com/ |
    | Software Developer / Flash & Flex Developer | Student ( Computer Science ) | Interested in: Sharing Knowledge |
    |
    Romanian Adobe Flash, Flex, AIR Forum: http://www.flashforum.ro/
    | By perseverance the snail reached the ark. |


  7. #7
    Junior Member
    Join Date
    Jan 2008
    Posts
    6
    Quote Originally Posted by Smilev
    Don't put the code on the symbol but on a frame. if you want to put it on the button use this:

    Code:
    on (release) {
    
            var my_lv = new LoadVars();
    	my_lv.domain = domainname.text;
    	my_lv.ext = ext.text;
    	my_lv.direct="true";
    	my_lv.submit="Go";
    	my_lv.send("http://www.evadehost.com/client/domainchecker.php","_self","POST");
    
    }
    For some reason, that code doesn't seam to work properly. When I press the go button, it does go to the domainsearch.php but I get an undefined variables error. Do you know why?

  8. #8
    Senior Member
    Join Date
    May 2002
    Posts
    1,017
    From the information you provide I can only guess.
    Which variables are undefined? Where are placed the textfields domainname and ext (it might be a scope problem)? Also what variables is the php script expecting?
    while (2+2 == 4) {
    drink ("bourbon");
    }
    gotoAndStop("bed");

  9. #9
    Junior Member
    Join Date
    Jan 2008
    Posts
    6
    It's expecting domain.text and ext.text. I can upload the FLA file if you want, and you could take a look at it?

    Thanks again.

  10. #10
    Senior Member
    Join Date
    May 2002
    Posts
    1,017
    yes, upload it. I'll have a look.
    while (2+2 == 4) {
    drink ("bourbon");
    }
    gotoAndStop("bed");

  11. #11
    Junior Member
    Join Date
    Jan 2008
    Posts
    6
    50$ later, I got someone to fix it. Thanks alot for all your time and support.

    Greatly appreciated.

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