Ask a Question related to Macromedia Flash, Design and Development.
-
Bjørn-Ole Schjølberg #1
Loading images in a movieClip using PHP/MySQL
Loading images in a movieClip using PHP/MySQL
I'm just starting to learn Actioncript, so this may be simple.
I would be very happy if anyone could help me out.
This is my code. It's OK, but I want more.
//instance of movieClip called "imagecontainer" and path to where the image
is
imagefield_01.loadMovie("jpg/my_image01.jpg");
//positioning the second movieclip containing the second image
setProperty("_level0.imagefield_02", _x, 262);
//instance of movieClip called "imagecontainer" and path to where the image
is
imagefield_02.loadMovie("jpg/my_image02.jpg");
This is what I would like to find out:
1. I'm storing the path of the image in a MySQL database. I'm using PHP to
query the database.
This is OK, but how do I get the value of the query in the Actionscript
code?
2. How do I position each image relative to the previous one? The challenge
is that each image may have a different width than the previous and the
next.
3. My plan is to create a fixed number of movieclips. But is there a way to
generate movieclips based on the number of images(paths) returned from
PHP/MySQL?
Thank you so much if you can help me!
Nole
Bjørn-Ole Schjølberg Guest
-
Embed images in one MovieClip, use in another?
I apologize if you've already read this message. My question isn't only AS, not only Flash, not only Flex. It's in the mysterious area where the... -
Need help: Images, from an array, into a MovieClip by OOP
Hi all, I have a big problem and I don't know how to solve it (I tried for hours but I'm new to actionscript). All of the following by OOP... -
loading a movieclip if and when needed
hello. could someone please tell me how to load a movieclip from the library only if it is needed and therefore when it is needed. i've tried... -
loading and scaling an external SWF into a movieclip?
Hi. I'm sure there's a way to do this easily with AS, but I don't know how. I'm trying to load an SWF into an empty movieclip instance. I've got... -
images not loading
I've created a portfolio that works great when I create a regular Projector. But when I try to publish it and view the Shockwave file in a browser... -
knut einar skjær #2
Re: Loading images in a movieClip using PHP/MySQL
Bjørn-Ole Schjølberg <bos@botanikus.net> wrote:
You return the value as echo ("my_query_result=$my_query_result"); (You> Loading images in a movieClip using PHP/MySQL
> I'm just starting to learn Actioncript, so this may be simple.
> I would be very happy if anyone could help me out.
>
> This is my code. It's OK, but I want more.
>
> //instance of movieClip called "imagecontainer" and path to where the image
> is
> imagefield_01.loadMovie("jpg/my_image01.jpg");
>
> //positioning the second movieclip containing the second image
> setProperty("_level0.imagefield_02", _x, 262);
>
> //instance of movieClip called "imagecontainer" and path to where the image
> is
> imagefield_02.loadMovie("jpg/my_image02.jpg");
>
> This is what I would like to find out:
>
> 1. I'm storing the path of the image in a MySQL database. I'm using PHP to
> query the database.
> This is OK, but how do I get the value of the query in the Actionscript
> code?
may have to url_encode or use utf8_encode to get it right in Flash, but
PHP does whatever you need)If you want relative positioning, I suggest you get wharever property>
> 2. How do I position each image relative to the previous one? The challenge
> is that each image may have a different width than the previous and the
> next.
you need from the image you place related to (like:
new_y_pos = _root.first_image._y+40;
_root.second_image._y = new_y_pos;That should easily be accomplished by getting a result_count from php.>
> 3. My plan is to create a fixed number of movieclips. But is there a way to
> generate movieclips based on the number of images(paths) returned from
> PHP/MySQL?Your welcome. BTW: This isn't beginners stuff :)>
> Thank you so much if you can help me!
>
--
Knut Einar Skjær
[url]www.rsd.no[/url]
knut einar skjær Guest
-
Nole #3
Re: Loading images in a movieClip using PHP/MySQL
Hello again. Thanks for replying.
I'm still struggling with how to reference the variable in my script.
I get a variable sent from the PHP scipt. This is OK. It is the right
reference in the Flash file. I've tried to output the variable to a dynamic
textfield and it shows the correct string. My challenge is to reference to
this variable in the correct manner.
If I get a variable like &imagename=../jpg/image.jpg from the php script. In
the dynamic textfield only "../jpg/image.jpg" would appear. Instead of
appearing in the textfield I'd like the variable to be the path of the
image, but I don't know how to write this to get it right.
Do I write:
imagefield_01.loadMovie("imagename");
or
imagefield_01.loadMovie(imagename);
or
imagefield_01.loadMovie("&imagename");
or som other way?
Hope this explains better what I'd like to accomplish.
Bjørn-Ole
""knut einar skjær"" <knut-einar@#ikkedette#rsd.no> skrev i melding
news:1gmrs2g.1qa5ypyzs9mcoN%knut-einar@%23ikkedette%23rsd.no...> Bjørn-Ole Schjølberg <bos@botanikus.net> wrote:
>>>> Loading images in a movieClip using PHP/MySQL
>> I'm just starting to learn Actioncript, so this may be simple.
>> I would be very happy if anyone could help me out.
>>
>> This is my code. It's OK, but I want more.
>>
>> //instance of movieClip called "imagecontainer" and path to where the
>> image
>> is
>> imagefield_01.loadMovie("jpg/my_image01.jpg");
>>
>> //positioning the second movieclip containing the second image
>> setProperty("_level0.imagefield_02", _x, 262);
>>
>> //instance of movieClip called "imagecontainer" and path to where the
>> image
>> is
>> imagefield_02.loadMovie("jpg/my_image02.jpg");
>>
>> This is what I would like to find out:
>>
>> 1. I'm storing the path of the image in a MySQL database. I'm using PHP
>> to
>> query the database.
>> This is OK, but how do I get the value of the query in the Actionscript
>> code?
> You return the value as echo ("my_query_result=$my_query_result"); (You
> may have to url_encode or use utf8_encode to get it right in Flash, but
> PHP does whatever you need)>>>
>> 2. How do I position each image relative to the previous one? The
>> challenge
>> is that each image may have a different width than the previous and the
>> next.
> If you want relative positioning, I suggest you get wharever property
> you need from the image you place related to (like:
>
> new_y_pos = _root.first_image._y+40;
> _root.second_image._y = new_y_pos;>>>
>> 3. My plan is to create a fixed number of movieclips. But is there a way
>> to
>> generate movieclips based on the number of images(paths) returned from
>> PHP/MySQL?
> That should easily be accomplished by getting a result_count from php.> Your welcome. BTW: This isn't beginners stuff :)>>
>> Thank you so much if you can help me!
>>
>
> --
> Knut Einar Skjær
> [url]www.rsd.no[/url]
Nole Guest
-
knut einar skjær #4
Re: Loading images in a movieClip using PHP/MySQL
Nole <bos@botanikus.net> wrote:
You are very close to get this working! If you can see your variable in> If I get a variable like &imagename=../jpg/image.jpg from the php script. In
> the dynamic textfield only "../jpg/image.jpg" would appear. Instead of
> appearing in the textfield I'd like the variable to be the path of the
> image, but I don't know how to write this to get it right.
>
> Do I write:
>
> imagefield_01.loadMovie("imagename");
>
> or
>
> imagefield_01.loadMovie(imagename);
>
> or
>
> imagefield_01.loadMovie("&imagename");
Flash, its just a matter of placing it right, and your done. Sounds a
litle strange to me that you have the "&" attached to your variable, but
that can be something in your php-script.
Can you show me the code you've been using so far? As I told you, I
think you almost got it, but its difficult to tell you where the problem
is whithout seeing the code.
--
Knut Einar
knut einar skjær Guest



Reply With Quote

