Load Images From Asp Database
Hi all I am making a image viewer. in that i have a section of gallery i want all gallery thumbnails load from asp databse. if user select only five images out of 20 or more flash should load only selected five in that gallery. I am new in scripting and very new with serversite scripting and database connectivity.
your answer will be appriciated pl. send me some example source.
regards, Bisht
FlashKit > Flash Help > Flash General Help
Posted on: 07-09-2004, 06:41 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Load Images (jpg) To LOCAL DATABASE To Reuse....How? -Thank
Hi all ya!!!
Is there anybody who ever did it once, plz tell me how???
I try to load many images (.JPG original files) to local database
(i mean the database from method as:
Ex:
mydata = sharedobject.getLocal("database");
mydata.data["name"+1]="KoolJ"
or maybe it's managed in a temp folder on local machine).
So if it's ok, i can get the LINK of any imgs from thaz database or the TEMP FOLDER in any time.But now I only load and display one by one time.
Can u help me to solve out this problem???
Thankz 4 reading & focusing!!!
Kool.
Flash Connect To Database For Images To Load
Hi
I have an image of a car in flash. I would like to create two things:
1. An updatable list of car parts.
2. To click on the car parts and load its image on the main image of the car.
I am presuming that this has to be done via a database and flash will need to connect to the database to get:
1.The List
2.Images of car parts.
I have never done this before and don't know where to start. Does anybody know where I can obtain a dumby's dumby's dumby's guide to accomplishing all of this?
Any other advice is also appreciated (I only understand dumby's language)
Thanks
Flash Connect To Database For Images To Load
Hi
I have an image of a car in flash. I would like to create two things:
1. An updatable list of car parts.
2. To click on the car parts and load its image on the main image of the car.
I am presuming that this has to be done via a database and flash will need to connect to the database to get:
1.The List
2.Images of car parts.
I have never done this before and don't know where to start. Does anybody know where I can obtain a dumby's dumby's dumby's guide to accomplishing all of this?
Any other advice is also appreciated (I only understand dumby's language)
Thanks
Load Directly Images From Database Into Flash
I wanna load directly images from database into flash, not with the help of their paths.I'll get the data in the binary form through web services and then i have to load that.
What are the ways of implementing this thing?
Images In Database
Is there a tutorial somewhere that tells/shows how to display an image from a db. I have my image paths in a mysql db and I am using php to display my other text fields. I just haven't been able to get my images to show. Below is the code that I am using so far. Here is my actual goal, I am trying to have a flash document the has a list in the datagrid that is connected to a mysql db. I have successfully done this. When a user clicks on a product in the datagrid it populates the details below the grid and I have done so successfully. What I now need is to show a picture of the product in the details section. I would also like to see how to show different images for different vendors, each vendor has its own image size, so if I put just one image placeholder then some of the images will be scewed. I need something that shows image in placeholder 1 if company=1, show image in placeholder 2 if company=2, etc.
Attach Code
/*This defines the location of the files we are going
to use in this program. */
_global.mypath = "http://www.producttestsite.com/flash/"
//This defines the datagrid columns
import mx.controls.DataGrid;
import mx.controls.gridclasses.DataGridColumn;
var column = new DataGridColumn("j1");
column.headerText = "Product Name";
column.width = 200;
tf.align = "center";
products.addColumn(column);
var column = new DataGridColumn("j2");
column.headerText = "Price";
column.width = 60;
products.addColumn(column);
var column = new DataGridColumn("j3");
column.headerText = "Color";
column.width = 75;
products.addColumn(column);
var column = new DataGridColumn("j4");
column.headerText = "Interior Color";
column.width = 150;
products.addColumn(column);
products.addEventListener("headerRelease", headerListener);
products.dataProvider = r_string;
products.scrollToTop();
products.dataProvider = r_string;
//set Column text property
//var tf = new TextFormat ();
//tf.italic = False;
//tf.bold = False;
//tf.align
// This reads the data from the PHP script and populates the datagrid.
var sendData = new LoadVars();
var r_string = new LoadVars();
r_string.onLoad = getResponse;
sendData.addr = propDgrid.selectedItem.j2
job_id_num=custDgrid.selectedItem.cust_id;
mypath89 =_global.mypath + "products.php";
sendData.sendAndLoad(mypath89, r_string, "post");
function getResponse(result){
if (result == true) {
var r_string = new Array();
for (var i:Number=0; i < this.n; i++) {
r_string.push(
{ productid:this["productid"+i],
j1:this["model"+i],
j2:this["price"+i],
j3:this["color"+i],
j4:this["interiordesc"+i]
})};
}
products.dataProvider = r_string;
}
//Populate the form
//==============Show Customer Details=========================
custf=function(){
var sendData = new LoadVars();
var recData = new LoadVars();
recData.onLoad = getResponse1;
sendData.productid = products.selectedItem.productid;
mypath81 =_global.mypath + "productform.php";
sendData.sendAndLoad(mypath81, recData, "post");
}
function getResponse1(result){
if (result == true) {
model.text = this['model'];
price.text = this['price'];
material.text = this['material'];
interiordesc.text = this['interiordesc'];
this.ref['holder_mc'+i].loadMovie(this['picture'+i])
picture.text = this['picture'];
feature1.text = this['feature1'];
feature2.text = this['feature2'];
feature3.text = this['feature3'];
feature4.text = this['feature4'];
}
}
products.addEventListener("cellPress",custf);
/*I have not shown all fields in the database on the form but if you wanted to
show more of the fields you would just add then to the list above.*/
Dynamic Images From Database
Does somebody know if it's possible to import dynamic images into a flash movie as it is possible with text?
So is it possible to put an <img src>tag and that it works?????
Thank u
greetz
Rob
Dynamic Images From Database
This is my new project, I have a database contain information about products and there images, I also created a flash file, with 4 scenes:
1st scene has the product categories on rollover list of sub categories appears and each sub category link to 2nd scene
2nd scene has the product sub categories and links to 3rd scene
3rd scene has products displayed horizontally as images and underneath the image the product name, and each product links to 4th scene
4th scene displays details about selected product from scene # 3.
All the information is driven from a database using ASP and here is a list of the challenges that I got:
1-Scene # 3 loading images into the movie dynamically, I had no problem loading the information as text and display them in a horizontal line, the following is the script that I used:
------------------------
// depth
depth = -1;
// hide the original clips which called dynpic
dynpic._visible = 0;
// split up the array by looking for the commas from the information which loaded in a previous frame through the asp file
dynpic_array = collectprodpic.split(",");
// get the length of the array
dynpic_length = dynpic_array.length;
// set the start y position (x position depends on where you put it on the screen)
xposition = 275;
// looping everything
for (i=0; i<dynpic_length; i++) {
// duplicate the movie
duplicateMovieClip(dynpic, "dynpic" add i, depth);
// set the movie postion
setProperty("dynpic" add i, _y, xposition);
// loading the image to the movie
dynpic.loadMovie(dynpic_array[1],"dynpic");
depth--;
// Set the x position plus 55
xposition = xposition+55;
}
stop();
------------------------
of course I know that I have to load all the images first and then display them and that’s one of the things that I’m stock on.
One other thing when generating those images I need to generate a link associated with that picture so when I click on that picture it passes the id of that product to scene # 4 and then I can take from there by pulling the information from the database and display it again.
Any help, please
Thanks
Downloading New Images From A Database
I want to beable to create a Flash movie with a single picture on the 'wall' in a room. When a person clicks onto this picture a 'pop-up' window will open up displaying a number of new picture images (which are linked to a database). When they click onto a picture they like, it will download to a specified folder on they hard-drive, and replace the current picture on the 'wall'.
What I need to know is:
1) What language/database should I be using to display this 'pop-up' window with new images? PHP/mysql?
2) Is there anyway I am able to open up this 'pop-up' window without the usual Microsoft branding i.e I don't want people to know that they are having the information displayed in a Microsoft Internet Explorer browser page.
Pulling Images From A Database?
I have a client for whom we're doing an ecommerce website in ColdFusion. They would like a fade-in and fade-out image area on the home page to showcase current items. They sell one of a kind merchandise that once one is sold, it comes out of inventory (and out of the rotating fade-in images).
The images and file names would be dynamically pulled from a atabase.
The images that are displayed will be dependant on a specific query,
filtering on whether the item is sold or inactive. When the image is
displayed on screen, it must be clickable to a url which passes along
the product ID which was pulled as part of the query from the database so that the next page can pull the specific information for the item clicked.
Can you do that in Flash?
Loading Images From A Database
How do I load images from a database?
Or actually from a folder.
I have created a Flash nav that shows images. See: http://www.robertbrunogallery/robertbrunogallery5
I want to be able to load these images dynamically.
thanks
Calling Images From Database
hi all,
I am making an image gallery. I need to call images from the database. Right now I have to call 2 images from the database. I would like to know how can I do that. I am making this site in ASP. Need some help.
regards,
xeeschan
Preloading Images Via A Database
We're having problem with making a preloader for a movie which loads the
images via a database.
A php script grabs the file names of the images and sends these to a flash
file.
Then the flash file uses the loadMovie() action to put the images (whith
the names fetched from the php script) into movieclips. How is it then
possible to detect when the bytes of the graphics are loaded?
It seems like onClipEvent(data) just functions when it's used together
with a loadVariables action - as it otherwise triggers several times.
Is there any solution to this problem?
Images And Co. From MySQL Database With Php
This one is heavy. In flash I have 15 image groups. Each group has 5 banknotes in it. When I choose one group, I get a screen with 5 preview pics, each with a short info text on mouse-over. On this page I can click <prev next> through all 15 groups of preview images. When I click on a preview image, I get a screen with the big banknote picture. On this screen, I can click <prev next> through other banknote pictures (front and back side - together 10 images in a group). Each banknote has a description text on the side.
I have it working in flash but now it's supposed to work with a content management system which means the images and text are somewhere in a mySQL db and have crazy names and I have to pull them via php. H E L P P L E A S E. I don't know how to do this in flash, for php I need some hints but not all details, I'll have support there once I know what exactly I need.
One more time: first I choose a banknote group, somehow tell php and it sends me back 1) the names and paths for the 5 preview images, 2) the small info texts for the 5 images 3) names/links to the 10 big images of the banknotes 4) longer description texts for the 5 banknotes
thank you thank you thank you
Loading Images From A Database
Anyone have anyideas on how to load an image from a database.
Heres the thing!!...The flash site im wokring on had to allow the user to obtain images from a database. So whats happening is that on a button click a new window opens allowing the user to browse a selection of images and once they choose an image the iamge should appear in the flash.
Any ideas will be most appreciated
Thank
Images And Co. From MySQL Database With Php
This one is heavy. In flash I have 15 image groups. Each group has 5 banknotes in it. When I choose one group, I get a screen with 5 preview pics, each with a short info text on mouse-over. On this page I can click <prev next> through all 15 groups of preview images. When I click on a preview image, I get a screen with the big banknote picture. On this screen, I can click <prev next> through other banknote pictures (front and back side - together 10 images in a group). Each banknote has a description text on the side.
I have it working in flash but now it's supposed to work with a content management system which means the images and text are somewhere in a mySQL db and have crazy names and I have to pull them via php. H E L P P L E A S E. I don't know how to do this in flash, for php I need some hints but not all details, I'll have support there once I know what exactly I need.
One more time: first I choose a banknote group, somehow tell php and it sends me back 1) the names and paths for the 5 preview images, 2) the small info texts for the 5 images 3) names/links to the 10 big images of the banknotes 4) longer description texts for the 5 banknotes
thank you thank you thank you
Images Loader From Database?
I have a loader UI component to load image from content path img/namePhoto.jpg. Is it possible to get the name for the Photo through a text from the database like in PHP I would write: "img/<?php echo $row['namePhoto']; ?>.jpg". I know how to trigger text from my database PHP/mySQL through a XML-file generated from a PHP-document. Or what other solutions are there to get the images added to the database?
tnx for any help.
Pulling Images From A MySQL Database
I have a client who loves the animation I provided for them. It is a simple movie that has 9 images rotating in adn out of three boxes. Now they want to be able to dump more images into a directory, build a database with those images and have my little Flash movie automatically load the new images.
Help!!! I have no clue what my next step should be.
David
aka Tencast--
Importing Variable Images From A Database
Flash 8 query
We have a project that requires variable information from a database to be added to a swf file.
We have successfully imported the data using the loadVariablesNum ActionScript and we have imported the text from the php file by creating dynamic text boxes with the correct variable name.
However we have specific images that also need to be loaded at the same time, they are stored within a subdirectory. I have looked through the help options and have tried unsuccessfully to load these images using the Loader option from components, which seemed to be the best way of achieving this.
Can anyone tell me a solution to this problem?
We are also trying to animate the dynamic text items, but as soon as any animation is applied the imported text disappears, is there a way to import the text data from the database into an animated movie clip?
Thanks.
[F8] Images Loading In Slow From Database
Hi All.
I have used the following script to load images from a database...
load_data.onLoad = function(succes) {
if (succes) {
_root.TotalImages = this["total_items"];
for (var i = 0; i<=this["total_items"]; i++) {
this.ref["title"+i].text = this["title"+i];
this.ref["details"+i].text = this["details"+i];
loadMovie("content/collections/"+this["id"+i]+"/image.jpg", ["my_ldr"+i]);
}
}
};
There are about 8 images loading into 8 different movieclips.
It takes roughly a minute and a half to load in which is far too long so my question is how can i speed the whole process up? such as loading the images in as 1,2,3,4,5,6,7,8 rather than just all 8 at once?
Cheers.
Loading Images From Database To Flash
hi gang
this is it:
I have to get an image from a database, through php and into flash.
now comes the prob:
if I set a dynamic textbox to get the variable "pub1", she easily shows "roazpub.jpg"... no problem with that...
but I want the image not its name, so I created a movieclip and set this code
movieclip.loadMovie("../pathtoimg/"add pub1)
it should work right??? but it doesn't.. it says "undefined". but the path is right because if I put the name of the img enstead of "add pub1" it works...
anyone knows how to solve this???
thanks in advance
feL...
Retrieving Images/symbols From A Database
My project mgr would like to rotate graphics/gifs into a FlashMX library, but I need to create a script/program (probably in ASP since we're on NT) that pulls them out of a database and into a Flash file, whereas the filenames for the gifs would remain the same in Flash, it would just be different pictures on a weekly basis. Is there a utility in FlashMX already available for something like this, or am I/he pipe dreaming?
Help With Dynamacally Loading Images From Database.
im using php and flash and i have in a database my cordinates that i want a library to appear in a movie and i been raking my brain for 6 hours now so i decide i better get some help.
Code:
Flash Code
function movement()
{
var m = new LoadVars();
m.load(movement + "?" + m.toString());
m.onLoad = function()
{
kan._x = 'xposition';
kan._y = 'yposition';
}
}
Code:
Php Code
<?
require_once ('config.inc.php');
$result = mysql_query("SELECT * FROM users");
while($z=mysql_fetch_array($result))
{
$xposition=$z["x"];
$yposition=$z["y"];
}
print "&xposition=$xposition";
print "&yposition=$yposition";
?>
i want it to be able to adjust my x y in my mysql database to determine where this object will appear inside the flash movie.
How To Database Driven Images In A Flash Animation? Possible?
Hi. I have a flash animation which is simply a fade-in/fade-out of three
images, all the same width/height, side by side.
I want to be able to upload new images via my content management system and
have them appear in my Flash animation without having to recreate the
animation every time. Is this even possible?
I can upload photos to my web server via a password protected admin system
(ASP), which allows me to browse images from my PC and upload them to the
server (and also enters file info into my database). Can I drive the Flash
animation using this database?
Would appreciate some advice, links to tutorials where/if they exist etc.
Really appreciate it. Thanks.
Nath.
Displaying Images Thru Mysql Database,php In Flash
i like wrote this
getcardimages.php
<?php
$server = "localhost";
$user = "khelorummy_d";
$pass = "khelorummy123";
$database = "khelorummy_d";
mysql_connect($server, $user, $pass);
mysql_select_db($database);
$SqlQuery = "SELECT `c`.* FROM `cards` c, `cardsets` cs WHERE c.`cardID` = cs.`cardID`";
$Result = $DBConn->ExecuteQuery($SqlQuery);
if (!Result || mysql_num_rows($Result)==0) {
$rowset = '&msg='.mysql_error().'&';
} else {
$rowset = '&n='.mysql_num_rows ($Result);
$i = 1;
while ($row = mysql_fetch_assoc ($Result)) {
while (list ($key, $val) = each ($row)) {
$rowset .= '&' . $key . $i . '=' . stripslashes($val);
}
$i++;
}
$rowset .='&';
}
return $rowset;
?>
and getcardimages.fla like this
var lvSend = new LoadVars();
var lvReceive = new LoadVars();
lvSend.SendAndLoad("http://192.168.1.9/projects/khelorummy/user/getcardimages.php",lvReceive,"get");
lvReceive.onLoad = function(bSuccess) {
if(bSuccess == true) {
for (var i:Number=0; i <= this.n; i++) {
this.root.createEmptyMovieClip("container"+i, i);
var mc = this.root["container"+i];
mc.loadMovie("http://192.168.1.9/projects/khelorummy/cards/"+this["label"+i]+".gif");
}
}
and in design mode i took one movie clip and i named it as "container". is it correct?
why images are not displaying when i execute getcardimages.swf?
plz give me right solution.
thankq
Help With Scrolling A Random Number Of Images & Links From A Database
If anyone could help, I would VERY much appreciate it.
I am a newbie when it comes to ActionScript, but I've been using Flash since Flash 2... Just a simple designer with ActionScript problems.
Anyway, I am trying to create a scrolling movie with left and right buttons to control the scrolling.
What will be scrolling is a group of images and links that are fed from a database using Swift Generator and our mySQL database.
I have figured out Swift Generator enough to understand how to feed data, but I don't really even know how to get started scrolling a random number of images.
Can anyone help?
Insert Images Into Database Using Flash Frontend PHP Backend
Hi
I need some help. I am trying to make an address book where I am storing the name number and address of people.
I am using flash(MX) as my front end and storing the data into MySQL database using PHP.
Everything is working fine.
I was trying to modify my file so that I can store an image of the person as well, so that when I click on their name I see their details along with their image.
I dont know how to upload the images using flash. I need to make browse button with which I can search my machine and attach the image and insert it into my database.
Thanks.
Load A Jpg From Database URL
Hi,
I have connected to a database using an ASP page, and have successfully imported text into dynamic text fields. I have also successfully imported the URL for an image that I am wanting to display.
Tutorials that I have found online suggest using the loadmovie function to load the image into a movie clip (which seems to work when I put in a static image URL), but I am needing the image to load from my variable URL coming from the database field.
Any ideas on the best way to do this?
Thanks so much.
Load All Images From The Images In 1 Folder (named By Random Number)
Hi Guys,
I've got a gallery style viewer, you click on an image and it enlarges. It pulls in images which are numbered 1 to 12 in a folder called 'images'. I want it to pull in randomly numbered images instead. so i suppose i want it to search the folder for images named 1.jpg up to 1000000.jpg and pull them in.
I've uploaded it to: www.dhardy.co.uk/gallery.zip as it'll become clearer then!
Thanks in advance! dave.
Load Image From SQL Database With ASP?
Hello,
Does anyone know a tutorial where you can load an image from a SQL database ?
I would like to show this image in Flash, but i don't know how to load in from a SQL database using ASP.
Regards,
Micheal
Load Image From Database.
Hi everyone,
I'd like to load an image from an SQL database using Flash. The image is stored on the server and a relative path (or an URL) is stored in the database. All i basically want to do is to load that image in a Flash movie so i can add some animation to it.
Does anyone perhaps have a suggestion how to do this? I guess can either load the url as a variable in PHP or directly connect to the database an Actionscript. The first one is preferable.
Thanks in advance!
Want To Load A Pic From Database To FlashMX
Hi,
I would like to load a picture from a mysql database to flashMX using php.
I have managed to load the picture in the database at this time.
But I don't know the php to and the actionscript code to write to call the picture.
Help
thx
Attaching Multiple Images - Load Images One At A Time?
I have a photo gallery that loads many images using a for loop (image data is from XML file). Simplified code looks like this:
Code:
var photos_xml = new XML();
photos_xml.ignoreWhite = true;
photos_xml.onLoad = function(success) {
if (success) {
var photos = photos_xml.firstChild.childNodes;
var itemCount = 0;
for (var i = 0; i < photos.length; i++) {
var path = photos[i].attributes.path;
// attach the photos
var photo_mc = _root.center_mc.photosLevel1_mc.attachMovie("photoFrame_mc", photoName, itemCount);
photo_mc.empty_mc.loadMovie(path);
itemCount ++
...
Then on the photoFrame_mc clip I have a loading like:
Code:
onEnterFrame = function () {
loader_mc._visible = false;
var t = empty_mc.getBytesTotal();
var l = empty_mc.getBytesLoaded();
percent = Math.round((l / t) * 100);
if (l == t && t != undefined && t > 10) {
loader_mc._visible = false;
delete this.onEnterFrame;
} else {
loader_mc._visible = true;
if (isNaN(percent)) {
percent = 0;
}
loader_mc.percent_txt.text = 10 - Math.round(percent / 10);
}
};
So what happens now is that many images get attached at once and they are all loading at the same time.
What I'd like to do instead is to have them load one at a time. The first pass through the for loop attaches an image and then it loads, but it doesn't move on to the next image until the first one is done loading. Is that possible?
Or maybe is it better to let them load all at once? I just think that when the image count is very large it will really bog down loading so many images at once and it might be best to load one at a time. Please advise.
How To Load Text From Database To The Stage
I need some help here.
I have a database table which looks something like this:
===========================
x_cor | y_cor | text |
===========================
12.86 | 34.89 | am |
13.91 | 87.67 | you |
45.89 | 45.89 | this |
===========================
I want to load the text at that particular _x, _y coordinates as in the table to the main stage.
How do I go abt the process.
Pls explain in detail.
Load Movie From Txt File Or Database
i want to load external swf file into my main file
main file : index.swf
movie for load : load.swf
txt file : data.txt
loadMovieNum ("load.swf", 0);
_________________________________
but i want to load this load.swf from txt file
?????????????????
Load Pictures Dynamically From Database
I have made a self moving slide show of cars. When one of the cars is clicked, a bigger image of it is loaded at the side of the slide show.
Now the person for whom I making this movie wants that it should load the pictures dynamically from his database. He has given me the following information:
dsn: austincarscom
Select imgName, caption, id
From images
Where car_id = #car_id#
As I have never loaded pictures dynamically, I could not make much sense of this information.
I would be grateful if anybody could help me in incorporating this information in the flash movie, so that it can load pictures dynamically. If required, I can upload the .fla file.
Thanks! a ton.
Load Image From Access Database
I am rather new to database/flash
Ive got a record in MS access, that holds my image/jpp as Binary Data.
How do I get it to show with asp
The other records Ive get using this:
<%
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.Open "Driver=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("AddressBook.mdb")
Set cmdTemp = Server.CreateObject("ADODB.Command")
Set rstContacts = Server.CreateObject("ADODB.Recordset")
cmdTemp.CommandText = "Select * From Contacts"
cmdTemp.CommandType = 1
Set cmdTemp.ActiveConnection = DataConn
rstContacts.Open cmdTemp, , 1, 3
rstContacts.Move CLng(Request("Record"))
Response.write "Name=" & Server.URLEncode(rstContacts("Name")) & "&"
Response.write "Telephone=" & Server.URLEncode(rstContacts("Telephone")) & "&"
Response.write "City=" & Server.URLEncode(rstContacts("City")) & "&"
Response.write "Notes=" & Server.URLEncode(rstContacts("Notes")) & "&"
Response.write "TotalRecords=" & rstContacts.RecordCount
rstContacts.Close
DataConn.Close
%>
HAVE A NICE DAY
:-) pauk
I Am Trying To Load Data From A Database To Flash
Hello
I am trying to load data from a database to flash.
This is the actionscript that I use :
Code:
myData = new LoadVars()
myData.ref = this
myData.load("con_flash3.php")
myData.onLoad = function(success){
if(success){
for(var i=0; i<this.total; i++){
this.ref.word.htmlText += "<br>"+this["word"+i]
}
} else trace("Error loading data")
}
con_lash3.php
Code:
<?php
require("config.php");
$connection = mysql_connect($db_host, $db_user, $db_password) or die("error connecting");
mysql_select_db($db_name, $connection);
$query = "SELECT * from news ORDER BY month desc";
$result = mysql_query($query, $connection);
$words = '';
$count = 0;
while ($row = mysql_fetch_assoc($result)) {
$words .= '&word'.$count.'='.urlencode($row['comments']);
$count++;
}
echo 'total='.$count.$words;
?>
I had debug the php script and it woks !
I haven’t be able to pass the data to flash
I don’t know what I am doing wrong, If you have any idea please help !
Thank you !
I Am Trying To Load Data From A Database To Flash
Hello
I am trying to load data from a database to flash.
This is the actionscript that I use :
Code:
myData = new LoadVars()
myData.ref = this
myData.load("con_flash3.php")
myData.onLoad = function(succes){
if(succes){
for(var i=0; i<this.total; i++){
this.ref["word"].text = "<br>"+this["word"+i]
}
} else trace("Error loading data")
}
con_lash3.php
Code:
<?php
require("config.php");
$connection = mysql_connect($db_host, $db_user, $db_password) or die("error connecting");
mysql_select_db($db_name, $connection);
$query = "SELECT * from news ORDER BY month desc";
$result = mysql_query($query, $connection);
$words = '';
$count = 0;
while ($row = mysql_fetch_assoc($result)) {
$words .= '&word'.$count.'='.urlencode($row['comments']);
$count++;
}
echo 'total='.$count.$words;
?>
I had debug the php script and it woks !
I haven’t be able to pass the data to flash
I don’t know what I am doing wrong, If you have any idea please help !
Thank you !
Need To Load Database Data Into Flash Through Php
I'm redesigning a site i did for a band and i would like to do it all in flash but i don't know how to load php into flash. I need to load in their news and tour dates into a scrolling textbox. Here's what I had when it was html:
PHP Code:
<?require('DB.php');require('Smarty.class.php');$dsn = array( 'phptype' => 'mysql', 'hostspec' => 'localhost', 'database' => 'name', 'username' => 'theusername', 'password' => 'thepassword');// initialize Smarty object$smarty = new Smarty;$smarty->template_dir = '.';$smarty->compile_dir = 'templates_c';// connect to database$dbh = DB::connect($dsn);// snarf data$smarty->assign('array_tour', $dbh->getAll('SELECT * FROM tour ORDER BY date DESC', DB_FETCHMODE_ASSOC));// display page (for now)$smarty->display('tour.html');
HTML Code:
<ul>
{section name=i loop=$array_news}
<li><strong>{$array_news[i].date}</strong><br >
<em>{$array_news[i].headline}</em><br />
<p>{$array_news[i].details}</p>
</li>
{/section}
</ul>
Get Image Name From Database Then Dynamically Load It
I am able to get data from the database and have it shown in a dynamic text box using asp...
I am also able to dynamically load an image using flash
but i want to put the two together...get the name of the image from the database then have flash load the particular image form the folder..
I cannot get it to work..
this actionscript is on a movieclip in the main timeline:
*************************
onClipEvent (data) {
strName = Name;
}
onClipEvent (load) {
CurrentRecord = 0;
loadVariables("asp.asp?Record=0", this);
this.createEmptyMovieClip("container", 1);
}
*************************
this code is inside the movieclip on the first frame:
*************************
this.createEmptyMovieClip("container", 1);
this.loadMovie(strName);
container._x = container._y=50;
*************************
if I replace:
*************************
this.loadMovie(strName);
*************************
with:
*************************
this.loadMovie("image.jpg");
*************************
the image will be shown on the movie. but it will not be "database" driven. If instead i replaced:
*************************
this.loadMovie(strName);
*************************
with:
*************************
strName="image.jpg"
this.loadMovie(strName);
*************************
the image will also show up. any help???
thanks
Load Data From A Database (php) Into Flash
Hi, i was wondering how you can load text from a database into a flash movie and display it??
TABLE:
page | info |
index homepage
reg register
how could i load that into textboxes in flash??
PS, i would like it in PHP!
any ideas??
thanx
Martin
Computing help and info:
http://www.webrevolt.biz
Flash Form To Load Data In Database Using Php
I need assistance on creating a form in flash that uses php to put data into a MySql database. I have a Dynamic textbox that I want to have the information in the box go into the field "Team" in my database. I am not sure if I should give it an instance name or if I should make the var in the properties section for the box equal "Team". If I put the "Team" in the instance name, nothing populates the database, not even a new row. If I put the "Team" in the VAR spot with nothing in the instance spot nothing populates the database. However if I give it an instance name of "Team" and give it a VAR of "Team", a new row is added to the database, but nothing goes into the database. I have code on the submit button for my flash form, but not anywhere else.
Here is my flash code for my submit button:
on(release){
loadVariables("tm5insertform.php", "_root.login","POST");
getURL("tm5insertform.php",0,"POST");
gotoAndPlay(3);
}
And here is the code for my php(Note: there are more variables than what I am asking help for in my php because I'm trying to get just 1 field to work at the moment.):
<?php
$username="root";
$password="***";
$database="annex_db";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$table = 'test';
$Computername = $_POST['Computername'];
$IP = $_POST['IP'];
$User = $_POST['User'];
$Building = $_POST['Building'];
$Team = $_POST['Team1'];
$Pos = $_POST['Pos'];
$CPUmodel = $_POST['CPUmodel'];
$CPUserial = $_POST['CPUserial'];
$CPUspeed = $_POST['CPUspeed'];
$Memory = $_POST['Memory'];
$HDsize = $_POST['HDsize'];
$Monitormodel = $_POST['Monitormodel'];
$Monitorserial = $_POST['Monitorserial'];
$Monitorsize = $_POST['Monitorsize'];
$OSversion = $_POST['OSversion'];
$Officeversion = $_POST['Officeversion'];
$Miscsoftware = $_POST['Miscsoftware'];
$IASOname = $_POST['IASOname'];
$IASOphone = $_POST['IASOphone'];
$result =mysql_query("INSERT INTO `test` (Computername, IP, User, Building, Team, Pos, CPUmodel, CPUserial, CPUspeed, Memory, HDsize, Monitormodel, Monitorserial, Monitorsize, OSversion, Officeversion, Miscsoftware, IASOname, IASOphone) VALUES ('$Computername','$Computername','$User','$Buildin g','$Team','$Pos','$CPUmodel','$CPUserial','$CPUsp eed','$Memory','$HDsize','$Monitormodel','$Monitor serial','$Monitorsize','$OSversion','$Officeversio n','$Miscsoftware','$IASOname','$IASOphone')");
mysql_close();
?>
I have a feeling that the problem is within my actionscript, but I'm not exactly sure. Also, how do I modify the getURL command in my submit button so that a new window doesn't open and it doesn't open in the flash itself? Is there another command that I can use to allow me to load the data into the php file other than the getURL?
Thanks in advance.
How To Load Mp3 From MySQL Database Into Flash Movie Dynamically?
I got mySQL database available and mp3 files in it. Is it possible to dynamically link and load those files from the database into the Flash movie? I bought Steven's Flash Anthology book, but there isn't any similiar sample related to my question.
Please advice, thanks.
[MAJOR PROBLEM Renamed] Load Database Data Into Flash With Php
Hello,
I am building a flash site for a friend and I have setup a PHPCatalog for his sales made by http://www.siliconsys.com/content/ap...ns/phpcatalog/
the problem is Im building his whole site in flash right now and need to call to the phpcatalog scripting and input it into my swf.... I have searched and read many posts on doing this but this is kinda tricky because of how complex the phpcatalog is. What I need to figure out is how to call the different peices of the php.. if you want to see what it looks like goto www.customwheelsales.com/phpcatalog as you will see it is running on a MYSQL database to access all of the variables... which makes me think is there anyway to make this phpcatalog into a html file and load it into flash?
I really am above my head on this one mainly because I dont really know that much about phpscripting when it comes to dealing with flash interaction so maybe someone has some experience?
Load From Txt File ..then Do Sequence Load Of Images...
im loading from txt file links of images and want to load each image in each mc...
it works ok though have some issue with sequence loading images...
here's the script..
ActionScript Code:
stop();
_level0.sekcija = 'WEB';
_level0.leto = '2006';
//define max value
max = 0;
var leftMax;
var lvData:LoadVars = new LoadVars();
var locText:Array = new Array();
var locImg:Array = new Array();
_level0.datoteka = '../edit_module/web_2006.txt'
lvData.load(datoteka);
lvData.onLoad = function(bSuccess:Boolean):Void
{
if (bSuccess)
{
trace("define max load ok");
//if load success
for (i=1; i<11; i++)
{
if (eval("this.picture"+i) != undefined)
{
locText[i] = eval("this.text"+i);
//load img in MC with preloader
locImg[i] = eval("this.picture"+i); //get the pic link into array
//test preloader
trace(i);
_level0.current_selection = "";
var test = eval("_level0.container.film_trak.mc_load.mc"+i);
if (_level0.current_selection == test)
{
stop();
}
else
{
_global.containerMC1 = test
_global.containerMC1.loadMovie(locImg[i]);
_level0.preloader1.gotoAndPlay(2);
trace("test this");
_level0.current_selection = test;
}
//test preloader
if (locText == "" or length(locText) == 0 or locText == "
" or locText == "
")
{
break;
}
}
else
{
break;
}
}
trace("loop end");
trace(max);
leftMax ;
}
};
and here is the script IN preloader witch is in seperate mc
ActionScript Code:
this.onEnterFrame = function() {
trace("function preload strat");
percent = (_global.containerMC1.getBytesLoaded()/_global.containerMC1.getBytesTotal())*100;
if (!isNaN(percent)) {
if (percent == 0) {
percent_display = "";
} else {
percent_display = Math.ceil(percent)+"%";
}
this.loadbar._visible = true;
this.loadbar._xscale = percent;
if (percent>1) {
this.reelmc1._visible = true;
}
_global.containerMC1.stop();
}
if (percent == 100) {
trace("preload func. 100%");
this.gotoAndStop(1);
delete this.onEnterFrame;
this.reelmc1._visible = false;
percent_display = "";
this.loadbar._visible = false;
_global.containerMC1.play();
trace("test tole");
trace(containerMC1);
}
};
stop();
hmmmmmm
now let me explain...
the preloader function doesnt start until the loop (for) is finished!?!?!
i dont get this!
i wnat that preloader works for every load..for every image...
can anyone tell me what am i doing wrong?
|