Jump to content

sending db info to a flash swf via php variable


samoht

Recommended Posts

hello all,

 

I have a client who wants a marquee of their top news story to scroll across the top of the page.

 

the <marquee> tag does not validate - so I thought that flash would be an easy solution.

 

only problem is I am retrieving my data from a db - and for some reason the loadVariables function is only printing the name of my php variable.

 

Here is my code:

 

<?php 

require_once '../Connections/connection1.php';



$q = dbQuery("SELECT Descr FROM news WHERE Type = 'N' AND FlagStatus != 'I'");

$row = dbFetchAssoc($q);





$marquee = '"'.$row['Descr'].'"';

print("&textbData1=$marquee");



?>

 

a little page called news.php

 

Then in my flash movie I have this action script in the first frame:


flashMarquee.loadVariables("news.php");

 

Where flashMarquee is the movie clip with a dynamic text box named "textbData1"

 

what shows up on testing the movie is just:

 

marquee

 

and sometimes:

 

$marquee");

 

However if I run the news.php page I get:

 

&textbData1=New Britain, PA – Hull Industries broke ground on their new engineering and manufacturing campus located in New Britain, PA. This 75,000 square foot manufacturing campus will provide additional manufacturing capability, complete machinery showroom/lab, and engineering offices.

 

Anybody have an idea what I'm doing wrong - or a better approach to a valid marquee??

 

Thanks

Link to comment
Share on other sites

I am not sure about the flash solution, but just a note.... If you are changing headlines frequently some user will not see updated information immediately because flash gets stored into cache and depending on settings it may not come out easily. For your situation, i would try using javascript. It may be a lot easier for you predicament.

 

Here are a few marquee open source scripts:

http://www.news-scroller.com/javascript_scrolling_marquee.html

http://www.javascriptkit.com/javatutors/marquee4.shtml

http://www.msfrontpage.net/fp/jsmarquee.htm

 

I know you said it wouldn't validate. I don't know if you mean your code then doesn't "comply" with wc3 standards or it just wont work, but it shouldn't matter if it doesn't comply... If everything else complies but this one thing it should be just fine.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.