Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 30th, 2003, 02:50 PM
rolf rolf is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 4 rolf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Flash not reading dynamic content

Hi,
I'm new to loading dynamic content, so i made a test file.
I've given a dynamic textfield the variable name "msg" and converted it into a movieclip symbol. This is all there is on the stage.
Attached to this movieclip is the following action:

onClipEvent (load) {
LoadVariables ("message.txt",this);
}

In the same directory where the published .swf resides i have a textfile called message.txt, and it's contents shows up perfecty in this .swf

BUT:
Now i want to load data from MySQL via PHP, instead of loading it from the textfile, so in the actionscript I change the .txt extension into .php (the name of the PHP-file is also "message") This php-file resides in the same directory as the textfile, and register_globals is on in my php.ini file. Still my .swf does not show anything! Why???
When i check the file "message.php" in my webbrowser it perfectly retrieves the data from my (local)database, showing:
msg=Contents+from+database. So that seems to work. But flash does'nt show anything.

This is the message.php file i'm using:
<title>Uit No Hands/DevShed</title><?
// message.php

// open connection to database
$connection = mysql_connect("localhost", "root", "rolf") or die
("Unable to connect!");
mysql_select_db("rolf") or die ("Unable to select database!");

// formulate and execute query
$query = "SELECT testveld FROM test";
$result = mysql_query($query) or die("Error in query: " .
mysql_error());

// get row
$row = mysql_fetch_object($result);

// print output as form-encoded data
echo "msg=" . urlencode($row->testveld);

// close connection
mysql_close($connection);
?>



Hope someone can help!

Rolf

Reply With Quote
  #2  
Old March 31st, 2003, 04:10 AM
webcase's Avatar
webcase webcase is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 7 webcase User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Well, when you don't know what's going on try to debug. First of all you can try this: run the swf from authorung tool (changing the loadvars url to "http://localhost/.../message.php" otherwise it won't work) and then check the variable list. If the output of the php is present somewhere then it's a targetting problem, otherwise there are chances that flash can't reach the php.

Ciao,
*M

Reply With Quote
  #3  
Old April 1st, 2003, 03:06 AM
rolf rolf is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 4 rolf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Your answer

Hi M,

In the variables list i see only the code contained in the .php file. There is no sign of what should be the database output .
What i also do not understand is where the second instance(2) comes from, since i made only one instance: the MC with the dynamic textfield in it.
elow is the variables list output:
Level #0:
Variable _level0.$version = "MAC 6,0,50,0"
Movie Clip: Target="_level0.instance1"
Variable _level0.instance1.<title>Uit No Hands/DevShed</title><?
// message.php

// open connection to database
$connection = " mysql_connect(\"localhost\", \"root\", \"rolf\") or die\r(\"Unable to connect!\");\rmysql_select_db(\"rolf\") or die (\"Unable to select database!\");\r\r// formulate and execute query\r$query = \"SELECT testveld FROM test\";\r$result = mysql_query($query) or die(\"Error in query: \" .\rmysql_error());\r\r// get row\r$row = mysql_fetch_object($result);\r\r// print output as form-encoded data\recho \"msg=\" . urlencode($row->testveld); \r\r// close connection\rmysql_close($connection);\r?> "
Edit Text: Target="_level0.instance1.instance2"
variable = "msg",
text = ,
htmlText = ,
html = false, textWidth = 0, textHeight = 0, maxChars = null,
borderColor = 0x000000, backgroundColor = 0xFFFFFF, textColor = 0x000000, border = true,
background = true, wordWrap = true, password = false, multiline = true,
selectable = false, scroll = 1, hscroll = 0, maxscroll = 1,
maxhscroll = 0, bottomScroll = 1,
type = "dynamic",
embedFonts = false, restrict = null, length = 0, tabIndex = undefined,
autoSize = "none",
condenseWhite = false


How do i solve this?

Rolf

Reply With Quote
  #4  
Old April 1st, 2003, 05:23 AM
webcase's Avatar
webcase webcase is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 7 webcase User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
When loading data from a text file you are actually reading it. There's no processing, you just open it and read it as is. This is what's wrong with your PHP file. You're simply reading it. There's no web Server (e.g. Apache) to process the php and send the data to you.
Since you're working in authoring environment (Ctrl+Enter from FlashMX) what you should do next is to "call" LoadVars using an absolute path like "http://localhost/yourProject/phpfile.php". Doing this will likely fix the problem. Instead of php source code you'll be loading web server output (echo "...") processed as you programmed.

Cheers,
*M

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Flash not reading dynamic content


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway