coop
October 24, 2006, 3:30pm
1
Hi all,
I have a holder_mc that I’m loading a swf into, and I wanted it to fade in. I’ve done this code.
The prototype works fine in other situations. so I’m pretty sure it’s not that.
Do i need to make sure the swf is fully loaded before doing something with it.
[AS]
MovieClip.prototype.fadeIn = function(speed) {
this.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>=100) {
this._alpha == 100;
this.onEnterFrame = null;
}
};
};
holder_mc._alpha = 0;
one_btn.onRelease = function() {
holder_mc.loadMovie(“image.swf”);
holder_mc.fadeIn(10);
};
[/AS]
rhamej
October 24, 2006, 9:41pm
2
[quote=coop;1984418]Hi all,
Do i need to make sure the swf is fully loaded before doing something with it.
[/quote]
Yes =)
coop
October 24, 2006, 10:10pm
3
I tried it, but still no success, is there something wrong with my method of testing
[AS]
MovieClip.prototype.fadeIn = function(speed) {
this.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>=100) {
this._alpha == 100;
this.onEnterFrame = null;
}
};
};
holder_mc._alpha = 0;
one_btn.onRelease = function() {
myLoader();
};
myLoader = function () {
holder_mc.loadMovie(“image.swf”);
var loaded = holder_mc.getBytesLoaded();
var total = holder_mc.getBytesTotal();
if (loaded/total==1) {
holder_mc.fadeIn(10);
trace(“here”)
}
};
[/AS]
coop
October 25, 2006, 9:14am
4
I tried loading into another clip inside the holder_mc, but still no luck
help.
[AS]
MovieClip.prototype.fadeIn = function(speed) {
this.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>=100) {
this._alpha == 100;
this.onEnterFrame = null;
}
};
};
holder_mc._alpha = 0;
one_btn.onRelease = function() {
myLoader();
};
myLoader = function () {
myClip = holder_mc.createEmptyMovieClip(“myHolder”, 1);
trace(myClip instanceof MovieClip);//true
myClip.loadMovie(“image.swf”);
myLoadCheck();
};
myLoadCheck = function () {
trace(“check”);
myClip.onEnterFrame = function() {
var Loaded = this.getBytesLoaded();
var Total = this.getBytesTotal();
if (Loaded/Total == 1) {
this.fadeIn(10);
trace(myClip instanceof MovieClip);//true
}
};
};
[/AS]
[QUOTE=coop;1985036]I tried loading into another clip inside the holder_mc, but still no luck
help.
[AS]
MovieClip.prototype.fadeIn = function(speed) {
this.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>=100) {
this._alpha == 100;
this.onEnterFrame = null;
}
};
};
holder_mc._alpha = 0;
one_btn.onRelease = function() {
myLoader();
};
myLoader = function () {
myClip = holder_mc.createEmptyMovieClip(“myHolder”, 1);
trace(myClip instanceof MovieClip);//true
myClip.loadMovie(“image.swf”);
myLoadCheck();
};
myLoadCheck = function () {
trace(“check”);
myClip.onEnterFrame = function() {
var Loaded = this.getBytesLoaded();
var Total = this.getBytesTotal();
if (Loaded/Total == 1) {
this.fadeIn(10);
trace(myClip instanceof MovieClip);//true
}
};
};
[/AS][/QUOTE]
maybe
function myLoader() {
myClip = holder_mc.createEmptyMovieClip("myHolder", 1);
trace(myClip instanceof MovieClip);
//true
myClip.loadMovie("image.swf");
myLoadCheck();
};
function myLoadCheck() {
trace("check");
holder_mc.onEnterFrame = function() {
var Loaded = this.myHolder.getBytesLoaded();
var Total = this.myHolder.getBytesTotal();
if (Loaded/Total == 1) {
this.fadeIn(10);
trace(myClip instanceof MovieClip);
//true
}
};
};