Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-01-2007, 12:39 PM   #1
Babaloo
aaaaand Action!
 
Join Date: Feb 2007
Posts: 17
Default insert button in scrolling text field?

I really don't know if this is the right place to post this, so please excuse me...
So I have a text field and I'm using a skinned uiscrollbar to move the text. At the very end of that text, I have a text link/button that's supposed to call a movieclip or a frame. It sounds pretty basic, but I haven´t seen it before.

Last edited by Babaloo; 03-01-2007 at 12:43 PM.
Babaloo is offline   Reply With Quote
Old 03-01-2007, 02:37 PM   #2
Babaloo
aaaaand Action!
 
Join Date: Feb 2007
Posts: 17
Default problem solved! =)

Ok guys, found what i needed in a previous post:

how to embed stuff in a text field (images, movie clips, etc)

the macromedia how-to


interesting useful stuff here:
Quote:
Embedding images, SWF files, and movie clips in text fields

In Flash Player 7 and later, you can use the <img> tag to embed JPEG files, SWF files, and movie clips inside dynamic and input text fields, and TextArea component instances. (For a full list of attributes for the <img> tag, see Image tag (<img>).)

Flash displays media embedded in a text field at full size. To specify the dimensions of the media you are embedding, use the <img> tags's height and width attributes. (See Specifying height and width values.)

In general, an image embedded in a text field appears on the line following the <img> tag. However, when the <img> tag is the first character in the text field, the image appears on the first line of the text field.
Embedding SWF and JPEG files

To embed a JPEG or SWF file in a text field, specify the absolute or relative path to the JPEG or SWF file in the <img> tag's src attribute. For example, the following code inserts a JPEG file that's located in the same directory as the SWF file:

textField_txt.htmlText = "<p>Here's a picture from my last vacation:<img src='beach.jpg'>";

Embedding movie clip symbols

To embed a movie clip symbol in a text field, you specify the symbol's linkage identifier for the <img> tag's src attribute. (For information on defining a linkage identifier, see Attaching a movie clip symbol to the Stage.)

For example, the following code inserts a movie clip symbol with the linkage identifier symbol_ID into a dynamic text field with the instance name textField_txt.

textField_txt.htmlText = "<p>Here's a movie clip symbol:<img src='symbol_ID'>";

In order for an embedded movie clip to display properly and completely, the registration point for its symbol should be at point (0,0).
Specifying height and width values

If you specify width and height attributes for an <img> tag, space is reserved in the text field for the JPEG file, SWF file, or movie clip. After a JPEG or SWF file has downloaded completely, it appears in the reserved space. Flash scales the media up or down, according to the height and width values. You must enter both height and width attributes to scale the image.

If you don't specify height and width values, no space is reserved for the embedded media. After a JPEG or SWF file has downloaded completely, Flash inserts it into the text field at full size and rebreaks text around it.

Note: If you are dynamically loading your images into a text field containing text, it is good practice to specify the width and height of the original image so the text properly wraps around the space you reserve for your image.
Controlling embedded media with ActionScript

Flash Player creates a new movie clip for each <img> tag and embeds that movie clip within the TextField object. The <img> tag's id attribute lets you assign an instance name to the movie clip that is created. This lets you control that movie clip with ActionScript.

The movie clip created by Flash Player is added as a child movie clip to the text field that contains the image.

For example, the following code embeds a SWF file named animation.swf in the text field named textField_txt on level 0 and assigns the instance name animation_mc to the movie clip that contains the SWF file:

_level0.textField_txt.htmlText = "Here's an interesting animation: <img src='animation.swf' id='animation_mc'>";

In this case, the fully qualified path to the newly created movie clip is _level0.textField_txt.animation_mc. For example, you could place the following code after the previous code (on the same Timeline as textField_txt) for a button called stop_btn that stops the playhead of the embedded SWF file:

stop_btn.onRelease = function() {
_level0.textField_txt.animation_mc.stop();
};

Making hypertext links out of embedded media

To make a hypertext link out of an embedded JPEG file, SWF file, or movie clip, enclose the <img> tag in an <a> tag:

textField.htmlText = "Click the image to return home<a href='home.htm'><img src='home.jpg'></a>";

When the mouse pointer is over an image, SWF file, or movie clip that is enclosed by <a> tags, the pointer turns into a "pointing hand" icon, the same as it does with standard hypertext links. Interactivity, such as mouse clicks and keypresses, does not register in SWF files and movie clips that are enclosed by <a> tags.
Babaloo is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Placing text from an input field to a scrolling pane [renamed] matteh ActionScript 2.0 1 10-06-2006 03:27 PM
Button within Scrolling Text Field workerc Flash 8 General Questions 2 10-04-2006 07:55 AM
XML Text & Flash 8 display problem The Low ActionScript 2.0 9 09-29-2006 04:27 PM
Monitoring when images in dynamic text field are downloaded pattyg ActionScript 2.0 2 08-07-2006 04:22 PM
dynamic button text field wyclef ActionScript 1.0 (and below) 8 03-24-2003 02:15 PM


All times are GMT. The time now is 01:57 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.