all groups > flash data integration > june 2006 >
You're in the

flash data integration

group:

urgent help - getting images in text area from databse


urgent help - getting images in text area from databse Noor_nadaf
6/26/2006 12:00:00 AM
flash data integration:
hi can some one help me to get solution for this problem

i am making one small cms system which is updating flash content , everything
is done and working properly but image tag is not getting display in text area
( image is not comming in text ara ) following is the coding

[b]for flash ( in first frame )[/b]
---------------------
loadVarsText = new LoadVars();
loadVarsText.load("admin/display.php?pagename=aboutus");
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
_root.az.scroller.htmlText = this.content1;
} else {
trace("not loaded");
}
};

////////////////////////////////////////////////////////////////////////////////
/////////////

[b]coding in display.php[/b]

<?php
include"connect.php";
$qry="select * from content where pagename ='$pagename'";
$res = mysql_query($qry) or die($qry.mysql_error());
$res_arr = mysql_fetch_array($res);
$content = $res_arr["contents"];
//print "content1=$content";
echo "content1=$content";
?>

////////////////////////////////////////////////////////////////////////////////
///////

now its working perfect its showing perfect html content in flash even its
going well in databse but in text area of falsh its not showing i do have one
solution or you can say hint

if we give value in flash itself then its shoing but its not showing when
variable coming from db

following is code for this

myTextField.htmlText = '<img src="http://designerden.net/images/logo.jpg"
width="168" height="42" border="0">';

this works but its not work if variable coming from db
*********************************************
HELP ME OUT PLEASE

Re: urgent help - getting images in text area from databse Motion Maker
6/28/2006 9:19:44 PM
This might be how the PHP program is forming the html.

Did you trace the this.content1 in the onLoad method.

trace("this.content1:"+this.content1);

Or use Control->Test Movie and then Debug->List Variables
In there you will look for the _root.az.scroller htmlText property and see
just what is in it.

Change the _root.az.scroller to not render html and then you also can view
the raw html.

Malformed html is often the problem with items such a incorrect delimiters,
unsupport html tags, and such.

--
Lon Hosford
www.lonhosford.com
Flash, Actionscript and Flash Media Server examples:
http://flashexamples.hosfordusa.com
May many happy bits flow your way!
[quoted text, click to view]

Re: urgent help - getting images in text area from databse Noor_nadaf
6/29/2006 12:00:00 AM
html code is perfect without any error , here is one funny profblem i rectified
now problem is if image is at the start of paragraph its shoiwng in flash if
we put any text before image tag then its not showing ,

image is getting display only if we put </p> or </br> before image <img tag ,
else its not showing

now this is the problem do anybody know how to overcome this problem
Re: urgent help - getting images in text area from databse Motion Maker
6/29/2006 11:14:32 AM
Flash "adds" html tags to the ones you are putting in and so you need to get
the html inside the TextField after it is rendered via the techniques I
posted and see if it is valid before you start experimenting with malformed
html.

Also valid html is not necessarily valid html for a Flash TextField as all
tags and all their attributes are not supported. Get the actual html inside
the TextField once rendered and see if that is formed properly and meets the
html specifications for Flash player version you publish to.

For Flash 8 :http://livedocs.macromedia.com/flash/8/main/00001459.html.

Also be sure you are reading the requirements for using the img tag in a
Flash TextField:
http://livedocs.macromedia.com/flash/8/main/00001464.html
"To use this tag, you must set your dynamic or input text field to be
multiline and to wrap text. "

and
http://livedocs.macromedia.com/flash/8/main/00001472.html
"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"
--
Lon Hosford
www.lonhosford.com
Flash, Actionscript and Flash Media Server examples:
http://flashexamples.hosfordusa.com
May many happy bits flow your way!
[quoted text, click to view]

AddThis Social Bookmark Button