dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: position MovieClip based on text index

  1. #1
    Cheese Lover
    Join Date
    Sep 2005
    Posts
    46

    position MovieClip based on text index

    I have a textbox with ... text in it, and I want to find the x position of a certain block of text. I can find the index easily, but how do I find that block's x position so that I can position a movieclip over it?

  2. #2
    It's a long way to the middle launchpad67's Avatar
    Join Date
    Oct 2004
    Location
    Prescott, Arizona
    Posts
    1,387
    Not sure I understand?
    If you click on the textbox, open the properties panel, then you can see the X & Y coords.

  3. #3
    Cheese Lover
    Join Date
    Sep 2005
    Posts
    46
    No, not that.

    If the textbox contains the text "blah blah bleh blah" and I want to cover the part that says "bleh" with a movieclip, how do I determine the position of the "bleh" so that I can move the movieclip accordingly?

  4. #4
    It's a long way to the middle launchpad67's Avatar
    Join Date
    Oct 2004
    Location
    Prescott, Arizona
    Posts
    1,387
    Ah, I understand now!
    Well, that could be a bit of a challenge. I would suggest, turning on the 'rulers' (under View>Rulers), then determine the coords of the text. You will have to mess around with the x/y settings to get the effect you want.

    Are you loading this text from an external file? Or is it just typed into the box on the stage?

  5. #5
    Cheese Lover
    Join Date
    Sep 2005
    Posts
    46
    It must be actionscripted, because the text is loaded dynamically based on the user's input.

  6. #6
    It's a long way to the middle launchpad67's Avatar
    Join Date
    Oct 2004
    Location
    Prescott, Arizona
    Posts
    1,387
    So the text is displayed based from an external text file...right? If that's the case, well good luck, I can't think of anyway to figure out where that text will be displayed. Neither can 'flash'.
    You should re-think your approach on this, mabey there is a better way to do what you want....which btw: I really don't understand. Can you tell me more about what you're trying to do here?

  7. #7
    Cheese Lover
    Join Date
    Sep 2005
    Posts
    46
    Parse emoticons. Img tags wont work because they insert a line break and the textbox is one line.

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