473,386 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Formating Dynamic Text

I just read an article on kirupa.com about incorporating mySQL and PHP with flash. I am dynamically loading conent into a flash movie and am not sure how to format. In my php code i have:

$y = "";
foreach($result as $x){
$y = $y . $x['firstname'] . " ";
}
print "myVar = $y";

In short $result is a query and $y is the value i will be passing along to flash.
the statement $y = $y . $x['firstname'] . " "; puts a space between each name that is passed along. I am trying to find ways of formating $y before sending, i.e. line breaks, bold, italics, color.... etc. In this example i may want the names to be listed on top of each other rather than with a space between them.

I am able to set initial values (other than line breaks (carrage return)) in my flash movie for the content that is dynamically loaded. Is it possible to set formating through my script?
Jul 11 '07 #1
1 2531
This does not answer the question you asked, but i load .txt files dynamically like this. Just figured i would share couldn't hurt. Sorry i can't answer your question specifically.

////myTextBox represents the instance name of your dynamic text box the semi collen strict data types it to TextField (all that means is it tells flash what it is)

var myTextBox:TextField;
myTextBox.text = "Please Wait... Loading..."

//// declare and instantiate a LoadVars object

var ourLoadVar:LoadVars = new LoadVars();

//// point our LoadVars 'onLoad' handler to our function that will populate our textField once our data has been loaded. Note that this should be done before trying to load any data.

ourLoadVar.onLoad = function(successful) {
if(successful) {
myTextBox.text = ourLoadVar.Text;

//// note that Text is a property that will be created in our data file that we will be loading

} else {
myTextBox.text = "error loading data"
}
}
ourLoadVar3.load("yourfilename.txt");

/// IMPORTANT the text in your text file must start with Text= that is determined by this line of code (myTextBox.text = ourLoadVar.Text;) We tell flash to look for Text= in your document. Text= will not dispaly just everything after it
Jul 12 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Polar | last post by:
I have a database that stories entries of short stories for a writers website. I can easily input the data into MYSQL but my trouble lies in retrieving the data. the story in just cut and...
6
by: Dave Smithz | last post by:
Hi there, A client of mine wants to start generating some reports from their PHP / MYSQL database. They were previously gathering data from the screen and cutting and pasting it into a Word...
1
by: gevayl | last post by:
Hi, Is it possible to do memo text formating in ms access 2000? I mean like underlining a portion of text in a memo field or a text field? Thank you.
22
by: craig | last post by:
I've declared the following as a "vector" of "lists" using STL vector< list<Edge*> > I've tried many ways to add objects to this but can't figure out how to do it. Does anyone have any tips,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.