Current location: Hot Scripts Forums » General Web Coding » Flash & ActionScript » Creating dynamic movieclips using data from PHP


Creating dynamic movieclips using data from PHP

Reply
  #1 (permalink)  
Old 04-11-07, 07:55 AM
ste ste is offline
Newbie Coder
 
Join Date: May 2006
Location: Wales, UK
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Creating dynamic movieclips using data from PHP

Heya guys,

Background Info:

At the moment I'm in the process of trying to create dynamic movieclips onto the stage using information gathered from the database table.

The table structure is:

projID - the project the asset(movieclip) is linked to.
assetType - (this could be text/url/image and refers to the type of movieclip that would be created.)
posX - (x position of the movieclip on the interface)
posY - (y position of the movieclip on the interface)
content - (actual content that will placed inside the generated movieclip)

At the present moment my experience of Flash/PHP has been purely passing variables back and forth to create things such as mail forms or login/registration forms (inc validation).

I have also started playing around with linkage names and attach movieclip and so far have managed to do a test where I attached a Circle instance to the stage and within that I attached Square instance.

Planned Method

My current thinking would be something like this:

- Query the DB for the number of assets
- Return the number and relevant info (x / y pos, content, type) to Flash
- Generate relevant movieclips in positions and add the content (e.g. text)

Question

Is this the best approach at implementing something like this?

As of yet I have limited knowledge of using Arrays in Flash and PHP (let alone both of them together), so I was possibly thinking that it might be better to send the results of each movieclip over to flash in a form of an Array element then break it up in Flash and generate the movieclip.

I was wondering if someone could give me some input on my ideas and possibly point me in the right direction on howto go about constructing the code.

Thanks for your time - and sorry for the headers, I just figured it would break the post up and make it more manageable to read!
Reply With Quote
  #2 (permalink)  
Old 04-11-07, 09:49 PM
omniman's Avatar
omniman omniman is offline
Coding Addict
 
Join Date: Aug 2006
Location: Baltimore, MD
Posts: 342
Thanks: 0
Thanked 1 Time in 1 Post
Depending on the frequency and complexity of the database updates, you may want to consider using an XML file instead of a DB. Doing so would allow you to knock PHP out of the picture - unless there is a particular reason you want/need to use a database.

Here is an excellent reference to get you started with XML:
Introduction to XML in Flash

If you wish to proceed utilizing PHP and a database, here is another great resource:
Flash, PHP, and MySQL Integration
__________________
"Political Correctness is a doctrine, fostered by a delusionary, illogical, liberal minority and rabidly promoted by an unscrupulous mainstream media, which holds forth the proposition that it is entirely possible to pick up a turd by the clean end."
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Do you know the idea of fetch data from Html by PHP and save it to database ? sharif_aly PHP 13 02-23-07 09:20 PM
Split data in php from sql? ( usinf | ) ? NabZ PHP 1 04-03-06 03:51 PM
Need Php Script To Export Mysql Data RAJPHP PHP 1 03-09-06 05:09 AM
error when creating database tables with php script spiroth10 PHP 4 01-06-04 03:59 PM
one-page form/catalog in php, data fed in with .csv file? domaky PHP 2 10-25-03 09:32 AM


All times are GMT -5. The time now is 06:31 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.