loading jpegs into empty movie clips

  • sneves
  • Born
  • Born
  • sneves
  • Posts: 3

Post 3+ Months Ago

Hey!

I'm not experienced with actionscript. I have a question. I want to have a bunch of empty movie clips, I want to load jpegs into them, and I want each jpeg to fade in and out. How would i do that? I tried searching the forums but I couldn't find anything. Help is greatly appreciated! Please help!!!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Aspirin99
  • Novice
  • Novice
  • Aspirin99
  • Posts: 23
  • Loc: Minneapolis

Post 3+ Months Ago

To fade it in, you will want the empty mc to start with a an _alpha level of zero and increase it. For example, at the same time you load the jpg, you could set a var to true like _root.fadeUp1=1;

then... (if your jpg is loading into a movie with an instance name of holderMc1- for example)

Code: [ Select ]
onClipEvent(enterFrame) {

if (_root.fadeUp1=1 && _root.holderMc1._alpha<100) {
_root.holderMc1._alpha = _root.holderMc1._alpha+3;
}
}
  1. onClipEvent(enterFrame) {
  2. if (_root.fadeUp1=1 && _root.holderMc1._alpha<100) {
  3. _root.holderMc1._alpha = _root.holderMc1._alpha+3;
  4. }
  5. }


Add the above code to the Action panel of a movieclip, but not on the Action panel of any of the movieclips that will have jpg's loaded into them. Another empty clip will work fine.
  • sneves
  • Born
  • Born
  • sneves
  • Posts: 3

Post 3+ Months Ago

Thanks so much for responding!! What code would I put for each movie clip so that the jpegs load onto it.
  • Aspirin99
  • Novice
  • Novice
  • Aspirin99
  • Posts: 23
  • Loc: Minneapolis

Post 3+ Months Ago

then... (if your jpg is loading into a movie with an instance name of holderMc1- for example)

_root.holderMc1.loadMovie("filename1.jpg");
  • sneves
  • Born
  • Born
  • sneves
  • Posts: 3

Post 3+ Months Ago

Thanks! That worked for loading the jpegs. My question is where should I put the actions for the change in alpha? I'm not sure how to set a var. Thank you so much for helping me!!!
  • Aspirin99
  • Novice
  • Novice
  • Aspirin99
  • Posts: 23
  • Loc: Minneapolis

Post 3+ Months Ago

Press CTRL-F8 to insert a new movie. Name it emptyMc. Drag a copy of emptyMc onto the stage any place (even off of the stage). Make sure it is selected with your mouse. If so, you'll see the properties box. Press F9 and the Action Panel for that instance of emptyMc will either appear or disappear.

Click in the Action Panel and paste the code I suggested.

Setting a var. When you load the jpg, use the following 3 lines:

_holderMc1._alpha = 0;
_root.fadeUp1=1; // this is the var that activates the fade up.
_root.holderMc1.loadMovie("filename1.jpg");

Don't paste the above on the instance of emptyMc or on holderMc.

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 14 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.