Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Help With DupMC Loader In Dynamic Gallery



Hi,

can anyone point me in the right direction here?

I need to add a loader into a dynamically created movie clip, something like this:

MAIN_MC -> creates CHILD_MC & CHILD_MC.imageMC
while actionscript loads the dynamic image into CHILD_MC.imageMC
a loader is displayed, then deleted when load complete.

heh, i KNOW.. not another loader question.. I just can't seem to get my AS right on this though.

Thanks in advance gang!

Cheers



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 07-12-2006, 02:14 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

DupMC,missing Something?
I've duplicated a number of mc's with a frame loop, naming them incrementally with a variable:

duplicateMovieClip (clip,"clip"+i,i);

After setting the newly duped mc's property I'm trying to assign a value to a textfield inside the newly duped mc by writing something like this:

newMC="clip"+i;
newMC.textField="stuff";

That doesn't work. All the naming and paths are correct however. I tested it addressing the new mc directly:

clip1.textField="stuff";

that works! I know that I am just forgetting some syntax rules or something, I can't figure it out! If you see anything blazingly wrong (it doesn't really have to blaze) let me know.

Also let me in on any forum manners that I may be breaking, I don't post too often, unless I'm truly stumped. And I know it's something embarassingly simple that I'm missing. If my problem description is too vague, scold me and I'll try and be more descriptive. Thanks in advance for any help.

Ben

DupMC: How To Get This Effect...
I understand how to use the duplicateMC method pretty well but not as well as I'd like.

