# Loadmovie and variables

**URL:** <https://forum.kirupa.com/t/loadmovie-and-variables/271999>\
**Category:** flash\
**Created:** [October 1, 2008, 8:06am UTC](https://forum.kirupa.com/t/loadmovie-and-variables/271999 "2008-10-01T08:06:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![geraldinechx](https://avatars.discourse-cdn.com/v4/letter/g/e19b73/32.png) [@geraldinechx](https://forum.kirupa.com/u/geraldinechx)\
**Post date:** [October 1, 2008, 8:06am UTC](https://forum.kirupa.com/t/loadmovie-and-variables/271999/1 "2008-10-01T08:06:59Z")

</div>

Hello to all!

If some of you have got time to look at my case.

I have this script :

```auto

function click()
{
    bouton_av.gotoAndStop(2);
    loadMovie(_photo, "photo");
    art = _art;
    ref = "Réf. " + _ref;
    design = _design;
    if (_exprix > 0)
    {
        barre._visible = true;
        prix0 = _exprix + " €";
        prix1 = _prix + " €";
    }
    else
    {
        barre._visible = false;
        prix = _prix + " €";
    }
 
function over(n) {
    n = real_val[n];
    n = n+20*(no_sous_rayon-1);
    _photo = _root["photo"+n];
    _art = _root["art"+n];
    _ref = _root["ref"+n];
    _design = _root["design"+n];
    _prix = _root["prix"+n];
    _exprix = _root["exprix"+n];
    bulle._visible = true;
    startDrag("bulle", true);
    bulle.ref = "réf.\r"+_ref;
}
 
bulle._visible = false;
barre._visible = false;
point_info._visible = false;
no_sous_rayon = 1;
real_val = new Array();

```

Next : I have 4 buttons with instance names “ **v1** ”, “ **v2** ”, “ **v3** ”, “ **v4** ” and codes associeted to each button (1/2/3/4 after “over”) :

```auto

on (release)
{
    click();
}
on (rollOver)
{
    over(1);
}
on (rollOut)
{
    out();
}

```

And in the timeline :

```auto

function click()
{
    _parent.click();
}
function over(n)
{
    _parent.over(n);
}
function out()
{
    _parent.out();
}
stop ();

```

Finally, I have a movieclip with the instance name of “ **photo** ”. (A few elements are missing but they have nothing to do with my problem)

Currently, when one button is clicked, the variable photo appears in the target MC “photo”.

In fact, I’d like to have sort of previews of the images on each button : each variable photo would appear on target MCs with names “ **photo1** ”, “ **photo2** ”, “ **photo3** ”, “ **photo4** ”. Could someone help?

In advance, thank you very very much.
