Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 8 of 8

Thread: <img> from Library in textField?

  1. #1

    <img> from Library in textField?

    The AS3 documentation for the <img> tag in htmlText says:
    src: Specifies the URL to an image or SWF file, or the linkage identifier for a movie clip symbol in the library. This attribute is required; all other attributes are optional. External files (JPEG, GIF, PNG, and SWF files) do not show until they are downloaded completely.
    So you can stick images from your library in html textFields... the question is how?

    I've got this lovely flash interface that's going on a CD-Rom. It's entirely contained in one file-- and I'd rally rather not have a "resources" folder just for three lousy icons.

    Does anyone have an example of how this worked, even under AS2?

  2. #2
    2006-11 GlosRFC - Searching 8,168,684,336 brain cells

  3. #3
    So basically... despite the AS3 documentation telling you you can add an IMG from the library... you can't.

    Because the only method for doing so (linkage identifiers) requires you to migrate the entire project back to AS2.

  4. #4
    myTxt.htmlText = "some html stuff and <img src="anImage.jpg"/> the image";

  5. #5
    oh, linkage identifiers, scratch that last one, you can use linkage in AS3, say you have a movie clip with the linkage name goCart

    Code:
    addChild(new goCart());

  6. #6
    Actually the trick is to wrap the bitmap image in the library inside a Movieclip and give THAT a Linkage Class name (eg "myLibraryImage"). Then in your html textfield just use that name in the src attribute :

    <img src="myLibraryImage" width="100" height ="50"/>

    Cheers

  7. #7
    Quote Originally Posted by meerkatlookout View Post
    Actually the trick is to wrap the bitmap image in the library inside a Movieclip and give THAT a Linkage Class name (eg "myLibraryImage"). Then in your html textfield just use that name in the src attribute :

    <img src="myLibraryImage" width="100" height ="50"/>

    Cheers
    Thanks meerkatlookout~~,you give me the answer~~

  8. #8
    Quote Originally Posted by meerkatlookout View Post
    Actually the trick is to wrap the bitmap image in the library inside a Movieclip and give THAT a Linkage Class name (eg "myLibraryImage"). Then in your html textfield just use that name in the src attribute :

    <img src="myLibraryImage" width="100" height ="50"/>

    Cheers
    But also there's no need to bother ourselves and use embedding or library to have a simple MovieClip inside of our TextField.

    Checkout www.doitflash.com

    the site provided a new OOP class named "TextArea" which is an extention to the original TextField.
    It allows us to have any MovieClip and SWF file in line of our texts and also provides lots of more features. we can communicate easily between our MovieClips and our project live and import them with our own tags rather than using only <img> tag! let us to have animated GIF images.... more and more!

    you'll love it and it will be a great help
    Downloading the platform is also free

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012