A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: dynamically loading images using flashmx and php

  1. #1
    www.intensewd.com
    Join Date
    Apr 2002
    Location
    Australia
    Posts
    450
    Hi,

    I've written a little php script that pulls elements (names) out of an array and returns the values to flashmx.

    there are 3 frames in the swf.
    frame 1 = loads the variables from the php script
    frame 2 = loops back to frame 1 until the script finishes
    frame 3 = loadMovie(thumb[0], 1); then stops
    // thumb[0] is a variable from the php script
    which contains the location and filename of
    the thumbnail //

    Flashmx will display the variables (names) but it won't let me use those variables to specify an image using loadMovie.

    The php script works properly, and can be viewed at:
    http://www.bossmodelz.com/temp/list.php
    // it only outputs the variables

    Anyone have any advice?

    to check out the swf file : http://www.bossmodelz.com/temp/list.html

    Thanks,
    Ben
    [Edited by benlowry on 04-02-2002 at 02:17 AM]

  2. #2
    Hi there,

    It's loading up those images fine when you use absolute references to the jpeg URLs, so I can only imagine you are trying to use the array of names before it is actually filled. Try trace(thumb[0]) on frame 3, and if that doesn't output 'undefined' I have no idea...

    Better solution is to use a loadVars object, since it is abstracted from the rest of your variables and has an onLoad event handler. It's easier not to use timelines when dealing with client/server stuff.

    Hope that helps

  3. #3
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    I do not know whether F6 changed anything there, but your way of sending the data would not create array elements thumb[0] but rather weird variables with square brackets in their names
    Change your php so that it sends
    thumbs=first.jpeg,second.jpeg,third.jpeg
    Make your actionscript so that it does not loop back to where loadvariables is called (if you use frame loop, you will need two frames in between loading and using vars)
    Use
    thumb = thumbs.split(',')
    to get array elements back

    Musicman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center