A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Problem

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    3

    Exclamation Problem

    Hi i need to do a form composed by a text field and a button.
    on the press of the button i should output a string that is composed by a default part (ie: http://www.example.com) and by the text inserted in the text form (ie: hello) in order to obtain a string like this one (http://www.example.com#hello) how can i do this?

    Thanks for ur help.

    Ciao

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    PHP Code:
    // button, input textfield and code all on main timeline

    defaultString "http://www.example.com#";

    myButton.onRelease = function(){ // instance name of buttton
    addString myText.text// instance name of input textfield
    fullString defaultString addString;
    trace(fullString); // open output window with result
    }; 

  3. #3
    Junior Member
    Join Date
    Nov 2009
    Posts
    3
    how can i make it open a browser window with the address composed above?

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    defaultString = "http://www.example.com#";

    myButton.onRelease = function(){
    addString = myText.text;
    fullString = defaultString + addString;
    trace(fullString);
    getURL(fullString, "_blank"); // open a new browser window
    };


    note: to open a url, either post the files to your server to test, or include your
    development folder to your safe locations in the Settings Manager

  5. #5
    Junior Member
    Join Date
    Nov 2009
    Posts
    3
    ok, it works but it strangely make the new url like this
    http://www.example.com/#text adding a / that i do not want.

    thank you for your help, u are grt!

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