Jump to content

Recommended Posts

I'm working on my site http://dreamshowstudios.net and I am trying to make a recent projects flash to display the recent projects with a thumbnail. I have the flash worked out everything is ready I just need a little advice or a pointer of what I'm doing wrong.

 

Here is what I have now:

PHP:

<?php
require_once("config.php");
if($_GET['num']) {
$i = 0;
$query = mysql_query("SELECT * FROM portfolio ORDER BY id DESC LIMIT '$_GET[num]',5");
while($result = mysql_fetch_array($query)) {
	$i++;
	$string .= "pic" . $i . "=" . $result['image'];
	if($i>0 or $i<5) {
		$string .= "&";
	}
}
print $string;
}else{
$i = 0;
$query = mysql_query("SELECT * FROM portfolio ORDER BY id DESC LIMIT 5") or die(mysql_error());
while($result = mysql_fetch_array($query)) {
	$i++;
	$string .= "pic" . $i . "=" . $result['image'];
	if($i>0 or $i<5) {
		$string .= "&";
	}
}
print $string;
}
?>

 

Flash:

The flash can be seen at my development folder not at the main site.

http://dreamshowstudios.net/development/DSS

 

ActionScript:

loadVariables("slider.php", "");
_root.text1.text = pic1;
if (pic1 ne undefined) {
Pic1.contentPath = "portfolio/" & pic1;
}

 

The _root.text1.text = pic1 is for debugging.

Link to comment
https://forums.phpfreaks.com/topic/80963-flash-and-php-problems/
Share on other sites

To pass variable from php to flash you should do like this

<?php 
// in Flash if you have kept dynamic text box, set Var as myVar   
print "&myVar=$string"; 
?>

 

this is actionscript for that dynamic text box

 

onClipEvent (load)
{
    loadVariables("nameofthefile.php", this, "GET");
}

Ok I'm making some progress. I have pic1 coming in and going into the box under ContentLoader1. Im trying to get that text to be the contentpath in the ContentLoader.

_root.Pic1.contentPath = _root.pic1.text;

 

But its not working.

The php file is at http://dreamshowstudios.net/development/DSS/slider.php

Sorry bout the mix-up. The flash is on my mainpage http://dreamshowstudios.net/development/DSS/ the link i gave you was just to the php file. i have all the textboxes set to the varible i want to come up. how do i set the contentpath to the text in the textboxes.

Here is my update.

Same URLS as above.

I have the textboxes filling but when i set the contentpaths equal to the pic1.text it comes up with this error

Error opening URL 'file:///C|/Documents%20and%20Settings/Admin/Desktop/DreamShow%20Studios%20Newest/flash/_level0.pic5'

Error opening URL 'file:///C|/Documents%20and%20Settings/Admin/Desktop/DreamShow%20Studios%20Newest/flash/_level0.pic4'

Error opening URL 'file:///C|/Documents%20and%20Settings/Admin/Desktop/DreamShow%20Studios%20Newest/flash/_level0.pic3'

Error opening URL 'file:///C|/Documents%20and%20Settings/Admin/Desktop/DreamShow%20Studios%20Newest/flash/_level0.pic2'

Error opening URL 'file:///C|/Documents%20and%20Settings/Admin/Desktop/DreamShow%20Studios%20Newest/flash/_level0.pic1'

 

which means it is really not finding the string that lies within it is just taking the actually text in the code and using it.

 

Code:

loadVariables("http://dreamshowstudios.net/development/DSS/slider.php", this, "GET");
if(_root.pic1.text ne "") {
_root.Ctrls.Pic1.contentPath = _root.pic1.text;
_root.Ctrls.Pic2.contentPath = _root.pic2.text;
_root.Ctrls.Pic3.contentPath = _root.pic3.text;
_root.Ctrls.Pic4.contentPath = _root.pic4.text;
_root.Ctrls.Pic5.contentPath = _root.pic5.text;
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.