Skip to main content
Participating Frequently
September 25, 2011
Question

Image not loading in TLFTextField and TextFlow (Using Flash CS5)

  • September 25, 2011
  • 2 replies
  • 1890 views

Hi,

I am using TLFTextField and TextFlow both in my application. Its a chatting application in which I need to show smileys. For this I use these components.

I have uploaded my code on: http://dl.dropbox.com/u/43019589/25-9-2011.rar

Problem:

1. When I load image at runtime the image does not shows in components.

2. When I import these images in Flash and convert it into movieclips the it loads in the textfield where user type the text, but it does not show up in the chat text area.

Show text in user text chatarea:

The code is written on Layer "Frame Actions" Frame 41 Function "showUserMessage". In this function it is showing the typed text in the user chat area.

User typing text:

The code is written on Layer "Generic Actions" Frame 11 Function "sendChatText". In this function it is picking text from user type text field.

The textfields are located on Layer "TLFTextFields".

The smileys that I am using are gif images(animated). I try loading images into flash and by calling from relative/absolute URL.

Please help me solving this problem. My project deadline is coming close .

Regards,

Amandeep Singh

PS: Please ignore testfield that is placed outside the stage.

This topic has been closed for replies.

2 replies

Adobe Employee
September 27, 2011

Hi Amandeep, I need to know the result of tempSplit.join("") in function sendChatText() to analyze the problem, but I did not find a good way to debug your project. I got an error that external Interface requires browser support NPRuntime. Could you paste an example of markup string returned by tempSplit.join("")?

What's more, if you long for an animated smiley, you must make it a MovieClip. GIF image will be static if it is inserted into TextFlow.

We are pleased to help you and feel upset to miss your question yesterday. Thanks!

Participating Frequently
September 27, 2011

Hi Jin, Thanks for your response .

Here is the result of tempSplit.join("") in function sendChatText():

<img color="#000000" fontFamily="Arial" fontLookup="inherit" fontSize="11" fontStyle="normal" fontWeight="normal" kerning="auto" lineHeight="129.090909%" textAlpha="1" textRotation="auto" trackingRight="0%" height="18" width="39" source="[class twothumbsup]"/><span color="#000000" fontFamily="Arial" fontLookup="inherit" fontSize="11" fontStyle="normal" fontWeight="normal" kerning="auto" lineHeight="129.090909%" textAlpha="1" textRotation="auto" trackingRight="0%"></span>

sendChatText() function removes the TextFlow and p tags from the tlfMarkup output.

I converted the animated smiley to movieclips, here in the above response you can see the source of img tag is a movieclip class.

Thanks for your response. Please help me find what I am doing wrong.

Adobe Employee
September 28, 2011

If you get the InlineGraphicElement instance and set its source as a MovieClip instance, it will work for sure.

But "[class twothumbsup]" in the markup cannot be recognized by TLF.

I'm afraid you need to create your TextFlow by manipulating objects, not markup. And manipulating objects will improve the performance as well.

Participating Frequently
September 27, 2011

!!! HELP PLEASE !!!