Pull images from SQL/PHP into Flash

I have a website that displays images that are stored in a
SQL database using PHP as a method for pulling and displaying the
images. These images are stored in the database as text (ex:
image1), then the PHP looks for the image like this:
<img src="images/Photograph/<?php echo
$row_rs_Photos['Image']; ?>.jpg" alt="" width="<?php echo
$row_rs_Photos['Thumb_Width']; ?>" height="<?php echo
$row_rs_Photos['Thumb_Height']; ?>" border="0" title="" />
I want to pull these images into Flash. I've done a bunch of
ActionScripting, but am no expert. Really don't have the foggiest
idea where to start.
-kirk

I seem to have this one working, kinda. It has an array and
automatically numbers the buttons, but there are some buttons, that
ask SQL to return a photo that doesn't exist. For instance, there
is no 7 or 8 ID in my SQL, so those buttons don't work:
http://www.lbiphotos.com/Flash/loadImages_finished.html
PHP Code:
<?php require_once('my.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType,
$theDefinedValue = "", $theNotDefinedValue = "")
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue)
: $theValue;
$theValue = function_exists("mysql_real_escape_string") ?
mysql_real_escape_string($theValue) :
mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" :
"NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) .
"'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" :
"NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue :
$theNotDefinedValue;
break;
return $theValue;
$colname_rs_Photos = "-1";
if (isset($_GET['passID'])) {
$colname_rs_Photos = (get_magic_quotes_gpc()) ?
$_GET['passID'] : addslashes($_GET['passID']);
mysql_select_db($database_LBI_Photos_Connection,
$LBI_Photos_Connection);
$query_rs_Photos = sprintf("SELECT ID_Photos, Image,
YearPhotographed FROM Photos WHERE ID_Photos = %s",
GetSQLValueString($colname_rs_Photos, "int"));
$rs_Photos = mysql_query($query_rs_Photos,
$LBI_Photos_Connection) or die(mysql_error());
$row_rs_Photos = mysql_fetch_assoc($rs_Photos);
$totalRows_rs_Photos = mysql_num_rows($rs_Photos);
$imageId = $_GET['passID'];
//MUST use code below to grab $images
$images =
$row_rs_Photos['YearPhotographed'].'/'.$row_rs_Photos['Image'];
print "image=" . $images;
?>
<?php
mysql_free_result($rs_Photos);
?>
ACTIONSCRIPT:
function loadImage(passID:Number) {
var resultLv:LoadVars = new LoadVars();
var sendLv:LoadVars = new LoadVars();
resultLv.onLoad = function(success) {
if (success) {
mcLoader.loadClip(imagePath+this.image+".jpg",
loadContainer);
trace("passID: "+passID);
sendLv.sendAndLoad(phpPath+"?passID="+String(passID),
resultLv);
function loadInit(target:MovieClip) {
trace("Begin Loading File");
trace("imagePath + this.image ; "+imagePath+this.image);
function assignButtons() {
for (var i in loadButtons) {
this[loadButtons
].numberTxt.text = String(Number(i)+1);
this[loadButtons].onRollOver = function() {
this.gotoAndStop(2);
this[loadButtons
].onRollOut = function() {
this.gotoAndStop(1);
this[loadButtons].onRelease = function() {
trace("String(this).length "+String(this).length);
if (String(this).length == 16) {
loadImage(Number(String(this).substring(String(this).length-1)));
if (String(this).length == 17) {
loadImage(Number(String(this).substring(String(this).length-2)));
var loadButtons:Array = new Array('loadBtn1', 'loadBtn2',
'loadBtn3', 'loadBtn4', 'loadBtn5', 'loadBtn6', 'loadBtn7',
'loadBtn8', 'loadBtn9', 'loadBtn10', 'loadBtn11', 'loadBtn12',
'loadBtn13', 'loadBtn14', 'loadBtn15', 'loadBtn16');
var loadContainer:MovieClip =
this.createEmptyMovieClip("loadContainer",
this.getNextHighestDepth());
var siteUrl:String = "
http://www.lbiphotos.com";
var imagePath:String = siteUrl+"/images/Photograph/";
var phpPath:String = siteUrl+"/Flash/images.php";
var mcLoader:MovieClipLoader = new MovieClipLoader();
var mcLoadObj:Object = new Object();
mcLoadObj.onLoadInit = loadInit;
mcLoader.addListener(mcLoadObj);
//below centers called image
loadContainer._x = (Stage.width/2-100);
loadContainer._y = (Stage.height/2-100);
assignButtons();

Similar Messages

  • Loading Image from HTML page into Flash component

    Ok, after doing much research on the internet, I am pretty
    sure you have to be a Flash and Actionscripting Jedi in order to
    solve this issue. Here we go:
    I have created an HTML page using PHP and MySql that displays
    image thumbnails. When a user chooses and clicks on one of the
    thumbnails, I want the larger image to be loaded into my swf. It is
    a jigsaw puzzle component I picked up here: www.crifano.com. Here
    is the puzzle on my page with an image manually inserted using
    Flash 8 (Note: This is only working in Internet Explorer right now,
    for whatever reason):
    http://premieretans.com/puzzle/jigsaw.php.
    I want the image on this page to be chosen by the user from a
    number of images that are populated on a regular PHP/HTML page from
    a MySql database. What is the best way to go about this?
    Thanks so much for the help on this matter. I know I am not
    the only person who has run into this dilemma, so I hope your
    knowledge will save others with a similar problem the hours I have
    spent on this issue myself. Thank you!
    Cheers-
    Charles

    Hi,
    There's no direct support for this. But you could implement
    drag and drop the way you normally would in javascript. Except
    here, on mouseUp over a div encapsulating the object or embed tag
    (the flash object), you'll need to make a call into actionscript
    from javascript indicating that a drag and drop happened.
    For more info, see
    how
    to drag and drop using javascript and
    actionscript
    and javascript communication

  • Using flash to display images from sql server or file system

    hello,
    what methods and parameters of the urlloader class we have to use to display images in a flash player if possible..
    also movie should update everytime a new image is added to a database or file
    the images can either be in a file system or in a sql database (if possible)
    does flash comes with an object of this type or we have to create it.
    regards,

    i responded to your duplicate message 4 days ago:
    is it possible to insert and retrieve images from sql server using actionscript.
    you'll need server-side script to query your database and you can use the flash urlloader class to call your script.
    also  is it possible to create a flash scrolling gallery based on images  stored in a database and everytime an image is added it is displayed in  the gallery.
    load the data using the urlloader class and  then load the images.  periodically query the database for new images if  there's no direct way for flash to know a new image was added.

  • I am trying to import developed images from LightRoom 5 into Photoshop 6.  I am receiving this message and the images will not open.....'Could not open scratch file because the file is locked, you do not have necessary access permissions or another progra

    I am trying to import developed images from LightRoom 5 into Photoshop 6.  I am receiving this message and the images will not open.....'Could not open scratch file because the file is locked, you do not have necessary access permissions or another program is using the file.  Use the 'properties' command in the Windows Explorer to unlock the file'.  This has not happened before.  How do I change this?

    Could not open a scratch file because the file is locked or you do not have the necessary access privileges. (…) | Mylen…
    Mylenium

  • I used to be able to copy and paste images from the internet into keynote slides and pages. Now when I copy and paste all I get is an empty  box. My iskysoft iTube studio has also stopped downloading videos. Is there an extension I need to enable?

    I used to be able to copy and paste images from the internet into keynote slides and pages. Now when I copy and paste all I get is an empty  box. My iskysoft iTube studio has also stopped downloading videos. Is there an extension I need to enable? Any ideas

    Try dragging the image to the desktop, then drag the image to the slide you want it on

  • Why can't I drag and drop images from the browser into other programs?

    Ever since I upgraded to Firefox 4 (even after I upgraded again to Firefox 5) I have been unable to drag images from the browser into other programs, including MS Paint and IcoFx. I receive an error message stating that the file (the address given lists it as being located in the temporary files folder) cannot be found.
    Prior to this I had always been able to conveniently drag and drop images for easy editing without having to save first and then open them. This feature is important to me, as I work with graphics very often, and is still available in Chrome and Internet Explorer. I love Firefox though, and hope that there is something I can do to fix the problem.

    I had this problem on Windows 8.1.1 and iTunes 11.2.2.3
    To resolve it from within Itunes I did :  Edit, Preferences, Sharing.
    I took the tick out of "Share my library on my local network"
    Click OK.
    Closed iTunes/
    Reopened iTunes and I can drag and drop.
    I went back into Edit, Preferences, Sharing and put the tick back and clicked OK.
    Works fine now.

  • How do I get a raw image from "My Pictures" into Photoshop?

    How do I get a RAW image from "My Pictures" into Photoshop? When I send it to Photoshop , it shows up as a grey checkerboard. The title is on the top. Whe I try to send a picture from Camera Raw, it does the same thing.

    Has it ever worked or is this just something that started happening recently?
    Have you tried resetting the photoshop preferences file?
    http://forums.adobe.com/thread/375776?tstart=0
    Have you installed the latest updates for photoshop cs5?
    In photoshop cs5 go to Help>Updates
    To post the system info here on the forum it might depend on your browser, but using firefox as an example, you would open the system info in photoshop, press Copy then OK.
    Here on the forum you would press the ctrl key and paste.

  • Screensaver pulling images from who knows where...

    All,
    I'm a bit confused here. My screen saver used to be an album in my iPhoto. However, seemingly out of nowhere, it was pulling images from who knows where and all over the place.
    I have deleted my iPhoto library and re-imported my images and re-made my albums. But, have not fixed the problem. I have also verified and repaired permissions and rebooted also not fixing the problem.
    Any help would be greatly appreciated.

    Try com.apple.screensaver.[long alphanumeric number].plist, if you can find it on your machine. I just changed my Screensaver preferred folder and then did a File Buddy search for .plist files that had been modified in the last 5 minutes, and that one turned up — among a few others. I doubt that the number in your plist's filename would or should be the same as mine, and that's why I didn't include mine above. The path to my file is:
    HD>Users>My username>Library>Preferences>ByHost>file

  • Import data from SQL Server into MS Word document for Mail Merge purpose ?

    Hi,
    Is it possible to import contacts from SQL Server into MS Word for mail merge purpose or if retrieving data from MS Excel can we update the data in MS Excel sheet without opening it ?
    Note: Remember when you open a word document already set up for mail merge, asks you to run the query to return all records from the excel sheet it is connected to.
    Khurram

    Word and the current data source dialog do not really give you any help with that.
    You either have to be able to create a View in SQL Server that performs the query you need, then connect to that, or you have to be able to create the correct query manually (or perhaps using some other query tool that can help you), then use VBA to connect
    using that query. 
    For example, if you have been through the connection process once (connecting to a single table) then you will have a .odc (Office Data Connection file) which has the info. needed to connect to the correct server and database. It's a text file with some
    HTML and XML inside. You can copy/rename it. Let's say it is called "c:\a\myodc.odc" Then in VBA you can use something like
    ActiveDocument.OpenDataSource Name:="c:\a\myodc.odc, _
    SQLStatement:="put your SQL statement in here, and if it is long,...", _
    SQLStatement1:="put the second part in here"
    You get a maximum of either 255 or around 511 characters in the SQL statement, and Word tends to impose some syntax requirements that Transact-SQL does not, so e.g. you may need to quote all your table names.
    You can also se an empty .odc file and provide connection info. in the COnnection:= parameter in OpenDataSource.
    As background, until Word 2000, by default you would use MS Query to create your SQL query, and MS Query does have facilities that can help you build your query (a bit like the ones in MS Access). That may still be possible (it is a bit harder to find the MS
    Query option now, and I am not sure it works with the latest versions of Word). MS Query only works for ODBC queries, and they do not always work correctly when you actually issue the query using ODBC from Word, because of a Word problem to do with Unicode
    fields in SQL Server. But you could probably still use MS Query to help you construct your SQL. (It's probably easier to do that in Excel, though).
    Peter Jamieson

  • Importing Images from iPhoto 11 into Elements 12 Organizer

    A friend is having lots of trouble trying to move his images from iPhoto 11 into the Elements Organizer, version 12.
    Someone tried to do it for him and he has hundreds of folders in the organizer that don't make any sense and often have only one image in them.
    To help him I would like to do two things:
    1.  How can we delete the entire import and start over?
    2.  What is the correct way to move these images into the elements organizer?
    Thanks for your help.
    Mary Lou
    PS:  It occurs to me that perhaps he needs to export them to his hard drive and then import then into the Organizer.  Might this be correct? If it is, he will still need to get rid of all the folder there now.

    To anwser the two questions you asked-
    1.  How can we delete the entire import and start over? : You may select all media in Elements Organizer grid (which he imported from iPhoto) and hit Delete key
    2.  What is the correct way to move these images into the elements organizer? : The correct way is what he already did. Actually the folder naming convention is same as that of iPhoto. If you see the package contents of iPhoto Library, these folders can be seen there as well. When importing in Elements Organizer, it creates a copy of the iPhoto folder structure and then imports in the catalog.
    Thanks
    Andaleeb

  • Is there a way to pull images from an slideshow?

    how do i pull images from a slideshow and bring them back to normal iphoto album?

    Those images are in your Library.
    Regards
    TD

  • Retrieving  the score value from the captivate into flash

    Hi,
    We have used Captive 2 to built course & publishing it as
    a non e-learning output
    and loading the published swf file in custom built flash
    movie (wrapper).
    We have accessed some of the captivate variables to control
    the captivate swf.
    Does anyone know how to retrieve the score value from the
    captivate into flash ?
    Thanks
    Regards
    Chetan

    Hello,
    Use the Object Browser in .NET and search on "Summaryinfo" and you'll find the API to use.
    Thank you
    Don

  • Since I downloaded the latest PSE12 update, when I download images from my camera into Organizer on my iMac, the application freezes.

    Since I installed the latest PSE12 update, when I download images from my camera into Organizer on my iMac, the application freezes.  If I "force quit" then it seems to download them, but will do nothing else, including verifying and deleting the images from my camera.  It worked fine prior to the update.

    Dear Steve--
        You are the man--a true Apple genius. Your suggestion worked.
        Thanks you so much.
      Charlie Jarowski

  • One report to pull data from SQL or DB2

    Hi Guys,
    First post here.  I have scoured the internet using our good friend google for answers and have come up empty.  I hope someone can help me here!
    Some Info: Crystal XI R2, Visual Studio 2005, Ms SQL Server 2005, DB2, VB.NET
    What I am trying to accomplish is using one report to pull data from either SQL 2005 or DB2.
    The problem I get is if the report is configured to pull data from SQL 2005, I cannot change it using the code below to pull data from DB2.  The SQL Report uses the Microsoft OLEDB Provider.  The DB2 report uses the IBM DB2 UDB for iSeries IBMDA400 OLEDB provider.  When I quickwatch the oCRTable logon information, it seems to retain the other database's info.
    Any ideas?
    My code:
        Private Sub LoadRpt(ByVal rpt As String)
            Try
                Dim strReport As String
                Dim crReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
                Dim rpt As CrystalDecisions.CrystalReports.Engine.ReportDocument
                Dim oCRTable As CrystalDecisions.CrystalReports.Engine.Table
                Dim oCRConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo()
                strRptNm = String.Format(".rpt", rpt )
                strReport = String.Format("\{1}", Server.MapPath("Reports"), rpt )
                crReportDocument.Load(rpr)
                '   check to make sure report is loaded; if not, then do nothing
                If crReportDocument.IsLoaded Then
                    oCRConnectionInfo.DatabaseName = ConfigurationManager.AppSettings.Item("DataBase")
                    oCRConnectionInfo.ServerName = ConfigurationManager.AppSettings.Item("Server")
                    oCRConnectionInfo.UserID = ConfigurationManager.AppSettings.Item("Profile")
                    oCRConnectionInfo.Password = ConfigurationManager.AppSettings.Item("Password")
                    For Each oCRTable In crReportDocument.Database.Tables
                        oCRTable.LogOnInfo.ConnectionInfo = oCRConnectionInfo
                        oCRTable.ApplyLogOnInfo(oCRTable.LogOnInfo)
                        oCRTable.Location = oCRTable.Location
                    Next
                    For Each rpt In crReportDocument.Subreports()
                        For Each oCRTable In rpt.Database.Tables
                            oCRTable.LogOnInfo.ConnectionInfo = oCRConnectionInfo
                            oCRTable.ApplyLogOnInfo(oCRTable.LogOnInfo)
                            oCRTable.Location = oCRTable.Location
                        Next
                    Next
                ... other code ...
                End If
            Catch ex As Exception
                ... other code ...
            End Try
        End Sub
    Edited by: Mace Windu on Feb 7, 2009 7:55 AM
    Edited by: Mace Windu on Feb 7, 2009 7:56 AM

    David,
    Your suggestion worked to near perfection.  The only problem was that if I configured the datasource locations of the report and sub reports in CR to use the SQL ODBC, the .net program would successfully log in using the DB2 info but had a problem reading the data.  If I configured the datasource locations of the report and subreports in CR to use the DB2 ODBC, everything worked!  Thanks for the advice. 
    The force is strong with you.
    Mace

  • How to pull data from sql server ( Seperate server) & upload it into sap

    Hi All,
    I have a SQL Server database in System1,
    data base name          DB1
    Table name                 TB1
    I want pull data from TB1 & upload the same into ztable in SAP.
    How I can I achive this in ABAP.
    Thanks in Advance
    Appropriate points will be rewarded.
    Arun kumar

    Hi Arun,
    You have to do the following:
    1. Create an entry in Trxn DBCA for SQL Server in SAP, you are creating a database connection for the SQL server in SAP.
    2. You use this connection, and write Native SQL stmnts...between EXECSQL...ENDEXEC to fetch the data..and then normal ABAP statements to put that data into your ztable.
    Regards,
    Raj
    For eg:
    TABLE DBCON Entry can be like this...depends on your External database..
    CON_NAME                                  Raj                Logical name for connection
    DBMS                                           MSS              Microsoft SQL Server
    USER_NAME                                <User name>     For SQL Serve
    PASSWORD                                 <password>            "    "
    CON_ENV                  MSSQL_SERVER=<server> MSSQL_DBNAME=<database name>
    DB_RECO                 Availability type for an open database connect  
    FUNCTION z_houston_connect.
    ""Local interface:
    EXEC SQL.
    CONNECT TO 'RAJ' AS 'V'
    ENDEXEC.
    EXEC SQL.
    SET CONNECTION 'V'
    ENDEXEC.
    *- Get the data from MS-SQL Server
    EXEC SQL.
    open C1 for
    select
    l.loc_id,
    l.loc_name,
    a.acc_id,
    a.acc_name,
    d.person
    from ho_loc_mast as l
    inner join snd_acc_mast as a on l.loc_id = a.loc_id
    inner join snd_acc_addr as d on a.loc_id = d.loc_id and
    a.acc_id = d.acc_id
    where l.loc_id = '001'
    ENDEXEC.
    DO.
    EXEC SQL.
    FETCH NEXT C1 into :wa-c_locid, :wa-c_locname, :wa-c_acc_id, :wa-c_acc_name, :wa-c_person
    ENDEXEC.
    IF sy-subrc = 0.
    PERFORM loop_output.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    EXEC SQL.
    CLOSE C1
    ENDEXEC.
    ENDFUNCTION.

Maybe you are looking for

  • How to move ONE account to another Mac

    Greetings! My wife and I have separate email accounts, running Mail, on my PowerBook. I need to go away for some weeks. What is the best way of moving her account/mailboxes/mail history to the kids' Mac while I am away? And then, of course, move it a

  • Transaction only as follow up transaction

    Hi all, I hope you can help me. We would like to make a certain transaction only available as follow up transaction as not as initial transaction. I know that this is possible by means of authorization but I would like to know whether this can be don

  • Fetching data from a table and displaying it on the text box

    Hi, I have created a dialog program in which created a container(text box)  to enter data upto 1000 characters. Iam capturing the data and storing it in a custom table. In PBO I want to fetch data from my custom table (if data is already present :100

  • Apple TV stopped talking to MacBook

    Any idea why Apple TV just stalled all of a sudden and no longer communicates with my MacBook? I am running 10.8.4 Mountain Lion and 11.0.4 for iTunes.

  • Tape to CD

    Hey I was wondering how I can get all my old tapes onto my computer so that I can burn them to CD? My computer does not have a microphone jack or else I would just record them through a double ended wire. thanks for the tips. Austin