[SWFObject] SWFObject and External Movies
Sam Basile
sbasile at trekk.com
Thu May 4 12:32:54 PDT 2006
Yes it works fine in a regular embed. Here's the .AS script. The
movieclip bar_mc loads but doesn't show any progression. clip_mc
doesn't seem to load at all.
Sam Basile
Technical Director
Trekk Cross Media Communications
134 North Main Street
Rockford, IL 61101
Phone: 866.799.2879 ext. 705
Fax: 815.962.2189
Visit our web site. <http://www.trekk.com/>
~~~~~
#include "com.qlod.LoaderClass.as"
function init() {
Stage.showMenu = false;
Stage.scaleMode = "noScale";
Stage.align = "TL";
_global.loader = new com.qlod.LoaderClass();
_global.loader.setTimeoutMs(3000);
_global.loader.setMinSteps(5);
if (assetPath == undefined) {
assetPath = "";
}
clips = new Array();
clips.push({clip:"quickSearch.swf", x:0, y:0, w: 215, h: 416, col:
0xBEC09D});
clips.push({clip:"mapSearch.swf", x:218, y:273, w: 354, h: 143, col:
0xF8CE87});
clips.push({clip:"smallAd.swf", x:578, y:273, w: 192, h: 143, col:
0x833626});
clips.push({clip:"homeMovie.swf", x:218, y:0, w: 552, h: 270, col:
0xcccccc});
for (var i = 0; i < clips.length; i++) {
// position the holder
var o = this.createEmptyMovieClip("holder" + i + "_mc", i);
o._x = clips[i].x;
o._y = clips[i].y;
// draw a background for the movieclip
o.lineStyle(0, clips[i].col, 0);
o.beginFill(clips[i].col, 100);
o.lineTo(0, clips[i].h);
o.lineTo(clips[i].w, clips[i].h);
o.lineTo(clips[i].w, 0);
o.lineTo(0, 0);
o.endFill();
// position the bar
var q = o.attachMovie("bar_mc", "bar_mc", 1);
q._x = (clips[i].w - q._width)/2
q._y = (clips[i].h - q._height)/2
// create the holding clip mc
var r = o.createEmptyMovieClip("clip_mc", 0);
r._visible = false;
var p = r.createEmptyMovieClip("clip_mc", 0);
o.id = i;
o.clip = assetPath + clips[i].clip;
// create the listening functions
o.loadStart = function () {
_global.loader.load(this.clip_mc.clip_mc, this.clip, this);
}
o.onLoadStart = function(loaderObj) {
//trace("Loading of " + loaderObj.getTarget() + " has started");
};
o.onLoadProgress = function(loaderObj) {
var percent = parseInt(loaderObj.getPercent());
this.bar_mc.animation_mc.gotoAndStop(percent);
};
o.onTimeout = function(success, loaderObj) {
//trace("Loading of " + loaderObj.getTarget() + " has timed out");
};
o.onLoadComplete = function(success, loaderObj) {
this.bar_mc._visible = false;
this.clear();
this.clip_mc._visible = true;
this._parent.loadNext(this.id);
};
}
loadNext(-1);
}
function loadNext (id) {
var i = ((id + 1) >= clips.length) ? -1 : id + 1;
if (i != -1){
var o = this["holder" + i + "_mc"];
o.loadStart();
}
}
init();
________________________________
From: swfobject-bounces at lists.deconcept.com
[mailto:swfobject-bounces at lists.deconcept.com] On Behalf Of Geoff
Stearns
Sent: Thursday, May 04, 2006 2:07 PM
To: swfobject at lists.deconcept.com
Subject: Re: [SWFObject] SWFObject and External Movies
i've used swf files for preloading on projects without any issues - have
you tested it with a 'normal' embed vs. the swfobject, and made sure
that you have all the same parameters and variables the same?
On May 4, 2006, at 3:02 PM, Sam Basile wrote:
Hello:
I am working with your SWFObject and am very pleased with it in
most applications. However I am having difficult time implementing the
object with on Flash movie in particular. This movie is really a
container object that calls and loads, through a preloader, four
external SWF's. When used with SWFObject, the container movie loads;
the preloader images appear but don't run through their onLoadProgress
cycles; and the external movies never load. Any ideas on how to solve
this issue?
Regards,
Sam Basile
Technical Director
Trekk Cross Media Communications
134 North Main Street
Rockford, IL 61101
Phone: 866.799.2879 ext. 705
Fax: 815.962.2189
Visit our web site. <http://www.trekk.com/>
_______________________________________________
SWFObject mailing list
SWFObject at lists.deconcept.com
http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deconcept.com/pipermail/swfobject-deconcept.com/attachments/20060504/0bf39f67/attachment-0005.htm>
More information about the Swfobject
mailing list