Hey Frihosters!
Scroll down for the question: Separating contents of a MySQL row and put them in variables!
I've got a technical question about Flash. I wanna integrate PHP/MySQL with Flash (on a phpBB-forum). But the question is: How?
I tried a few things but this is a special case:
In a MySQL database I've got a table "phpbb_users" with content "user_items". "user_items" differences per user, and it contains names of items starting with a ß and ending with a Þ (so:ßitem1Þßitem1Þßitem2Þ).
In the folder "shop/images" on my server exists a file with the item name with the extension jpg, png or gif.
This is the PHP-code to show this all:
If you go there (and you are logged in) you will see the picture of a item with the amount after it, and, if it is available, another item also with the amount.
Now I want these items in Flash one by one as a Symbol, so I can Actionscript them.
If you posses 2 of 1 item I also want that Item twice in Flash.
I wanna Actionscript them like this:
All I want is dragging, all apart from eachother
Does anyone knows a solution or a clue?
I'll be very, very Happy with it!
Last edited by deedee on Sat Jan 07, 2006 1:42 pm; edited 5 times in total
Scroll down for the question: Separating contents of a MySQL row and put them in variables!
I've got a technical question about Flash. I wanna integrate PHP/MySQL with Flash (on a phpBB-forum). But the question is: How?
I tried a few things but this is a special case:
In a MySQL database I've got a table "phpbb_users" with content "user_items". "user_items" differences per user, and it contains names of items starting with a ß and ending with a Þ (so:ßitem1Þßitem1Þßitem2Þ).
In the folder "shop/images" on my server exists a file with the item name with the extension jpg, png or gif.
This is the PHP-code to show this all:
| Code: |
|
<?php define('IN_PHPBB', true); $phpbb_root_path = '.././'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.' . $phpEx); // // Start session management // $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); // // End session management // //Start getting MySQL-data { $sql = "select * from " . USERS_TABLE . " where user_id='{$userdata['user_id']}'"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Getting User Info on Inventory Page'); } $row = mysql_fetch_array($result); if (!isset($row['username'])) { message_die(GENERAL_MESSAGE, 'No Such User!'); } else { $itempurge = str_replace("?", "", $row['user_items']); $itemarray = explode('?',$itempurge); $itemcount = count($itemarray); $user_items = '<br>'; for ($xe = 0; $xe < $itemcount; $xe++) { if ($itemarray[$xe] != NULL) { if ((${$itemarray[$xe]} != set) && ($board_config['viewinventory'] != normal)) { $useritemamount = substr_count($row['user_items'], "?".$itemarray[$xe]."?"); } if (((${$itemarray[$xe]} != set) && ($board_config['viewinventory'] == grouped)) || ($board_config['viewinventory'] == normal)) { if (file_exists(".././shop/images/$itemarray[$xe].jpg")) { $itemfilext = "jpg"; } elseif (file_exists(".././shop/images/$itemarray[$xe].png")) { $itemfilext = "png"; } else { $itemfilext = 'gif'; } $playeritems .= '<tr><td class="row2"><span class="gensmall"><img src=".././shop/images/'.$itemarray[$xe].'.'.$itemfilext.'" title="'.$itemarray[$xe].'" alt="'.$itemarray[$xe].'"></span></td>'; } if ((${$itemarray[$xe]} != "set") && ($board_config['viewinventory'] != "normal")) { $playeritems .= '<td class="row2"><span class="gensmall">'.$useritemamount.'</span></td></tr>'; ${$itemarray[$xe]} = "set"; } else { $playeritems .= '</tr>'; } } } } } //Show Items echo($playeritems); ?> |
If you go there (and you are logged in) you will see the picture of a item with the amount after it, and, if it is available, another item also with the amount.
Now I want these items in Flash one by one as a Symbol, so I can Actionscript them.
If you posses 2 of 1 item I also want that Item twice in Flash.
I wanna Actionscript them like this:
| Code: |
|
on(press) { startDrag(this,false); } on(release) { stopDrag(); } |
All I want is dragging, all apart from eachother
Does anyone knows a solution or a clue?
I'll be very, very Happy with it!
Last edited by deedee on Sat Jan 07, 2006 1:42 pm; edited 5 times in total
