Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Misbehaving dynamic jpgs with levels

Status
Not open for further replies.

frozenpeas

Technical User
Sep 13, 2001
893
CA
My problem is that my dynamic jpgs are loading above everything else, rather than in the levels I want.

First frame:

Code:
//select random image
function showValues() {
  for (i in this) {
    _level0.pic = this.pic;
  }
}
myLoadVars = new LoadVars();
myLoadVars.onLoad = showValues;
myLoadVars.load("[URL unfurl="true"]http://www.frozen-peas.com/fp/images/about/rdmimg.php");[/URL]
//
// (holderName is an optional parameter)
MovieClip.prototype.loadjpg = function(picName, holderName) {
    // holderName can be passed in case needed for progress indicator
    // if not passed, use 'holder' as default
    var h = holderName==undefined ? "holder" : holderName;
    this.createEmptyMovieClip(h,[b]1[/b]);
    this._visible = false;
    this[h].loadMovie("[URL unfurl="true"]http://www.frozen-peas.com/fp/images/about/"+_level0.pic);[/URL]
    var id = setInterval(function (mc) {
        if (mc[h]._width > 0) {
            mc._alpha = 99;
            clearInterval(id);
            // may want to move this next line to the onComplete routine
            // instead, if visibility is to be set after positioning
            mc._visible = true;
            mc.onComplete();
        } else {
            mc.onLoading();
        }
    }, 80, this);  
};

and second frame:

Code:
function positionPic() {
    this._x = 200;
    this._y = 0; 
}
this.createEmptyMovieClip("myjpg",[b]2[/b]);
myjpg.onComplete = positionPic;
myjpg.loadjpg(_level0.pic);

You can see the problem on the first couple of links here:


Thanks, everyone.

frozenpeas
 
You can only use createEmptyMovieClip within the root timeline of a given movie!
 
Well that's no good!

I guess I'll have to come at it from another angle.

Thanks.

frozenpeas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top