as3不会加载flv / f4v

时间:2014-03-14 00:41:32

标签: actionscript-3 flash

我一直想弄清楚我现在做错了两天而且我迷路了!当我在计算机上运行绝对链接时,我有以下as3脚本,但是一旦我把它放在网站上,仍然使用绝对链接,它不起作用!有人可以帮忙吗?我没有更多的想法!它所在的页面是http://www.test.clearwatercog.org/index.php?page=gallery&cat=videos&fst=CC%20Final%20presentation&event=Miscellaneous

我的代码是

import flash.utils.*;
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
import flash.events.ProgressEvent;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
fsrt_mc.addEventListener(MouseEvent.MOUSE_UP, movethumbs);
fslt_mc.addEventListener(MouseEvent.MOUSE_UP, movethumbs);
var dir:String;
var fst:String;
    var paramList:Object = this.root.loaderInfo.parameters;
  dir=paramList["dir"];
  fst=paramList["fst"];
  dir='Miscellaneous';
  fst='CC Final presentation';
fst=escape(fst);
dir=escape(dir);
var domain:String="http://test.clearwatercog.org/media/";
//var domain:String="media/";
var mcs:Array = new Array();
var picsn:Array = new Array();
var pics:Array = new Array();
var mcinst:Array = new Array();

var mLoader:Loader = new Loader();
var mRequest:URLRequest;
var myTweenX:Tween;
var pl:Array = new Array();
plyr.bufferTime =4;

var xmlLoader:URLLoader = new URLLoader();
var xmlURL:URLRequest = new URLRequest(domain+"xml.php?video="+dir+"&fst="+fst);
//var xmlURL:URLRequest = new URLRequest(domain+"xml.xml");
xmlLoader.addEventListener(Event.COMPLETE,xmlLoaded);
xmlLoader.load(xmlURL);
var picsXML:XML = new XML();
picsXML.ignoreWhitespace = true;
var fpl:Loader;

function xmlLoaded(evt:Event):void {
picsXML = XML(xmlLoader.data);
    var i=0;
    while (i<picsXML.pic.length()) {
        pics.push(picsXML.pic[i]);
var mc:MovieClip = new MovieClip();
mcs[i]=mc;
if (i==0) {
mcs[i].x = 0;
mcs[i].y = 0;
}
else {
mcs[i].x = mcs[i-1].x+110;
mcs[i].y = 0;   
}
thumbs_mc.addChild(mcs[i]);
mcinst[i]=mcs[i].name;

    i++;}
pname=pics[0];
var tmp:Array=pname.split(".");
var io:Number=0; pname='';
while (io<tmp.length-1) {
    if (io==0) {
        pname+=tmp[io];
    }
    else {
        pname+="."+tmp[io];
    }
    io++;
}
pname+=".flv";
var url:String=domain+"video clips/"+dir+"/"+pname;
//var url:String="media/video clips/"+dir+"/"+pname;
plyr.source=url;

    fillmc();
db.text=pname;
}

function fpf(event:Event):void {
var targetLoader:Loader = Loader(event.target.loader);
    if (targetLoader.width>=targetLoader.height) {
        targetLoader.width = 550;
    targetLoader.scaleY = targetLoader.scaleX;
    } else {
            targetLoader.height = 400;
    targetLoader.scaleX = targetLoader.scaleY;  
    }
}
var pname:String;
function changepic(event:MouseEvent) {
    pname=picsn[event.target.name];
//change source here
var tmp:Array=pname.split(".");
var io:Number=0; pname='';
while (io<tmp.length-1) {
    if (io==0) {
        pname+=tmp[io];
    }
    else {
        pname+="."+tmp[io];
    }
    io++;
}
pname+=".f4v";
trace(pname)
var url:String=domain+"video clips/"+dir+"/"+pname;
//var url:String="media/video clips/"+dir+"/"+pname;
plyr.source=url;
}

var mi=0;
var  imageLoader:Loader;
function fillmc():void {
var pictLdr:Loader;
var pictURLReq:URLRequest;
//while (mi<mcs.length) { 
var url:String=domain+"videos tn/"+dir+"/"+pics[mi];
//var url:String="media/videos tn/"+dir+"/"+pics[mi];
imageLoader  =  new Loader();
imageLoader.load(new URLRequest(url)); 
imageLoader.contentLoaderInfo.addEventListener( Event.INIT, loaded)
mi++;
//}
}

var pc=0;
function loaded(event:Event):void {
var targetLoader:Loader = Loader(event.target.loader);
    targetLoader.width = 100;
    targetLoader.scaleY = targetLoader.scaleX;
    var nmc=mcs[pc].addChild(targetLoader);
nmc.addEventListener(MouseEvent.MOUSE_UP, changepic);
picsn[nmc.name]=pics[pc];
    pc++;
    if (mi<mcs.length) fillmc();
}


var otx:Number=thumbs_mc.x;
var tx:Number=thumbs_mc.x;
var tw:Number=thumbs_mc.width;
var rct:Number=0;
var lct:Number=0;
function movethumbs(event:MouseEvent) {
var nt:Number=Math.floor(pics.length*110/440);
var inst=event.target.name;
if (inst=="fsrt_mc") {
if (rct<nt) {
    myTweenX = new Tween(thumbs_mc, "x", Strong.easeOut, tx, tx-440, 3, true);
rct++;
tx=tx-440
if (lct>0) lct--;
}
}
if (inst=="fslt_mc") {
if (lct<nt) {
    myTweenX = new Tween(thumbs_mc, "x", Strong.easeOut, tx, tx+440, 3, true);
lct++;
tx=tx+440
if (rct>0) rct--;
}
trace(tx+">"+nt*-1);
}
}

1 个答案:

答案 0 :(得分:0)

  

仍然使用绝对链接,它不起作用!

由于链接不正确,因此无法在服务器上找到媒体文件。链接在路径中包含2次media

链接不正确: http://www.test.clearwatercog.org/ 媒体/介质 /video%20clips/Miscellaneous/CC%20Final%20presentation.flv