# Jpg from outside source

**URL:** <https://forum.kirupa.com/t/jpg-from-outside-source/12886>\
**Category:** Uncategorized\
**Created:** [February 5, 2003, 7:48pm UTC](https://forum.kirupa.com/t/jpg-from-outside-source/12886 "2003-02-05T19:48:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dr\_vroeg](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dr\_vroeg](https://forum.kirupa.com/u/dr_vroeg)\
**Post date:** [February 5, 2003, 7:48pm UTC](https://forum.kirupa.com/t/jpg-from-outside-source/12886/1 "2003-02-05T19:48:52Z")

</div>

I was wondering if there was any way to access jpg’s or any other images from a file and have them played and controlled within flash…

I am trying to create a portfolio template for my fellow students and many don’t have any flash knowledge…,:crazy:

Thanks :beam:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 5, 2003, 7:52pm UTC](https://forum.kirupa.com/t/jpg-from-outside-source/12886/2 "2003-02-05T19:52:25Z")

</div>

This works for me:

\_root.createEmptyMovieClip(“container”,1);  
container.loadMovie(“image name.jpg”);

Happy Tokin’ 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 5, 2003, 9:12pm UTC](https://forum.kirupa.com/t/jpg-from-outside-source/12886/3 "2003-02-05T21:12:54Z")

</div>

Thankyou, but if it were to be a slideshow…how would I write the script for the images to advance on release:q:

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 5, 2003, 10:49pm UTC](https://forum.kirupa.com/t/jpg-from-outside-source/12886/4 "2003-02-05T22:49:11Z")

</div>

Well… Just name the containers like such…

container1, container2, container3… And so forth and so on…

Have a variable to keep track which container number you are on… 2 or 3 for example… Then…

```auto

// Place this in the move forward movieClip

on(press)
{
   if(containerNum <= numSlides){containerNum++;}
   else{containerNum = 1;}
}

// Place this in the move backward movieClip

on(press)
{
   if(containerNum >= 1){containerNum--;}
   else{containerNum = numSlides;}
}

Put this in your main movie frame.. The first one...

_root.onLoad = function()
{
   numSlides = 30;
   for(x=1;x<=numSlides;x++)
   {
      _root.createEmptyMovieClip("container"+x, x+10);
      _root["container"+x].loadMovie("slide"+x+".jpg");
   }
}

```

This says… If the variable containerNum (which holds which slide you are currently in…) is \<= numSlides (which holds how many slides total you have) then to advance the slide to the next one… And if it’s at the very end… To go back to the very first image…

On the second line… It’s basically the same way except it moves backwards through the slides…

On the third line… It states… When the \_root… or movie… Finally loads up… It will Create the for loop which will load up all the slides you have (gonna have to set up something here for that… Set up your own number there… I’d limit it to a small number for loading purposes on slow connections… ).

Hope this helps you out… You still need to do some more basic coding… But this should lead you in the right direction.