The portfolio section of V3 2Advanced (http://2advanced.com/archive/v3/flashindex.htm) has the nav buttons for the section enter by slide fading from the right - one after the other.

I assume it's using dupMC, but how is it done? I can do the dupMC but all buttons appear at once rather than one after the other.

Thanks

DupMC: Fade In Each Button?
I have a question. I'm familiar somewhat with the duplicateMC() function but can not figure out how to do it - I see this everywhere BTW...

Check out http://www.advanceflash.net/ . The nav on the lower right comes in with a fade-swipe for each button. How would I actually have the transition occur? I have used the dupMC() for many nav sections, but the buttons always have the fade-swipe occur at the same tipe, rather than one after the other. Make sense?

Thanks

DupMC: Fade In Each Button?
I have a question. I'm familiar somewhat with the duplicateMC() function but can not figure out how to do it - I see this everywhere BTW...

Check out http://www.advanceflash.net/ . The nav on the lower right comes in with a fade-swipe for each button. How would I actually have the transition occur? I have used the dupMC() for many nav sections, but the buttons always have the fade-swipe occur at the same tipe, rather than one after the other. Make sense?

Thanks

Problems With: Hitttest, DupMC, Var ==x Play MC
Hey everyone, so im wokring on this game for school and its due in a
few days but i still dont ahve all the action script working, so
hopefully maybe someone here will be able to help me out. ive included my fla so that you can see what exactly im trying to do, thanx guys.
Im having the following 3 problems:

hittest: im not sure why my hittest isnt working but, basicly what i
want it to do is when this projectile makes contact with a renovated
floor that it stops playing and swaps out the movieclip renovated
floor with poor floor.
this code is on frame 2, should it be on the mc?<code>
_root.attack_mc.onEnterFrame = function() {
if(this.hitTest(_root.renovatedfloor)) {
_root.renovatedfloor.gotoAndStop(2);
this.removeMovieClip;
_root.result="the boxes are touching";
} else {
this.gotoAndStop(1);
_root.result="the boxes are not touching";
}
};
</code>

duplicateMovieClip: problem here is the movies clips that we duplicate
are on top of everything so we cant drag and drop our bottons onto
them, is there a way to make them appear lower so that way the
bottons pass over them insted of underthem? and what do i have to ad
to a hittest the makes it so when a button passes over a MC or dupMC
that it disables the botton? ( i put this here cause i want these
duplicated Mc's to disable the renovate botton if they are still on
top of a renovated floor)
on the movieclip
<code>
onClipEvent (enterFrame) {
if (_root.move ==1) {
this._x = this._x+1;
this._y = this._y+1;
}
}
</code>
on the start botton
<code>
on (release) {
amount = 10;
while (amount>0) {
duplicateMovieClip (_root.dude, "mc"+i, i);
setProperty ("mc"+i, _x, (222.5));
setProperty ("mc"+i, _y, (210.0));
i = i+1;
amount = amount-1;
}
}
</code>

var == x play mc:
Im trying to get it so that when var time == 30 (for instance) to play the movieclip attack_mc (attack_mc is the movie clip that i am having perform the hitttest on the renovated floor mc.
<code>
function checkAttack() {
if (time == 30) {
attachMovie("attack2_mc","attack_mc2",20);
clearInterval(myInterval);
}
}
myInterval = setInterval(checkPoints, 100);
</code>

Photo Gallery Loader?
Okay so I found an online tutorial for a photo gallery which is great cause I'm very new to Flash.

Tutorial is visible here http://www.layoutgalaxy.com/html/htmnewletter41-page1.htm

Anyway I get all the way to the end and the guy says a loader is needed if this is gonna be posted online. A loader? What? I don't have the first clue what a loader is or how I would implement it into my coding. So if anyone can point me in the right direction it'sd be greatly appreciated cause I haven't found anything that I understand about a loader.

Thanks in advance.





























Edited: 06/14/2007 at 04:55:25 PM by TJ Raven

Gallery Loader Selection
Hello,

I have added a loader for my picture gallery. What I would like it to do is when I select a picture it will appear in the gallery.

What command do I need to define that when I click on the picture it will appear in the main gallery.


I hope this is clear. If you need more clarity. Let me know.

Thanks

Photo Gallery Loader?
I created a photo gallery thing loosely based off of the tutorial: "XML/Flash Photo Gallery". In this setup/tutorial your taught how to code for dynamic gallery. I am curious if this can be altered so that all of the images are stored in the .swf file allowing me to create one preloader for the entire movie as apposed to loading each picture file separate.

Thanks for the help

P.S. to see the file check it out here:
http://www.freewebtown.com/weatherfo...r%20parchment/
(it may appear blank for a while depending on your connection speed)

AS2 XML Gallery + Loader Problem...
Hey guys, I've just put the finishing touches on an XML photo gallery that loads up thumbnails that when clicked, load and display a larger version on the left. I've managed to code a preloader that works for each image, but for some reason the very first time you click one of the thumbnails the loader doesn't work, but everytime after that it does.

Here's my code:

Code:

myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
numimages = this.firstChild.childNodes.length;
hspacing = 58;
vspacing = 52;
vmult = 0;
hmult = 0;
i = 0;
j = 0;
while (i<numimages) {
while (j<4 & i<numimages) {
this.picHolder = this.firstChild.childNodes[i];
this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._x = hmult*hspacing;
this.thumbHolder._y = vmult*vspacing;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.main = this.picHolder.attributes.main;
this.thumbHolder.onRelease = function() {
_root.loadMovieWithProgress(this.main);
_root.loadMovieWithProgress = function(mname) {
_root.wipeLoad.gotoAndPlay(1);
_root.wipeLoad.loadBar._width = 0;
_root.loader.loadMovie(mname);
_root.wipeLoad.onEnterFrame = function() {
_root.preloadMC(_root.loader);
};
};
_root.preloadMC = function(mc) {
var bLoaded = mc.getBytesLoaded();
var bTotal = mc.getBytesTotal();
var twidth = _root.wipeLoad.widthGuide._width;
_root.wipeLoad.loadBar._width = twidth*bLoaded/bTotal;
if (bLoaded == bTotal && bTotal>0) {
_root.wipeLoad.gotoAndPlay(2);
}
};
title_txt.text = this.title;
};
i++;
j++;
hmult++;
}
j = 0;
hmult=0;
vmult++;
}
loader.loadMovie("images/hitc/01.jpg");
};
myPhoto.load("hitc.xml");
The wipeLoad MC has 2 frames, the 1st with the loading bar in it and a stop(); action, and the second containing another movie clip that animates (the loading bar animates out).

Thanks in advance for your help,
-Ben

Photo Gallery And Loader();
Hello,

I want to create some photo gallery, but don't know how in AS 3.0.
Ok, if I want to load only one image I would do this:


PHP Code:



        still = new Loader();        still.contentLoaderInfo.addEventListener(Event.COMPLETE, loadGallery);        var url2:String = url+"_s"+ 1 + ".jpg";                var urlReq:URLRequest = new URLRequest(url2);        still.load(urlReq);        still.alpha = 0;        if (!contains(still)) addChild(still); 




Now, that I want to load all images I am doing something like that:

PHP Code:



    for(var i=1; i<=amount; i++){        still = new Loader();                still.contentLoaderInfo.addEventListener(Event.COMPLETE, loadGallery);        var url2:String = url+"_s"+ i + ".jpg";                var urlReq:URLRequest = new URLRequest(url2);        still.load(urlReq);        still.alpha = 0;        still.y = i*10;        addChild(still);    } 




So, now it seems to me that only the last pic appears when running, cause I am adding loader instead of loader.content.

Any Help???

Also, What I want to achieve is load first image and show directly, while the rest of them are loading in background.

Right now, with this for loop I have to wait for all the pictures to get loaded and then show them.

thanks very much in advance for any suggestions about the logic of Gallery in AS 3.0.

XML Photo Gallery - Loader Won't Load :(
Hi,

I'm trying to make an XML Photo Gallery type thing. For each 'Product' it creates a new instance of a MovieClip from the library, 'XmlItem' which contains a Loader Component and Dynamic Text.

The Product Title goes into the Dynamic Text perfectly. The problem is with the Loader Component. It simply REFUSES to load the images. There's an exception. If I deliberately cause a syntax error in the Loader Component's code, then the pictures load! What the hell?

Oh, also I'm having trouble with the placement of the XmlItem instances... For each of them, what position is _x relative to?


Thanks very much in advance for any help,

Tim.

Code:







Attach Code

var XmlInput:XML = new XML();

var LastX = 200
var LastY = PicFrame._z;

var ContentPath:String
var ThisItem:String

XmlInput.ignoreWhite = true;

XmlInput.onLoad = function() {

var nodes = XmlInput.firstChild.childNodes;

for (i=0;i<nodes.length;i++) {
//var mcListItem:MovieClip = new MovieClip();

if (LastX > (PicFrame._x + PicFrame.width + 85)) {
LastX = PicFrame._x;
LastY = LastY + 150;
}

ThisItem = "Girl" + i;

MC = attachMovie("XmlItem", ThisItem, i, frame);

MC._x = LastX;
MC._y = LastY;

ContentPath = nodes[i].attributes.img;

MC.imglocation = ContentPath;

MC.textval = nodes[i].attributes.name;

eval(ThisItem).LinkImage.contentPath = ContentPath;

LastX = LastX + 100;

list.addItem(nodes[i].attributes.name);

//lstList.addItem(nodes[i].firstChild.nodeValue,i);


}


}

XmlInput.load("products.xml");

Picture Loader In Gallery Pixelating Images
I'm using this tutorial to make a gallery,

http://www.tutorialized.com/tutorial...omponent/12150

And whenever I load my jpgs the images are very pixelated and messed up.

Any idea why?

Scotties Gallery - Image Fadeout + Loader
Hi folks...
i just got that Image resize gallery by scotty and modified it to my needs...

u´ll find a preview here: http://daniel.eyedea.net/phocus/

There are just 2 little problems left for me.

If i click on a thumb to load the next image, i don´t want to disappear the actual image, and leave the container blank till the next image is loaded.
What i want for a smoother transition is that when i click on a thumb, the actually displayed image´s opacity is set to...dunno 50% or what, and a "loader" appears... (no loading bar with percentage and stuff..) just a simple "image is loading" or apple style rotating thingy u know?

i want some actions on the thumbs when i mouseover them... little bit fadeout and maybe a small "click"... same here with the main navigation.

and here comes my code:


Code:
var tnNr;
spacing = 10;
container._alpha = 0;
var curLength;
MovieClip.prototype.loadPic = function(pic, id) {
info.text = "";
this._alpha = 0;
this.loadMovie(pic);
temp = this._parent.createEmptyMovieClip("temp2", 998);
temp.onEnterFrame = function() {
var t = container.getBytesTotal(), l = container.getBytesLoaded();
if (Math.round(l/t) == 1 && container._width != 0 && container._height != 0) {
var w = container._width+spacing, h = container._height+spacing;
border.resizeMe(w, h, id);
delete this.onEnterFrame;
}
};
};

MovieClip.prototype.fade = function (speed) //custom fade in/out
{
this.onEnterFrame = function ()
{
if (this._alpha > 0)
{
this._alpha -= speed;
}
else
{
delete this.onEnterFrame;
}
};
};

MovieClip.prototype.resizeMe = function(w, h, id) {
var speed = 3;
container._alpha = 0;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
phocus._y = Math.round(this._y-this._height/1.5-22);
deco._y = Math.round(this._y-this._height/1.5-30);
gal1_btn._y = Math.round(this._y-this._height/1.5+spacing/3);
gal2_btn._y = Math.round(this._y-this._height/1.5+spacing/3);
gal3_btn._y = Math.round(this._y-this._height/1.5+spacing/3);
gal4_btn._y = Math.round(this._y-this._height/1.5+spacing/3);
scroll._y = Math.round(this._y+this._height/2+spacing+20);
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
container._x = this._x-this._width/2+spacing/2;
container._y = this._y-this._height/2+spacing/2;
info._y = Math.round(this._y+this._height/2+spacing/2);
container._alpha += 5;
if (container._alpha>90) {
info.text = id;
container._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
function galleryChoice(q) {
pArray = new Array();
tArray = new Array();
iArray = new Array();
my_xml = new XML();
for (var j = 0; j<curLength; j++) {
this.scroll.th_nav["thmb"+j].removeMovieClip();
}
my_xml.ignoreWhite = true;
my_xml.onLoad = function(loaded) {
if (loaded) {
gallery = this.firstChild.childNodes[q];
curLength = gallery.childNodes.length;
for (var i = 0; i<gallery.childNodes.length; i++) {
pArray.push(gallery.childNodes[i].attributes.source);
tArray.push(gallery.childNodes[i].attributes.thumb);
iArray.push(gallery.childNodes[i].attributes.title);
}
}
delay = setInterval(makeButtons, 50);
};
my_xml.load("gallery.xml");
}
function makeButtons() {
tnNr = 0;
clearInterval(delay);
for (var i = 0; i<tArray.length; i++) {
var thb = scroll.th_nav.thmb.duplicateMovieClip("thmb"+i, 1000+i);
thb.id = i;
thb._x = i%50*50;
thb._y = Math.floor(i/50)*50;
}
loadButtons();
}
function loadButtons() {
var tbox = scroll.th_nav["thmb"+tnNr].box;
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
if (bt == bl && bt>4) {
nextButton();
delete this.onEnterFrame;
}
};
}
function nextButton() {
if (tnNr<tArray.length-1) {
tnNr++;
loadButtons();
} else {
activateButtons();
}
}
function activateButtons() {
mainButtons();
for (var i = 0; i<pArray.length; i++) {
var but = scroll.th_nav["thmb"+i];
but.id = i;
but.onRelease = function() {
container.loadPic(pArray[this.id], iArray[this.id]);
disButtons2(this.id);
};
}
container.loadPic(pArray[0], iArray[0]);
disButtons2(0);
}
butArray = new Array();
butArray = ["gal1_btn", "gal2_btn", "gal3_btn", "gal4_btn"];
function mainButtons() {
for (var i = 0; i<butArray.length; i++) {
this[butArray[i]].id = i;
this[butArray[i]].onRollOver = function () {
this._alpha = 10;
}
this[butArray[i]].onRollOut = function () {
this._alpha = 100;
}
this[butArray[i]].onRelease = function() {
this._alpha = 100;
galleryChoice(this.id);
disButtons(this.id);
};
}
}
function disButtons2(d) {
for (var i = 0; i<tArray.length; i++) {
if (i != d) {
this.scroll.th_nav["thmb"+i].enabled = 1;
this.scroll.th_nav["thmb"+i].box._alpha = 100;
} else {
this.scroll.th_nav["thmb"+i].enabled = 0;
this.scroll.th_nav["thmb"+i].box._alpha = 50;
}
}
}
function disButtons(d) {
for (var i = 0; i<butArray.length; i++) {
if (i != d) {
this[butArray[i]].enabled = 1;
this[butArray[i]].gotoAndStop(1);
} else {
this[butArray[i]].enabled = 0;
this[butArray[i]].gotoAndStop(2);
}
}
}
disButtons(0);
galleryChoice(0);

scroll.dragger.useHandCursor = false;

Image Component Loader Gallery Thingy
Hello everyone, I'm new to the forums.

I'm working on a Flash Portfolio/Resume and have everything done except the image gallery. I've looked up several tutorials and chose the simplest one (I'm not well versed in the language known as Actionscript).

Apparently I'm supposed to place a Loader from the Components panel onto my stage and type the images name into the 'contentPath' area under Parameters. I understand that this image needs to be in the same folder as my saved file, and I seem to have done everything correctly..... But it still won't load the image when I Ctrl+Enter it.

The Flash project consists of several Stop actions and has a User Interface composed of buttons with gotoAndPlay actions. Right now the Artwork section is in from 30-44, and I have 2 buttons making use of the nextFrame/prevFrame actions. Essentially I would like to set it up so that each frame contains a different loader (each with a different file name) so that I can keep my Flash projects file size as low as possible. Am I going about this wrong?

Xml Image Gallery Loader Resulting In NaN When Online...
So... I'm still no expert at anything AS related, but I'm learning. Here's the problem. I have a listbox pulling images using an xml file. The jpgs are about 90k each, and when you click an item in the listbox there seems to be nothing happening, but really the image is just loading. Then it shows up. Yadda yadda... long story short, I'm putting in a loader to let the user know that there is something happening. When I publish and test locally no problem. When I put it up online you don't see the loader, and if you click through the images you get a NaN. I know that usually means there's an unidentified variable, but why would it work fine when I test? Obviously, I don't have the experience in troubleshooting this type of problem to even know where to start. I'm on my 3rd revision of the code, all ending up with the same results. Here's a link to the online version, and below is my code.


FYI - the images are gross... sorry.

Click "Images" then "Pedigree Selection" The rest of the sections are not available yet.

Code:

var xml:XML = new XML();
xml.ignoreWhite = true;


                   
xml.onLoad = function ()  {
   var photos = this.firstChild.childNodes;
   
   for (i=0; i<photos.length; i++){
      photoList.addItem({label:photos[i].attributes.desc, jpg:photos[i].attributes.jpg, info:photos[i].attributes.info});
}
   
   photoList.selectedIndex = 0;
   
}


xml.load("conformation.xml");
var PList:Object = new Object();
PList.change = function(evt_obj:Object) {
    var item = evt_obj.target.selectedItem;
   textHolder.text = item.info;
   infoField._visible = true;
startLoading(photoList.getItemAt(photoList.selectedIndex).jpg);

function startLoading(whichImage) {
   loadMovie(whichImage, "photoHolder");

      infoLoaded = photoHolder.getBytesLoaded();
      infoTotal = photoHolder.getBytesTotal();
      percentage = Math.round(infoLoaded/infoTotal*100);
      infoField.text = percentage+"%";
      if (percentage>=100) {
         delete this.onEnterFrame;
         infoField._visible = false;
         };
}
}
};


Any ideas?

Photo Gallery With Loader Component And Preloader
Hi,

I'm reletively new to flash and have a basic understanding of actionscript 2.

I have created a photogallery using the loader component to display the pictures so they get scaled down when they're loaded in.

I currently have 6 thumbnail buttons all with the following as2 attached to them:

on(release) (
myLoader.contentPath = "nameofpicture.jpg";
}

This works fine but I would like the pictures to preload so there isnt just a plane white screen for around 4 seconds.

I have tried using the progreess bar component with some code i found on the net, this works but only for the first pic that loads. after that it goes back to loading the pics with a blank screen while loading.

Any help is much appreciated.

:D

This Is A Fix To The Image Gallery Tutorial - Makes It A Fully Dynamic Gallery
After searching and reading a couple of hundred post on the truly GREAT Kirupa image gallery tutorial - and wondering why nobody has written a new tutorial or at least updated the "old" one to avoid overloading the net with flash image gallery questions.

Im trying to create a new thread that will serve as a basic startingpoint for all Kirupa gallery questions. Im no überscripter nor do I know a lot about flash, but with a little common sense and perhaps some help from all of you... oh well - here goes:

Quick Checklist:

If your JPG's wont load - Make sure you don't save them as progressive JPG's, as they wont load in Flash.
If your images dont align to the photo container movieclip it is probably because your registration point of the photo MC is set to center instead of topleft.
Below is the code I have pieced together from different posts on the subject (I would like to credit all the authors, but that would require me reading all the posts again, as I have forgotten where I got them.

It produces a gallery that loads files dynamicaly thru a phpscript and checks for maximum image height/width and scales the images to fit within the photo MC. It also sets the center of the displayed images to a given coordinate (x,y).

All in all this is a install and forget image gallery, where the only maintaining required is uploading new pictures to the image folder.

On the server the file/directory structure is:
gallery swf
filearray.php
images/file_x.jpg
file_y.jpg
etc...

This is the filearray.php - modify this to check for files in the path set in the actionscript line: this.pathToPics = "images/";


PHP Code:



  <?php  if ($dir = opendir("images")) {    while (($file = readdir($dir)) !== false) {          $cont++;      if ($file == "." || $file == "..") { } else {              $string.= ($file);          $string.= "&";          }        }      closedir($dir);  }  print($string);  ?>





This is the modified actionscript from the original Kirupa gallery script:


ActionScript Code:
// This loads the array created by filearray.php and puts it into pArray   lv = new LoadVars();  lv.load("filearray.php");  lv.onData = function(text){  pArray = text.split("&");  for (i=0; i<pArray.length-1; i++) {  trace(pArray[i]);  }  }    // variables ------------------------------------------  // put the path to your pics here, include the slashes (ie. "pics/")  // leave it blank if they're in the same directory  this.pathToPics = "images/";  // fill this array with your pics (set from filearray.php)  this.pArray = pArray;            this.fadeSpeed = 20;  this.pIndex = 0;    // MovieClip methods ----------------------------------  // d=direction; should 1 or -1 but can be any number  //loads an image automatically when you run animation  loadMovie(this.pathToPics+this.pArray[0], _root.photo);    // Center the photo at (x,y) the coordinates are set in line 69  MovieClip.prototype.centered = function(x, y) {  this._x = x-this._width/2;  this._y = y-this._height/2;  };  // Makes sure that the image fits within (wMax, hMax)  MovieClip.prototype.resize = function(wMax, hMax) {  while (this._width>wMax || this._height>hMax) {  this._xscale = this._yscale -= 1;  }  };  // This line sets max width and max height (wMax, hMax)  photo.resize(397, 297);    MovieClip.prototype.changePhoto = function(d) {      // make sure pIndex falls within pArray.length      this.pIndex = (this.pIndex+d)%this.pArray.length;      if (this.pIndex<0) {          this.pIndex += this.pArray.length;      }      this.onEnterFrame = fadeOut;  };  MovieClip.prototype.fadeOut = function() {      if (this.photo._alpha>this.fadeSpeed) {          this.photo._alpha -= this.fadeSpeed;      } else {          this.loadPhoto();      }  };  MovieClip.prototype.loadPhoto = function() {      // specify the movieclip to load images into      var p = _root.photo;      //------------------------------------------      p._alpha = 0;      p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);      this.onEnterFrame = loadMeter;  };  MovieClip.prototype.loadMeter = function() {      var i, l, t;      l = this.photo.getBytesLoaded();      t = this.photo.getBytesTotal();      if (t>0 && t == l) {          this.onEnterFrame = fadeIn;          // This line sets the (x,y) center of the image on the stage          this.photo.centered(249, 213);      } else {          trace(l/t);      }  };  MovieClip.prototype.fadeIn = function() {      if (this.photo._alpha<100-this.fadeSpeed) {          this.photo._alpha += this.fadeSpeed;      } else {          this.photo._alpha = 100;          this.onEnterFrame = null;      }  };


This should do it - the only thing I (think) I need some help with is changing the script to actually load the FIRST image, when the gallery loads. For some reason beyond my knowledge you have to click the next button for a image to load... What part of the script needs to be changed to make sure that a image is loaded on startup???

I hope someone will take the time to help develope this gallery tutorial / help file... It would be great if you added som more steps to the quick checklist... and of course fixed the load image on start problem....

This Is A Fix To The Image Gallery Tutorial - Makes It A Fully Dynamic Gallery
After searching and reading a couple of hundred post on the truly GREAT Kirupa image gallery tutorial - and wondering why nobody has written a new tutorial or at least updated the "old" one to avoid overloading the net with flash image gallery questions.

Im trying to create a new thread that will serve as a basic startingpoint for all Kirupa gallery questions. Im no überscripter nor do I know a lot about flash, but with a little common sense and perhaps some help from all of you... oh well - here goes:

Quick Checklist:

If your JPG's wont load - Make sure you don't save them as progressive JPG's, as they wont load in Flash.
If your images dont align to the photo container movieclip it is probably because your registration point of the photo MC is set to center instead of topleft.
Below is the code I have pieced together from different posts on the subject (I would like to credit all the authors, but that would require me reading all the posts again, as I have forgotten where I got them.

It produces a gallery that loads files dynamicaly thru a phpscript and checks for maximum image height/width and scales the images to fit within the photo MC. It also sets the center of the displayed images to a given coordinate (x,y).

All in all this is a install and forget image gallery, where the only maintaining required is uploading new pictures to the image folder.

On the server the file/directory structure is:
gallery swf
filearray.php
images/file_x.jpg
file_y.jpg
etc...

This is the filearray.php - modify this to check for files in the path set in the actionscript line: this.pathToPics = "images/";


PHP Code:



  <?php  if ($dir = opendir("images")) {    while (($file = readdir($dir)) !== false) {          $cont++;      if ($file == "." || $file == "..") { } else {              $string.= ($file);          $string.= "&";          }        }      closedir($dir);  }  print($string);  ?>





This is the modified actionscript from the original Kirupa gallery script:


ActionScript Code:
// This loads the array created by filearray.php and puts it into pArray   lv = new LoadVars();  lv.load("filearray.php");  lv.onData = function(text){  pArray = text.split("&");  for (i=0; i<pArray.length-1; i++) {  trace(pArray[i]);  }  }    // variables ------------------------------------------  // put the path to your pics here, include the slashes (ie. "pics/")  // leave it blank if they're in the same directory  this.pathToPics = "images/";  // fill this array with your pics (set from filearray.php)  this.pArray = pArray;            this.fadeSpeed = 20;  this.pIndex = 0;    // MovieClip methods ----------------------------------  // d=direction; should 1 or -1 but can be any number  //loads an image automatically when you run animation  loadMovie(this.pathToPics+this.pArray[0], _root.photo);    // Center the photo at (x,y) the coordinates are set in line 69  MovieClip.prototype.centered = function(x, y) {  this._x = x-this._width/2;  this._y = y-this._height/2;  };  // Makes sure that the image fits within (wMax, hMax)  MovieClip.prototype.resize = function(wMax, hMax) {  while (this._width>wMax || this._height>hMax) {  this._xscale = this._yscale -= 1;  }  };  // This line sets max width and max height (wMax, hMax)  photo.resize(397, 297);    MovieClip.prototype.changePhoto = function(d) {      // make sure pIndex falls within pArray.length      this.pIndex = (this.pIndex+d)%this.pArray.length;      if (this.pIndex<0) {          this.pIndex += this.pArray.length;      }      this.onEnterFrame = fadeOut;  };  MovieClip.prototype.fadeOut = function() {      if (this.photo._alpha>this.fadeSpeed) {          this.photo._alpha -= this.fadeSpeed;      } else {          this.loadPhoto();      }  };  MovieClip.prototype.loadPhoto = function() {      // specify the movieclip to load images into      var p = _root.photo;      //------------------------------------------      p._alpha = 0;      p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);      this.onEnterFrame = loadMeter;  };  MovieClip.prototype.loadMeter = function() {      var i, l, t;      l = this.photo.getBytesLoaded();      t = this.photo.getBytesTotal();      if (t>0 && t == l) {          this.onEnterFrame = fadeIn;          // This line sets the (x,y) center of the image on the stage          this.photo.centered(249, 213);      } else {          trace(l/t);      }  };  MovieClip.prototype.fadeIn = function() {      if (this.photo._alpha<100-this.fadeSpeed) {          this.photo._alpha += this.fadeSpeed;      } else {          this.photo._alpha = 100;          this.onEnterFrame = null;      }  };


This should do it - the only thing I (think) I need some help with is changing the script to actually load the FIRST image, when the gallery loads. For some reason beyond my knowledge you have to click the next button for a image to load... What part of the script needs to be changed to make sure that a image is loaded on startup???

I hope someone will take the time to help develope this gallery tutorial / help file... It would be great if you added som more steps to the quick checklist... and of course fixed the load image on start problem....

XML Photo Gallery Batch Loader From Flash Form
I have completed and tweaked my Photo gallery and thumbnails with the tutorials. 75 pictures later and I wonder if there is a way( I know there is) to create my own Flash form which will let me add the file names, description then append the XML automatically. Possibly even let me do 5-10 at a time before appending the XML in the proper structure. Any Ideas?

Scrolling Thumbnail Gallery And Loading Pics Into 'loader'
Okay, I have a scrolling thumbnail gallery, all I want is to click on the thumbnail and the big picture appears in the loader.
The scrolling thumbnails part work fine, it scrolls and all.
I used the scrollpane. The thumbs are in a movie clip called content_mc. I made the thumbnails buttons and when you click on the thumb the bigger picture is suppose to load from the server into the loader to of course keep the page and the gallery from loading slowly when the page first loads.

the code for the button is:

on(release) {
myloader.contentPath = "thepicname.jpg";
}

simple right?
why won't it load into the loader?
the pics are in the same folder as the original flash file.
it works fine if the thumbs aren't in a scrollpane.....
confused.... please help

Probelm With Scaleing Content In A Photo Gallery Loader
Hello!
I know I might be the 99999999991 to say that but I will say it...I'm a beginer with flash and I have a problem...
I'm building a photo gallery which loads jpg photos inside a loader component by using MovieClipLoader.
Everything works just great but my only problem is that I can't scale the content (the jpg's) to the size of the loader component.
I tried everything but the photos are loading bigger then the loader, and I want to have the photos at a bigger resolution then the loader so that I could have good quality on any screen resolution. Here's the actionscript I used, if it's necessary:

//------------------MovieClip Loader---------\
var mcLoader:MovieClipLoader = new MovieClipLoader ();
var myListener:Object = new Object ();
mcLoader.addListener(myListener)
myListener.onLoadProgress = function (target_mc,bytesLoaded,bytesTotal) {
extLoader_mc._visible = true;
var pctLoaded = Math.round(bytesLoaded/bytesTotal*100);
extLoader_mc.extLoaderBar_mc._xscale = pctLoaded;
extLoader_mc.extLoadinBarLines_mc._xscale = pctLoaded-1;
extLoader_mc.pct_txt.text = pctLoaded;
if (bytesLoaded >= bytesTotal) {
extLoader_mc._visible = false;
}
}
mcLoader.loadClip("pics/zernike1.jpg",picViewer_mc.picLoader);


  Thanks a lot!

Dynamic JPG Loader
code:
_root.holder._x=0
for(i=1; i<10; i++){duplicateMovieClip(_root.holder,"holder"+i,i)
var oneLess=i-1;
_root.holder1._x=0;
_root["holder"+i]._x = _root["holder"+oneLess]._x+150
trace(i);
loadMovie(i+".jpg",_root["holder"+i])
}

What is wrong with this code, the jpegs are 150pix wide but are showing up really smushed ....
the movie clips on my stage that im attaching them to are 150 pix wide too

100% Dynamic Jpg Loader
I made a movie that loads several jpg's into movieclips.

The amount of jpg's is variable so everything is dynamic using createemptymovieclip etc.

my problem. I want to have an animation the runs on top of the loaded jpg. The problem is that whatever I try, the animations plays under the jpg, not on top.

tried:
I cant put the animation on I hier layer since the jpg "holder" is created with AS.
Checked the depths, put the animation on top for sure using getnexthigestdepth.
tried using a black square in stead of a animation....all fails.

urgent help needed. URL and script are available for those with serious interest figuring this one out.

Dynamic Loader In MC
Do any one know how to dynamicaly create a Loader instance inside an attached MovieClip? I tried i couple of ways but none seem to work. Note that i need to do this dynamicaly through AS.

Thanks in advance!

Dynamic Swf Loader
Greetings, been a while since my last post...

I'm currently working on a flash app for our new site that will play multiple swfs, with some user control (play next, last, etc..). These ads will be held as external swfs that are loaded in the first frame of the controller / shell. This makes for a longer load at the start, but quick play of the multiple swfs when the second frame has been reached (the movies start playing). (the alternate - placing a loader on the first frame of each swf could work also - but we chose not to go that route).

Anyway = this script loads each item in the array (probably not more than four or five) into a separate level (descending from _level1000), adds the bytes loaded, and unloads them all from the stage when theyve loaded.


Code:
var aniray:Array = Array("ani_newsite.swf", "ani_breathe.swf", "ani_FF.swf");
var aninumber:Number = aniray.length;
var anilevel:Number = 1000;
var totalLoaded:Number = 0;
var partialLoaded:Number = 0;
var totalBytes:Number = 0;
var totalPercent:Number = 0;
var i:Number = 0;
var j:Number = 1000;
var m:Number = 0;
var n:Number = 1000;
var p:Number = 0;
_root.loader_txt = 0;
_root.loader_bar_mc._width = 0;
//gets byte total of aniloader ()
function getTotalBytes() {
clearInterval(timerInterval);
for (n; n>=anilevel; n--) {
p = eval("_level"+n).getBytesTotal();
totalBytes = totalBytes+p;
}
newInterval = setInterval(percent, 200);
}
//loads all swfs in array
function aniloader() {
for (i; i<aninumber; i++) {
_root.text_1_txt = aniray[0];
loadMovieNum("http://www.mysite.com/Flash/"+aniray[i], anilevel);
anilevel = anilevel-1;
}
anilevel = anilevel+1;
timerInterval = setInterval(getTotalBytes, 1000);
}
//called via setInterval to check progress
function percent() {
for (j; j>=anilevel; j--) {
m = eval("_level"+j).getBytesLoaded();
partialLoaded = partialLoaded+m;
}
totalLoaded = totalLoaded+partialLoaded;
totalPercent = (totalLoaded/totalBytes);
j = 1000;
partialLoaded = 0;
if (totalPercent>=1) {
clearInterval(newInterval);
for (j; j>=anilevel; j--) {
unloadMovieNum(j);
}
_root.gotoAndStop(2);
} else {
_root.loader_bar_mc._width = Math.round(totalPercent*200);
_root.loader_txt = Math.round(totalPercent*100)+"%";
}
}
//initilization
aniloader();
stop();
Of course, this works perfectly when tested in flash, but is broken when functioning on the server. The loaded movies are either not returning a correct value from getTotalBytes() or just being missed in full. Notice that i delay the function for a second or two just to allow aniloader() to get started (the loader didnt work at all without the delay). Instead of loading each movie the loader completes without a real load and continues to frame 2.

The unloadMovie() that runs when totalPercent>=1 I assume is fine, as teh movies should be unloaded from the stage but not from memory. (right??)

I am outputting this in version 7 - as our users are mainly on an administrated network that has not yet pushed 8 or 9 (as of today). I havent done much scripting for some time, and im not up on the version 9 changes... kinda wondering if theres something happening here that im just not aware of.

This all being said:

I have an alternate script that loads each item up in domino fashion that does work on the server. The issue with this was that if movies are very different in size the loader animation will not operate very smoothly. Testing them as a whole will provide a more consistent transition....


Any thoughts would be great!


b{[]}x

Dynamic Loader
Hey everyone. On my web page I wanted to make somthing like a preloader to tell everyone something is loading. The only thing that I found was loaders for somthing that is embeded in the movie. But I wanted to preload something that will be dynamically loaded. does anyone have any suggestions? Thanks a lot,
Marc

Dynamic Text Loader
i load text from a text file into my movie. now id like to have it say loading or sth in the textfield until the text is loaded. how do i do that?
i thot i could use the while function, while loading instancename.text = "loading" or sth. how could i do it?
thanks

Dynamic Content Loader
Alrighty, I have a movie that loads in 3 movies for content using the loadMovieNum and those 3 movies are different per links on navi menu.
I'd like to create a preloader for each of them as each page has separate movies. sooo basically...
Navi
-Link1
--link1links.swf
--link1pics.swf
--link1text.swf

So that's pretty much how it's broken down. Now I was looking through flash mx book that came with software and reading on their site and trying to figure out a reasonable way to do a dynamic preloader where, if link1 is hit, then it goes to a generic preloader and through a string or param it picks up to load in link1 movies.
Then I thought, it also might be better to load all 3 as one instead of 3 separate ones, except the pictures are big, and they're all in the swf, they dont load in externally.

So, if anyone has any tips , links, or thoughts on how I might streamline this, I'd appreciate, till then I'll be banging my head against wall. THANKS

Dynamic Image Loader
I want to make a dynamic image box about 100px by 100px that cycles through a set of jpegs at random, with the image changing every few seconds. Has anyone got any ideas where I can start, I have got a brief idea of how this could be put together but do not know enough about Actionscript yet to put it into action

Cheers

Studentmonster

Dynamic Loader Question...
Hey everyone.

Ive created a bunch of swfs. None of them have loaders - they were for a CDROM so werent gonna be online.

Now the client wants it online. Is there anyway of putting a loader on the swfs without going in and modifying the flas (theres alot of them!)?

Im thinking of having a loader in the _root that calculates if the swf is completely loaded but i dont know how to do that. I only know how to do a loader thats in the movie "to be loaded" if you get what i mean.

Hope someone can help. Id really appreciate it!

Thanks,
Tim.

Dynamic Pic Loader :: Problem ::
Hi guys, i'm trying to pic flash up for a large personal project but am already off to a rocky start.

For simplicity sake... I'm trying to grab a varying ammount of thumbnails and put them into a pane.

I only have 1 object thus far:

picHolder :: an 88x88 movieClip

Problem 1:
when I export/test my swf the picture shrinks. "88x88" remains constant, but its not a true pixle size, it seems quite a deal smaller. I dont know if flash resizes everyting automatically or what the deal is there....



Problem 2: (the hold up)

To accomplish what i'm doign i have a list of the thumbs i want ... I just need to get them into pics in the right spot.

for (i=0;i<5;i++){
duplicateMovieClip("picHolder","pic"+i,i);
setProperty("pic"+i, _x, (pic_side + 5)*i);
this["pic"+i].loadMovie("http://www.cashportals.net/justin/test.jpg");
}

When i try to duplicate the pannel they show up as blank panes, I cannot for the life of me get stuff loaded into em.

I'm concerned that the this["pic"+i] method of referencing my copied images is incorrect... I've been stuck on this one for days

thanks,
Willy

Dynamic Image Loader
hi,
how do i load images dynamicly to swf?

Dynamic Image Loader
I want to load 15 external swf's/images into blank mc's (I want all blank MC's to have _alpha=0). I want the blank mc's to be created dynamically and when all the swf's are done loading I want it to set var loadstatus = "complete". I would then have an onEnterFrame event that does something when var loadstatus = "complete"

If someone could let me know what code I need to do this then that would be really great! Thanks!

PS. Would it be at all possible to have a smooth preload bar that increases its width smoothly according to (total bytes loaded)/(total size of all 15 swf's)? I'm thinking it wouldnt because if all the images are cached then the bar would just jump up 1/15 width after each image is loaded, instead of moving slowely.

Dynamic Image Loader
well i am in a crunch for time...really hope somebody out there can help me out with this. I have read way to many posts about loading images dynamically and some of the code gets me going in the right direction but...inevitably it fails for my specific task.

Here is the situation, and the things I need to make this work just right:

1. Need to load images dynamically from a folder structure

2. Need a preloader that appears each time a button is pressed to load a single image into a MC , preloader needs to include a bar graphic and a percentage left to load and the total size of each loading image. And once the image is fully loaded need for the preloader to vanish until the next time its used

3. Also i don't want the image to display until a certain time...basically because the client has vertical as well as horizontal images, so i created a tweened animation for the background menu that sits behind each image...and i want to make sure that the image isn't displaying even if it is finished downloading until the background menu has gotten to it resting place. It tweens from a vertical shape for displaying vertical images to a horizontal shape for displaying horizontal images. I have tried using actionscripted masking techniques to hide the image until the right time but haven't had much success

4. Just so you know each image is loaded from a button in a seperate MC. Each image has its own button to load it into the same MC.

Here is the break down for the scope of my movie.

The “fashion_Image_Viewer” MC..is two levels down from the _root..not _level but two MCs down if you know what i mean. The sub nav which contains the buttons for initiating images to load is one level down from the “fashion_Image_Viewer” and is called “subNav” . Here is a visual aid for ya.

_root
___+ Main_Image_Viewer
______+ fashion_Main
_________+ fashion_Image_Viewer - (this is where the image viewer sits)
______________+subNav (this is where the buttons sit that load each image)

I know this is alot to ask...but i am hopeing that an actionscripting master would find this really easy and could help me work through the code i need to get this finished and out the door.

One more thing....REALLY IMPORTANT....this needs to use Flash MX Actionscript 1 code not the newest 2004 player 7 code.

Any help is much appreciated

Benjamin

Dynamic Image Loader
So I've created a flash file that loads external images from a folder. It's basically a slideshow. The files are named "image1.jpg", "image2.jpg" etc. so that I can increment a variable to dynamically load them through actionscript. New images will be added to the folder in time and I want the slideshow to be able to stop at the last image.

My question is: does anyone know a way for flash to find out how many files are in an external folder, so in this case I know how many images are in the folder, without using and xml or txt?

Alternatively, if that's not possible, is there any way to access the error that would be generated when flash attempted to load an external image that does not exist?

Dynamic Loop Loader
Hi, I'm working on some sort of dynamic loop loader.

The idea is that you have several loops who can follow up each other.
The first loop is played streaming, when started playing, loop 2 should start loading (invisible).

loop 1 repeats till loop 2 is fully loaded, at the end of the last loop 1 it should be followed by the loaded loop 2

now that loop 2 has started to play, it should start to load loop 3(invisible)

When loading loop 3 has finished and an instance of playing loop 2 has came to a loop-point, loop 3 should start playing.

....
the last loop should be follewed again by loop 1, loop2, loop 3, loop 4 ... loop1 (because all loops are preloaded at that time)

the basic idea after it is that the music constantly evolves, while downloadtime is balanced ...

This is the code I have now;it has the basic system (it works) !
The only problem is that all loops start preloading (sx.loadSound ) at the same point


In frame 1 i have

Code:
s1 = new Sound();
s2 = new Sound();
s3 = new Sound();
now I use this code in frame 2

Code:
s3.onSoundComplete = function() {
s1.start(0, 1); // loop 3 done ? -> start over @ loop 1
};
s2.onSoundComplete = function() {
if (s3.getBytesLoaded()>=s3.getBytesTotal()) {
s3.start(0, 1); // if s3 loaded; start playing
} else {
s2.start(0, 1); // else repeat s2 till s3 has been loaded
}
};
s1.onSoundComplete = function() {
if (s2.getBytesLoaded()>=s2.getBytesTotal()) {
s2.start(0, 1); // if s2 loaded; start playing
} else {
s1.start(0, 1); // else repeat s1 till s2 has been loaded
}
};
s1.loadSound("./dropper.mp3",true);
s2.loadSound("./dropper2.mp3");
s3.loadSound("./dropper3.mp3");
Ive tried already this option

Code:
s1.onSoundComplete = function() {
s2.loadSound("./dropper2.mp3");
if (s2.getBytesLoaded()>=s2.getBytesTotal()) {
s2.start(0, 1);
} else {
s1.start(0, 1);
}
};
but unsuccesfull.
I shoud be able to detect if s2.loadSound already has been called

Sorry for my bad english, hope you understand me.

thx in advantage

Dynamic Image Loader
Hi,
I would like to know how can i load one image (png) over another with Loader component? I have several images which have alpha channel and i need to lay them over on top of eachother to make a composition.
Im able to load only one image at the time, but if i load a new image the previous disapears.
I have started with this tutorial: http://www.oman3d.com/tutorials/flash/portfolio_2_bc/

and i can't find a good solution to my problem anywhere else...
Please advise anybody.
tnx
narcyz

Dynamic Image Loader
Hi,
I would like to know how can i load one image (png) over another with Loader component? I have several images which have alpha channel and i need to lay them over on top of eachother to make a composition.
Im able to load only one image at the time, but if i load a new image the previous disapears.
I have started with this tutorial: http://www.oman3d.com/tutorials/flash/portfolio_2_bc/

and i can't find a good solution to my problem anywhere else...
Please advise anybody.
tnx
narcyz

Simple Dynamic Pic Loader
Hi,
One of the main features I'd like to have @ my site tnd2004.com would be a "quick-portfolio". If u go there, you'll see a big 700x200 pic (it's the only one). Problem is it is static. I'd like it to be a *.swf file called "quick-portfolio", with two "fww" and "bck" arrows. That I can easily do - it's quite elementary.
The thing is I'd like to be always updating it, and the easiest way to do it would be just to upload the pics to a specific folder, and the *.swf file would auto get them ...
Ho, and I'd like that it would always load the pics randomly.
Think it's quite easy too, but I've never done it
Many thanks in advance

Dynamic Image Loader
Hey Guys

well i am in a crunch for time...really hope somebody out there can help me out with this. I have read way to many posts about loading images dynamically and some of the code gets me going in the right direction but...inevitably it fails for my specific task.

Here is the situation, and the things I need to make this work just right:

1. Need to load images dynamically from a folder structure

2. Need a preloader that appears each time a button is pressed to load a single image into a MC , preloader needs to include a bar graphic and a percentage left to load and the total size of each loading image. And once the image is fully loaded need for the preloader to vanish until the next time its used

3. Also i don't want the image to display until a certain time...basically because the client has vertical as well as horizontal images, so i created a tweened animation for the background menu that sits behind each image...and i want to make sure that the image isn't displaying even if it is finished downloading until the background menu has gotten to it resting place. It tweens from a vertical shape for displaying vertical images to a horizontal shape for displaying horizontal images. I have tried using actionscripted masking techniques to hide the image until the right time but haven't had much success

4. Just so you know each image is loaded from a button in a seperate MC. Each image has its own button to load it into the same MC.

Here is the break down for the scope of my movie.

The “fashion_Image_Viewer” MC..is two levels down from the _root..not _level but two MCs down if you know what i mean. The sub nav which contains the buttons for initiating images to load is one level down from the “fashion_Image_Viewer” and is called “subNav” . Here is a visual aid for ya.

_root
___+ Main_Image_Viewer
______+ fashion_Main
_________+ fashion_Image_Viewer - (this is where the image viewer sits)
______________+subNav (this is where the buttons sit that load each image)

I know this is alot to ask...but i am hopeing that an actionscripting master would find this really easy and could help me work through the code i need to get this finished and out the door.

One more thing....REALLY IMPORTANT....this needs to use Flash MX Actionscript 1 code not the newest 2004 player 7 code.

Any help is much appreciated

Benjamin

Dynamic Image Loader
My previous post helped me get started, now I'm getting more specific.

I need to be able to dynamically load images into flash as the client adds them to a folder of images. I'm wondering if there is a way to get all of the filenames from within a folder and add them to a string/array so that I could first find out how many new loaders will appear, and then of course link the filenames into each loader. Does that make sense?

Or is there an easier way to do this? Thanks.

-Jon

Dynamic Swf Loader Issues...
Hey guys,

Im working on a flash project that dynamically loads other flash videos into a 'holder' movie clip. This holder should never be larger than 500x330 however, some of the files it loads may be larger than that. At any time, there maybe 1-N files because Im using XML to store the filenames (and display names) so when I click on a button (1,2,3,4 and 5 and "pagination" is used) I clear the previous movieclip (or so I think), load the current file into the holder_mc and then calculate offsets for centering the holder_mc (the holder_mc is actually a child of 'main_mc') I also try and scale the holder_mc down to fit the required dimensions of 500x330....

This is where it goes wacky. First off all, I have to click the button 3 times (reload the same swf 3 time) before it will scale and position correctly. Im 100% positive that the previous movie is being cleared and if it isn't then theres a problem with flash it self because i have followed the documentation and about 10 articles just to ensure that I was doing it right)

Anyway, the problem is... sometimes they are PERFECT and other times they are to large, to small, etc. Im going nuts trying to solve this. I was actually having the same issue with another project where once I tried to "restart" the game (ie. resetting everything back to original values) the collision detection was totally messed up... it almost seemed as though the previous data was causing collisions even when the actual movie clip (and I put a box for the bounds for visuals) was tripping a collision WAY TO EARLY).

Anyway, I really need help with the previous issue. Please help!!
-Jason

Dynamic Image Loader (Help)
Hey all:

Please help me out on this one. I have a cool little dynamic image loader set up for a site I am working on. It is attached for your viewing, and is pretty simple. It is a series of movie clips tweening on a timeline, and each clip contains an image loader. The loader is loading an external image, and the result is a cool image fader I can update with a Database.

What I want to accomplish is to have the project set up in such a way that it is ready to accept, say 10 images. It will play only the image loaders that actually find images on the server. In other words, if there ain't no image 7, 8, 9 and 10 they will not be played. If they are there, they are played in sequence.

Ideas? Some Action script perhaps?

I thank you in advance for any help you may provide.

Kevin,

Preloader On Dynamic Jpg Loader
Ok so I am using the following code from the dynamic jpg loader tutorial:

photo1.onRollOver = function () {
_root.createEmptyMovieClip("container", 1);
loadMovie("photos/BuriedFence.jpg", "container");
container._x = 200 ;
container._y = 134.5;
}

But what I want is for it to load the image but while it is loading to show a percent loaded preloader for the image specifically.

How do I do it? PLEASE HELP!

Michael

Dynamic Choosable Swf Loader
Anyone have some good tutorials or ideas about how to accomplish something similiar to what they do on the billlboard.com website? (left side)

http://billboard.com/bbcom/index.jsp

I'm interested in creating something similiar to the number system and cycling through the seperate swf's through of each afformentioned numbers. I'm also interested in using thumbnails instead for a simliar effect.

Dynamic Image Loader
I'm trying to create a dynamic image loader that I can use to show a loading bar for each of my images in my portfolio page. What I want to accomplish is basically here:

http://www.kirupa.com/developer/acti...cliploader.htm

problem is I don't have MX 2004, I'm working in MX. Does anyone know where I can find out how to create a dynamic image loader in MX with that loading class? My main problem is that I can't seem to access my JPG to find out how much of it has loaded. I'm not new to preloaders but obviously if I can't access AmountLoaded and AmountTotal then I can't run a preloader. Any help is appreciated. Thanks.

Dynamic Jpeg Loader
How do edit the code in the photo gallery so that I can search for next jpg 1.jpg, 2.jpg etc and then when it hits the last one it will start to the first one

I have it set to
pic = "1"
pic + ".jpg"

this way I can change the number of pics in the folder without changing the code?

Dynamic Image Loader (Help)
Hey all:

Please help me out on this one. I have a cool little dynamic image loader set up for a site I am working on. It is attached for your viewing, and is pretty simple. It is a series of movie clips tweening on a timeline, and each clip contains an image loader. The loader is loading an external image, and the result is a cool image fader I can update with a Database.

What I want to accomplish is to have the project set up in such a way that it is ready to accept, say 10 images. It will play only the image loaders that actually find images on the server. In other words, if there ain't no image 7, 8, 9 and 10 they will not be played. If they are there, they are played in sequence.

Ideas? Some Action script perhaps?

I thank you in advance for any help you may provide.

Kevin,

Movie Loader And Dynamic Text
I am having a problem setting text during onLoadProgress of the loader class:

Here is the action script that I am using:
code:
// DRAWING LOAD BAR ETC.
this.createEmptyMovieClip("progressBar_mc", 10);
progressBar_mc.createEmptyMovieClip("bar_mc", 11);
progressBar_mc.createEmptyMovieClip("stroke_mc", 12);
with (progressBar_mc.stroke_mc) {
lineStyle(0, 0xFFFFFF);
moveTo(0, 0);
lineTo(200, 0);
lineTo(200, 5);
lineTo(0, 5);
lineTo(0, 0);
}
with (progressBar_mc.bar_mc) {
beginFill(0xFF0000, 100);
moveTo(0, 0);
lineTo(200, 0);
lineTo(200, 5);
lineTo(0, 5);
lineTo(0, 0);
endFill();
_xscale = 0;
}

var $load_fnt = new TextFormat();
$load_fnt.size = 18;
$load_fnt.color = 0xFFFFFF;
$load_fnt.align = "center";

progressBar_mc.createEmptyMovieClip("text_mc", 13);
progressBar_mc.text_mc.createTextField("_txt",1,0, 10,200,20);
progressBar_mc.text_mc.createTextField("per",2,0,3 0,200,20);
progressBar_mc.text_mc._txt.text = "LOADING";
progressBar_mc.text_mc.per.text = "%";
progressBar_mc._x = (Stage.width/2) - (progressBar_mc.stroke_mc._width/2);
progressBar_mc._y = (Stage.height/2) - (progressBar_mc.stroke_mc._height/2);

progressBar_mc.text_mc._txt.setTextFormat($load_fn t);
progressBar_mc.text_mc.per.setTextFormat($load_fnt );

// PRELOADING

var $load = new MovieClipLoader;
$listener = new Object();

$listener.onLoadStart = function($target_mc:MovieClip) {
progressBar_mc.bar_mc._xscale = 0;

}

$listener.onLoadProgress = function($target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
progressBar_mc.bar_mc._xscale = Math.round(bytesLoaded/bytesTotal*100);
progressBar_mc.text_mc.per.text = Math.round(bytesLoaded/bytesTotal*100)+"%";
//trace(progressBar_mc.text_mc.per.text);
//trace(Math.round(bytesLoaded/bytesTotal*100));
}

$listener.onLoadComplete = function($target_mc) {
progressBar_mc.removeMovieClip();
}

$listener.onLoadInit = function($target_mc) {
$target_mc.gotoAndStop(2);
}

$listener.onLoadError = function($target_mc) {
trace("ERROR! THIS ISN'T WORKING!!");
}

$load.addListener($listener);

$load.loadClip("movie.swf",1);

The loading bar works fine but outputting the percentage to a dynamic text field does not work. I've bolded the areas where I am having the difficulties.

If I set my "per" text field before the loadClip call then I see the text but once it hits the onLoadProgress function the text disappears. I've commented out the trace calls to see if the info is there and it is - I just can't get it to appear in my text box.

I'm using flash mx 2004 (7.2). Please let me know if you need any more information.

Any help would be appreciated.

Thanks.

Copyright © 2005-08 www.BigResource.com, All rights reserved