A Flash Developer Resource Site

Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 42

Thread: [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [

  1. #21

    Re: Not appending my inputs in textfields

    Hi,

    try

    _level0.message = _level0.message add "D"

    Selection.getFocus() returns the currently selected text field.

    Your text fields can be within two movieclips and on mouseup you can store to a temp variable the value returned by Selection.getFocus().

    Now instead of hard coding which text field to add characters you can use your temp variable to point to the appropriate text field to add.
    (I have detailed it in an earlier post)

    But this is needed only if you have two textfields.


    Originally posted by ananta2002

    Example of button action(message is textbox):
    on (release) {
    _level0.message = message add "D";
    }
    How I will use here Selection.getFocus() for typing in both textfields.
    [Edited by Viswanath Parameswaran on 01-10-2002 at 10:54 AM]

  2. #22
    Junior Member
    Join Date
    Nov 2001
    Posts
    10
    Hi

    Can I display any unicode character in flash?

    Ananta

  3. #23
    Junior Member
    Join Date
    Nov 2001
    Posts
    10

    It is appending after last character of textfields

    Hi Viswanath

    This action is working but it is adding "D" character after last character of the textfield not in other place.

    _level0.message = _level0.message add "D"

    Ananta

  4. #24
    For each unicode character there would be a corresponding GLYPH. Usually it is this glyph that we see when we key in a letter. So for the same character different fonts will show different glyphs.

    Flash doesn't support unicode. But glyph corresponding to that unicode character can be brought into flash.

    This can be done either by setting the Operating System to show the same language into which the character falls or by creating your own font.

    Originally posted by ananta2002
    Hi

    Can I display any unicode character in flash?

    Ananta

  5. #25

    Re: It is appending after last character of textfields

    Hi,

    Could you explain further. I can't seem to get the exact issue. Because this would keep on adding the letter "D". If you use another button with letter "E", it will add "E" etc.

    [i]Originally posted by ananta2002 [/i
    Hi Viswanath

    This action is working but it is adding "D" character after last character of the textfield not in other place.

    _level0.message = _level0.message add "D"

    Ananta

  6. #26
    Junior Member
    Join Date
    Nov 2001
    Posts
    10

    Re: Re: It is appending after last character of textfields

    Hi Viswanath

    If I am typing "D" character using my visual keyboard in the textfield in anywhere than this "D" is coming after last character of the textfield. This "D" character should come after the curser. For example:

    This is a |visual keyboard.
    (Suppose I want to write "new" before "visual" word than see the problem ... it is coming after "keyboard.")

    Combination of conjuncts in flash is possible??

    Ananta

  7. #27

    Re: Re: Re: It is appending after last character of textfields

    Hi,

    Use Selection.getCaretIndex() to find the cursor position and then add the letter at
    that position. ie.,

    For the controller movie clip
    -----------------------------

    onClipEvent (mouseUp) {
    // gets activated only if you click in the text box
    if (Selection.getFocus() == "_level0.message") {
    // assigns the cursor position (index) to myVariable
    _root.myVariable = Selection.getCaretIndex();
    }
    }

    When you press the button we have to split the message display into two parts. One is from
    the begining till the cursor position and the other from the cursor position to the
    end. ie.,

    For the button
    --------------
    on(press){
    part1 = _level0.message.substring(0,_root.myVariable);
    part2 = _level0.message.substring(_root.myVariable,_level0 .message.length);
    _level0.message = part1 add "D" add part2
    _root.myVariable++;
    }

  8. #28
    Junior Member
    Join Date
    Nov 2001
    Posts
    10

    Re: Re: Re: Re: It is appending after last character of textfields

    Hi Viswanath

    Thanks for your help

    Now please solve my last question of 01-10-2002, I mean how to make dynamic conjunct combination making for Indian language in flash.

    Ananta

  9. #29

    Re: Re: Re: Re: Re: It is appending after last character of textfields

    Hi,
    I have made a sample application which uses conjunct characters. It is done in latin character set. The principle can be same for indian languages as well, if we are using ISCII character set.

    You can view and download it at:
    http://www.info-designers.com/flash/...l/conjunct.htm

    (Try in IE)

  10. #30
    Junior Member
    Join Date
    Nov 2001
    Posts
    10

    Re: Re: Dynamic text box

    Hi Vish

    Thanks for your help.
    I am just telling about that uploaded flash file.

    That conjunct making idea is really good. Before not giving any space is possible or not? I am getting one space after the conjunct in the output. It is always giving me trouble to delete after every conjunct.

    Suppose I have written a sentence already and I have missed one conjunct. If I am writing that one conjunct in the middle of the sentence than I am loosing my balance part of my sentence. I am getting result only first part of my sentence and that conjunct only.

    Ananta
    [Edited by ananta2002 on 02-05-2002 at 06:22 AM]

  11. #31
    aCtioNScRipTer
    Join Date
    Feb 2001
    Posts
    274
    Hi Viswanath,

    Is there anyway to prevent ppl from hacking flash game's highscore?

  12. #32
    Hi,

    If you are hacking without looking into the swf file,
    pass a dynamic random id to your game and check for it when receiving the score.

    If you can view inside a swf file, usually you will end up with the posted urls and game variable names. Which you can use to send to the corresponding url.

    You can use http referer to see if the variables are coming from the same domain, but this sometimes doesn't work with some browsers.

    In this case it would be good if the game is served through an ssl connection (through https). Thus the swf will not be cached and hence won't be able to look into it.

    This is what i have experienced. I will be glad to hear any new ways.

    Originally posted by hye
    Hi Viswanath,

    Is there anyway to prevent ppl from hacking flash game's highscore?

  13. #33
    aCtioNScRipTer
    Join Date
    Feb 2001
    Posts
    274
    Hi,

    If you are hacking without looking into the swf file,
    pass a dynamic random id to your game and check for it when receiving the score.

    Hmm....I doubt I understand this statement. Can you please elaborate more? normally my game goes this way: play the game first, login/register, score submitted automatically after login/register. so where should the random id go? So in my case do i create the random id in my game and pass it out while receiving the score?

  14. #34
    When the game starts it can call a server side script to pass back a random id (created by the server side script-ASP,PHP,CGI etc), the same id is saved in the session as well. When submitting the score after login/registration, you can pass the random id along with the score. On the server before saving or inserting the score in the db, just check the random id passed with the one in the session. If they are the same, you can go ahead and insert the score in the db.

    Originally posted by hye
    Hi,

    If you are hacking without looking into the swf file,
    pass a dynamic random id to your game and check for it when receiving the score.

    Hmm....I doubt I understand this statement. Can you please elaborate more? normally my game goes this way: play the game first, login/register, score submitted automatically after login/register. so where should the random id go? So in my case do i create the random id in my game and pass it out while receiving the score?

  15. #35
    aCtioNScRipTer
    Join Date
    Feb 2001
    Posts
    274
    ic...THANKS A LOT!

  16. #36
    Senior Member Jaffasoft's Avatar
    Join Date
    Apr 2001
    Location
    On Travel
    Posts
    1,588
    This has been a long time coming , but I just wanted to thank Viswanath Parameswaran was tremendous of what you were able to help me do, and got accomplished...
    Hope you can drop by more sometime and lift us out of the duldrums to show us some really interesting stuf!!

  17. #37
    aCtioNScRipTer
    Join Date
    Feb 2001
    Posts
    274

    XMLSocket

    this is the code I wrote. I kept getting both connected and failed. Where did I went wrong???

    Code:
    socket = new XMLSocket();
    socket.onConnect = checkConnection;
    if (!socket.connect("127.0.0.1", "55555")){
    	trace("connection failed");
    }else{
    	trace("connected");
    }
    function checkConnection(success){
    	if(success){
    		trace("successful");
    	}
    	else{
    		trace("failed");
    	}
    }

  18. #38

    Re: XMLSocket

    Hi,
    You assume that if socket.connect is true, the connection is established. It is just the first step. (socket.connect(IP,PORT) seems to return true for all cases except when the port number is below 1024.) If it returns true, it DOESN'T mean connection is established. But if it returns false, the connection DID fail.(it is more of a check for failure than success)

    For connection to be true the second step also has to be true ie.,socket.onConnect has to return true.

    Drop the else part of the socket.connect condition from your code.(socket.connect(IP,PORT) is a necessary but not sufficient condition for the connection to be established.)

    Originally posted by hye
    this is the code I wrote. I kept getting both connected and failed. Where did I went wrong???
    [Edited by Viswanath Parameswaran on 02-22-2002 at 05:08 PM]

  19. #39
    aCtioNScRipTer
    Join Date
    Feb 2001
    Posts
    274
    I see... Sorry this is my first attempt to try out XMLSocket so my next qns might sound stupid to you. Here is my qns:

    Do I need a special web server in order for my XMLSocket to get connected?? I try 127.0.0.1 and some real web server but none of it returns me true for onConnect?

  20. #40
    You need a XML Socket Server.

    You can download one at

    http://www.moock.org/webdesign/flash/
    look for moock comm

    or

    Branden's Aqua Server
    http://www.figleaf.com/development/flash5/

    For more info about socket servers and flash checkout:
    http://www.ultrashock.com/ff.htm?htt...ser_part1.html

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