Closed Thread Icon

Topic awaiting preservation: How does Flash read from PHP?? (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=12360" title="Pages that link to Topic awaiting preservation: How does Flash read from PHP?? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: How does Flash read from PHP?? <span class="small">(Page 1 of 1)</span>\

 
Thumper
Paranoid (IV) Inmate

From: Deeetroit, MI. USA
Insane since: Mar 2002

posted posted 08-12-2002 10:40

I am having a lot of trouble with this when it seems so very simple! This is for dynamic text input inside the animation...My php file when opened in a browser returns for example:

name=Thumper&time=5:00pm&date=August15

This, when used as a txt file WORKS! But since it is going to be reading from MySQL, I need it to change...(PHP)

Any Flashers know the actionscript to handle this when the php file is getdata.php ??



[This message has been edited by Thumper (edited 08-12-2002).]

Xdreamer.ch
Maniac (V) Inmate

From: Switzerland
Insane since: Mar 2001

posted posted 08-12-2002 11:07

hi

I think you should go through this sites

- phpbuilder
- maybe macromedia himself
- flashkit


cu
~Xdreamer.ch~

someoneInverse
Bipolar (III) Inmate

From:
Insane since: May 2002

posted posted 08-12-2002 15:33

its a while since I've had to mess with flash but from memory, I think you need to be looking at the loadVariables action
something like: loadvariables("http://localhost/test.php", 0, "get") I think...


hth
I:.

Thumper
Paranoid (IV) Inmate

From: Deeetroit, MI. USA
Insane since: Mar 2002

posted posted 08-12-2002 17:51

Xdreamer, I have gone through those sites already and have learned A LOT, but their main focus is on inserting into the database. I have made this possible through PHP already. The retrieval part is still unclear. Inverse, I am going to try the GET method. Haven't tried it yet.

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 08-12-2002 20:40

Thumper: You do need:

loadVariables(url, target [, method])

but this is more of a Flash question (esp. as it doesn't appear to be working) so I'll pass this one over to the Multimedia forum.

target is the movie clip that the variables are loaded into (and is possibly where the problem is sneaking in)

method can be either POST or GET but is optional and I don't think you need it here.

Try:

loadVariables("getdata.php", this);

[edit: Actually I won't move this over as you have got this working with a text file which suggests that the problem actually lies in the way you are delivering the text. Some things to look at:

1. Can you see the variables on the getdata.php page?

2. Is this just plain text? Don't use HTML tags or anything.

3. Have you got an whitespace sneaking in (I'm not sure if it will upset things done this way but it is a problem with XML).

If you've checked all that and you are still having no joy then drop the URL in here or copy and paste the code in - it should be a simple fix - I've done similar things without a hitch]

___________________
Emps

FAQs: Emperor

Thumper
Paranoid (IV) Inmate

From: Deeetroit, MI. USA
Insane since: Mar 2002

posted posted 08-13-2002 06:12

Emps, I got it to work...I had the actionscript to call the text on a buried child level (bad news). Seems to be working perfect now. But if you could possibly answer another question that goes along with this particular project:

I have a PRIMARY KEY of "id" in my MySQL table for this which is smallINT(2), auto_increment, and NOT NULL.

My problem is being able to UPDATE the id through an HTML form processed under a looping PHP file. The form has the field type TEXT but when I SUBMIT, nothing happens if I've tried to edit the id. The other fields edit just fine though as they are set to VARCHAR(25), NULL, FullText. Any ideas on how I can allow for editing the id?

[edit: I should probably create a new topic for this eh?]



[This message has been edited by Thumper (edited 08-13-2002).]

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 08-13-2002 11:23

Thumper: I don't think you can alter an autoincrementing ID (I certainly wouldn't recommend it) - although I could be wrong. You either don't need to edit it or you have designed your DB wrong

[edit: If you think about it you are probably updating the values where ID = $id so I would think that MySQL wouldn't allow that. Or something - these answers aren't coming out as insightful as I'd planned. You might be better of inserting a new record and deleting the old if you wanted to change IDs. If it was vitally important I might dump the DB and edit it delete the old one and upload it again - see what phpMyAdmin will let you do by hand]
___________________
Emps

FAQs: Emperor

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 08-13-2002 16:17

also a very elegant method would be to use XML!

Thumper
Paranoid (IV) Inmate

From: Deeetroit, MI. USA
Insane since: Mar 2002

posted posted 08-13-2002 17:39

XML?? I'm not there yet GRUMBLE! : )

Emps, I guess the idea I had was probably too farfetched. I was trying to generate Flash headlines that used the id as variable suffixes on the dynamic text fields of the movie so that I could use different flash files for different headlines. I've just decided to make the info feeding into the movie editable. It's sufficient for what is needed in this application. And you're right, to avoid the confusion a prospective administrator might have, I have left the primaries uneditable but have given the option to create new records in an advanced scenario, under which they'd have to create a new Flash file for it's respective record. (I am trying to keep using phpMyAdmin out of the formula)

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 08-13-2002 23:44

Thumper: XML? It would depend on what you are doing - it might just not be worth the effort.

I'm not clear on how you are going to use it but from the sound of things you might be better off loading the text and inserting that into your Flash rather than loading different files (but I'm no expert).

___________________
Emps

FAQs: Emperor

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 08-15-2002 00:42

just to complete things:
XML is much more abstract than php. and also flash has a built in XML-socket object and not a php object.

and check: http://www.alesys.net/phpFlash



[This message has been edited by GRUMBLE (edited 08-15-2002).]

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 08-15-2002 02:01

GRUMBLE: Nice link - tucked away for future reference

___________________
Emps

FAQs: Emperor

Thumper
Paranoid (IV) Inmate

From: Deeetroit, MI. USA
Insane since: Mar 2002

posted posted 08-18-2002 04:23

Thanks all...Inspiration and new things to look at! I'll get rolling.

« BackwardsOnwards »

Show Forum Drop Down Menu