A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: IMG src= tags

  1. #1
    Junior Member
    Join Date
    Dec 2004
    Posts
    19

    IMG src= tags

    I have a php script that outputs the currently playing song , album and artist from my internet radio station. I have the ability to also output the image tag so I can display the album cover, but when I add that to the php output script, it get ignored. How do I dynamically display a picture from the web in a Koolmoves movie.
    I use a regular image tag <img src='Filename'>

    The rest works fine and the php script that just runs byitself not feeding the movie works fine.

    I really would like to display the album covers in the movie.
    I have a loop that refreshes the info at song change.so I get the correct image for the album.

    Thanks
    Elbert Dee

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    you can dynamicly load a jpg into an empty movie clip with the loadMovie command.

  3. #3
    Junior Member
    Join Date
    Dec 2004
    Posts
    19
    Bret
    Thanks
    in theory I understand, but in actual use Im not sure
    loadmovie("url","level")
    ok now I have a php script that can generate the picture location and I can do the loadVariablesNum ("http://www.natvestream7.com/swftest.php", 0,"POST"); to cause it to run the php script
    swftest.php writes the file swfplaying.txt

    loadVariables("http://www.nativestream7.com/swfplaying.txt",_root);
    _root.createTextField("gamlst",1,95,120,325,90);
    gamlst.multiline = true;
    gamlst.wordWrap = true;
    gamlst.border = false;
    gamlst.bordercolor = 0x6ECAD6;
    gamlst.html = true;
    gamlst.type = dynamic;
    gamlst.selectable = false;
    gamlst.background = true;
    gamlst.backgroundColor =0xDE9F7C;
    gamlst.variable = "files";
    to get it to display the html

    I can do one that only outputs the image location but how do I pass it to the loadmovie
    ?
    Thanks, sorry if I am being dense
    Just not used to action scripts PHP i know much better.
    the website is www.nativestream7.com

    Thanks again

    Elbert dee

  4. #4
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Ah I see....You're sending it all as HTML for a editbox... Hmm I thought the IMG tag was supposed to work. Can you send the url for the image via another variable? otherwise you'll have to extract it from the other text.

  5. #5
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Quote Originally Posted by blanius
    Hmm I thought the IMG tag was supposed to work.
    Img tag works for flash 7 and up.
    Code:
    <img src='myImage.jpg' width='60' height='60'>
    It's best to specify width and height to avoid rendering problems.
    You need to place all values (including numbers) between quotation marks.

  6. #6
    Junior Member
    Join Date
    Dec 2004
    Posts
    19
    Thanks
    Im not sure , here is example output from the php, at the moment it writes it to a text fiile which the KoolMoves flash then reads in. All works but the image tag.

    files=<img src='pictures/na.gif'><font face='Arial,Helvetica,sans-serif' size='12' color='#000000'> Currently playing <br><font face='Arial,Helvetica,sans-serif' size='12' color='#ffffff'><b>Track13</b> <font face='Arial,Helvetica,sans-serif' size='12' color='#000000'> by <font face='Arial,Helvetica,sans-serif' size='12' color='#ffffff'> <i><b>Gathering of Nations</b></i><br><font face='Arial,Helvetica,sans-serif' size='12' color='#000000'>from the album <font face='Arial,Helvetica,sans-serif' size='12' color='#ffffff'><b><i>World Spirit</i></b><br>played 55 times and requested 0 times.
    As for the width and height tag that is not a problem.

    Just trying to figure out why it doesn't work or what I am doing wrong or not doing right.
    If I load the text file into a browser it works like it should.
    I am using v 4.7.2 of KoolMoves

    I can send the tag or fully qualified image in another variable. Do I still load it into an edit box.
    If there is another way to do it please let me know.
    Ill try the seperate variable and editbox and see.

    Mean time any other help or methods to do it is appreciated.
    lke if a movie clip will work how do I pass the variable to it so it will load it .?


    Thanks

  7. #7
    Junior Member
    Join Date
    Dec 2004
    Posts
    19
    ok,
    I did get it to work
    I discoverd I was outputing a swf file ver5 not 7 went to 7 and walla it worked.
    I tried the movie clip and if I hard coded the url for the pic it worked.
    I tried a var jpg = "url)
    loadmovie(jpg,1)
    and that worked
    How do I load the url into a variable and pas that to the loadMovie.
    is there a way to declar a variable and then use the loadvariable to load it then use the loadmovie to use the variable loaded by loadvariable.

    Thanks for all the help
    Sorry I neglected to see what version of flash was outputting, but you all helped me learn some thing I did not know befor.
    Now I want to figure out how to do it into a movie clip.

    Thanks Again

    Elbert Dee

  8. #8
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    add to the end like so:

    files=<img src='pictures/na.gif'><font face='Arial,Helvetica,sans-serif' size='12' color='#000000'> Currently playing <br><font face='Arial,Helvetica,sans-serif' size='12' color='#ffffff'><b>Track13</b> <font face='Arial,Helvetica,sans-serif' size='12' color='#000000'> by <font face='Arial,Helvetica,sans-serif' size='12' color='#ffffff'> <i><b>Gathering of Nations</b></i><br><font face='Arial,Helvetica,sans-serif' size='12' color='#000000'>from the album <font face='Arial,Helvetica,sans-serif' size='12' color='#ffffff'><b><i>World Spirit</i></b><br>played 55 times and requested 0 times.&imageurl=pictures/na.gif

    then in the flash you can loadMovie(imageurl,1);

  9. #9
    Junior Member
    Join Date
    Dec 2004
    Posts
    19
    blanius

    Thanks
    Not sure why , but I cannot get it to work.

    I made a simple php file that is only concerned with the picture.

    The php file reads the database and based on the song pulls the picture name for the album cover
    so after the query I load
    ...sql stuff...
    $picture = $song['picture'];
    // ($picture has the complete url http:// etc/pictures/picname)
    echo "&imageurl=$picture";

    I tried it with single quotes around the '$picture'

    in the action script I have

    loadVariablesNum ("http://www.nativestream7.com/swfpic.php", 0,"POST");
    loadMovie(imageurl,1);

    I added a dynamic text box and called it imageurl and sure enough it gets loaded with the string produced by the echo, but the movieclip doesn't load anything.

    If I hard code the action script
    var imageurl = "http://,,,,,,,"
    loadMovie(imageurl,1);

    Then it works
    but since the picture name is dynamic I am using the php.
    any other ideas are appeciated as the current methiod will not display .gif files only .jpg and some of the album covers are .gif

    Again Thanks for All You Help

  10. #10
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    odds are that it's a timing issue. In other words the data hasn't loaded when you load the HTML box. Try this as an experiment. make a button that loads the html editbox, when the editbox that displays the URL is actually loaded then press your button and see if that works, If it does what you need to do is wait till the data is loaded.

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