Load MovieClip inline in TextField
I want t开发者_开发问答o load a MovieClip inside a TextField inline with the text.
The TextField documentation says "HTML text that you assign to a text field can contain embedded media (movie clips, SWF files, GIF files, PNG files, and JPEG files)."
How can this be done with MovieClips? There must be a listener we can override.
source: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextField.html
From the documentation :
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.
You can add MovieClip by setting his linkage identifier in the src
attribute of the <img>
node.
You can use the <img>
tag to link to an swf.
Or, if you need to have more control, place an <img>
to load a placeholder, and use getImageReference to access and/or modify the image's Loader object. This will also allow you to set the loader content to visible = false
, and add a MovieClip to it using addChild
.
For sure MoveiClip can be imported into the TextField inline of your texts... But there's an easier way also possible from now on, not only the easier way but also more efficient and powerful.
Check out www.doitflash.com
The site produced a class named "TextArea" which is an extension to the original "TextField" class that ends to the shortcomings of TextField.
TextArea not only allows to have MovieClips and SWF files in line of your texts but also allows and created the most efficient ways to communicate with your SWF file live at any time, it allows to have different HTML tags rather than just having the tag to import images, you can have video player, talking avatar, flash buttons and anything else with their own tags to even set their settings dynamically right from your dynamic content.
It has lots of more features and doesn't specifically limited to this issue. Check out doitflash for more information. the site provides the platform and downloading it is also free of charge :)
no you cannot do this in flash. you can only load images in a textfield.
精彩评论