错误#2044:未处理的IOErrorEvent:。 text =错误#2036:加载从未完成

时间:2012-02-21 02:49:06

标签: javascript html xml flash fla

我不能为我的生活弄清楚这一点。我是一个任何Javascript编码和编辑.fla的菜鸟。现在,我承认我在这里已经超越了我的头脑,但我姐姐非常期待这一点,因为我已经向她展示了这个概念。 -_-

我有一个3d Curve Gallery来展示她的照片,我正在尝试将Lightbox放入其中,所以当你点击一个图像的缩略图时,它将在同一页面打开,看起来很漂亮。问题是,每当我点击缩略图时,我都会收到此错误:“错误#2044:未处理的IOErrorEvent:。text =错误#2036:加载从未完成。”

以下是我为尝试纠正问题所做的工作:

  • 我检查了所有网址以确保它们是正确的(它们是)。

  • 我瞥了一眼其他建议,为错误添加一个事件监听器,把它放入,什么都没有。

  • 检查以确保我发布到正确的位置。

以下是FLA文件中的代码......

/*
Created by Min Thu
    http://www.flashmo.com

AS3 References and Credits
http://blog.papervision3d.org/
http://theflashblog.com/?p=306
http://www.gotoandlearn.com/
http://www.onerutter.com/
http://labs.blitzagency.com/
http://vilebody.wordpress.com/2007/11/29/3d-papervision-plane-events/
*/
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.display.Sprite;
import flash.events.MouseEvent;

var container:Sprite = new Sprite();
container.x = 450;
container.y = 320;
addChild(container);

var scene:Scene3D = new MovieScene3D(container);
var cam:Camera3D = new Camera3D();
cam.zoom = 6;

tn_title.text = "";
tn_desc.text = "";

var p_dict:Dictionary=new Dictionary();
var pc:Plane = new Plane();
pc.visible = false;
cam.target = pc;

var numOfRotations:Number = 3;
var yPos:Number = 0;
var angle:Number = 0;

var filename_list = new Array();
var url_list = new Array();
var url_target_list:Array = new Array();
var title_list = new Array();
var description_list = new Array();
var folder:String = "thumbnails/";

var i:Number;
var j:Number = 0;
var k:Number = 0;
var l:Number = 0;
var m:Number = 0;
var total:Number;
var flashmo_xml:XML = new XML();
var loader:URLLoader = new URLLoader();
loader.load(new URLRequest("thumbnail_list_3.xml"));
loader.addEventListener(Event.COMPLETE, create_thumbnail);

function create_thumbnail(e:Event):void 
{
    flashmo_xml = XML(e.target.data);
    total = flashmo_xml.thumbnail.length();
    var anglePer:Number = ((Math.PI*2) * numOfRotations) / total;

    for( i = 0; i < total; i++ )
    {
        url_list.push( flashmo_xml.thumbnail[i].@url.toString() );
        url_target_list.push( flashmo_xml.thumbnail[i].@target.toString() );
        title_list.push( flashmo_xml.thumbnail[i].@title.toString() );
        description_list.push( flashmo_xml.thumbnail[i].@description.toString() );

    var bfm:BitmapFileMaterial = new BitmapFileMaterial(
        folder + flashmo_xml.thumbnail[i].@filename.toString());
    bfm.oneSide = false;
    bfm.smooth = true;
    var p:Plane = new Plane(bfm, 140, 95, 2, 2);
    scene.addChild(p);
    var p_container:Sprite = p.container;
    p_container.name = "flashmo_" + i;
    p_dict[p_container] = p;
    p_container.buttonMode = true;
    p_container.addEventListener( MouseEvent.ROLL_OVER, p_rollover );
    p_container.addEventListener( MouseEvent.ROLL_OUT, p_rollout );
    p_container.addEventListener( MouseEvent.CLICK, p_click );

    p.rotationY = (-i*anglePer) * (180/Math.PI) + 90;
    p.x = Math.cos(i * anglePer) * 480;
    p.z = Math.sin(i * anglePer) * 480;
    p.y = yPos;

    if( (i+1) % 20 == 0 )
    {
         yPos += 115;
    }
}
}

function p_rollover(me:MouseEvent) 
{
    var sp:Sprite = me.target as Sprite;
    var tw:Tween = new Tween(sp, 'alpha', Strong.easeOut, 1, 0.5, 0.6, true);
    var s_no:Number = parseInt(sp.name.slice(8,10));
    tn_title.text = title_list[s_no];
    tn_desc.text = description_list[s_no];
}
function p_rollout(me:MouseEvent) 
{
    var sp:Sprite = me.target as Sprite;
    var tw:Tween = new Tween(sp, 'alpha', Strong.easeOut, 0.5, 1, 0.6, true);
    tn_title.text = "";
    tn_desc.text = "";
}

function p_click(me:MouseEvent) 
{ 
     var loader : Loader = new Loader ();
     var request : URLRequest = new URLRequest ("javascript:GroupDelegate('paper1')"); 
     loader . load ( request );  
}  

loader.addEventListener(IOErrorEvent.IO_ERROR, _nofile);
function _nofile(e:IOErrorEvent):void
{
    trace("File was not found");
    e.target.removeEventListener(IOErrorEvent.IO_ERROR, _nofile);
}

addEventListener(Event.ENTER_FRAME, render);

function render(e:Event):void
{
    var dist2:Number = ((stage.mouseX) - 400) * 0.0001;
    angle += dist2;
    cam.x = - Math.cos(angle) * 150;
    cam.z = Math.sin(angle) * 150;
    var new_zoom = 8.5 - stage.mouseY * 0.008; 
    cam.zoom += ( new_zoom - cam.zoom ) * 0.06;
    scene.renderCamera(cam);
}

现在,这是XML文件的内容......

<?xml version="1.0" encoding="utf-8"?>
<thumbnails>
<thumbnail filename="flashmo_095_3d_thumbnail_box.jpg" id="paper1"      url="http://www.onlineresale.org/images/anigif.gif" rel="lightbox[papers]"     title="Wallpapers: Blue" description="tada" />
    <thumbnail filename="flashmo_095_3d_thumbnail_box.jpg" url="http://www.flashmo.com    /preview/flashmo_095_3d_thumbnail_box" target="_blank" 
    title="Item No. 2 (095 3d thumbnail box)" 
    description="3D Thumbnail Box, Thumbnail Gallery powered by Papervision3D and ActionScript 3" />
<thumbnail filename="flashmo_094_spiral_carousel_xml.jpg" url="http://www.flashmo.com/preview/flashmo_094_spiral_carousel_xml" target="_blank" 
    title="Item No. 3 (094 spiral carousel xml)" 
    description="Spiral Carousel using an external XML file. It is based on Lee Brimelow's example which is powered by Papervision3D." />
<thumbnail filename="flashmo_093_painter.jpg" url="http://www.flashmo.com/preview/flashmo_093_painter" target="_blank" 
    title="Item No. 4 (093 painter)" 
    description="Painter flash template using simple motion tweening and actionscripts for menu items." />
<thumbnail filename="flashmo_092_restaurant.jpg" url="http://www.flashmo.com/preview/flashmo_092_restaurant" target="_blank" 
    title="Item No. 5 (092 restaurant)" 
    description="Restaurant template which is integrated with dynamic thumbnail gallery list using an external XML file." />
<thumbnail filename="flashmo_091_intro.jpg" url="http://www.flashmo.com/preview/flashmo_091_intro" target="_blank" 
    title="Item No. 6 (091 intro)" 
    description="Attractive flash intro using hexagon masking effects, looping movieclips for text and photos." />
<thumbnail filename="flashmo_090_thumbnail_xml.jpg" url="http://www.flashmo.com/preview/flashmo_090_thumbnail_xml" target="_blank" 
    title="Item No. 7 (090 thumbnail xml)" 
    description="Perspective thumbnail gallery using an external XML file which is easy to replace thumbnails, URLs and URL targets." />
<thumbnail filename="flashmo_089_design.jpg" url="http://www.flashmo.com/preview/flashmo_089_design" target="_self" 
    title="Item No. 8 (089 design)" 
    description="Design Studio Template, an XML-powered portfolio, flash contact form" />
<thumbnail filename="flashmo_088_menu_xml.jpg" url="http://www.flashmo.com/preview/flashmo_088_menu_xml" target="_self" 
    title="Item No. 9 (088 menu xml)" 
    description="Simple XML menu with some color variations" />

<thumbnail filename="flashmo_087_random.jpg" url="http://www.flashmo.com/preview/flashmo_087_random" target="_self" 
    title="Item No. 10 (087 random)" 
    description="Random Art using actionscripts and Adobe's tween engine to generate simply attractive graphics." />
<thumbnail filename="flashmo_086_speaker.jpg" url="http://www.flashmo.com/preview/flashmo_086_speaker" target="_blank" 
    title="Item No. 11 (086 speaker)" 
    description="Speaker Flash Template featuring dynamic music album list and XML-powered news list." />
<thumbnail filename="flashmo_085_stylish.jpg" url="http://www.flashmo.com/preview/flashmo_085_stylish" target="_blank" 
    title="Item No. 12 (085 stylish)" 
    description="Stylish Template powered by XML product list and XML news list" />
<thumbnail filename="flashmo_084_intro.jpg" url="http://www.flashmo.com/preview/flashmo_084_intro" target="_blank" 
    title="Item No. 13 (084 intro)" 
    description="Flash Intro using motion tweening, rounded rectangles masking effects with a background music" />
<thumbnail filename="flashmo_083_mouse_effect_2.jpg" url="http://www.flashmo.com/preview/flashmo_083_mouse_effect_2" target="_blank" 
    title="Item No. 14 (083 mouse effect 2)" 
    description="Sparkling magic mouse effect using Adobe's tween engine." />
<thumbnail filename="flashmo_083_mouse_effect_1.jpg" url="http://www.flashmo.com/preview/flashmo_083_mouse_effect_1" target="_blank" 
    title="Item No. 15 (083 mouse effect 1)" 
    description="Magic mouse effect or sparkling flash effect using Adobe's tween engine." />
<thumbnail filename="flashmo_082_dream.jpg" url="http://www.flashmo.com/preview/flashmo_082_dream" target="_parent" 
    title="Item No. 16 (082 dream)" 
    description="Dream Flash Template features the XML product list, XML news list and contact form" />
<thumbnail filename="flashmo_081_design.jpg" url="http://www.flashmo.com/preview/flashmo_081_design" target="_parent" 
    title="Item No. 17 (081 design)" 
    description="Flash Design Template using XML news list and XML product list." />
<thumbnail filename="flashmo_080_movie.jpg" url="http://www.flashmo.com/preview/flashmo_080_movie" target="_parent" 
    title="Item No. 18 (080 movie)" 
    description="Movie Template featuring horizontal thumbnail list for movies" />

<thumbnail filename="flashmo_079_classic.jpg" url="http://www.flashmo.com/preview/flashmo_079_classic" target="_blank" 
    title="Item No. 19 (079 classic)" 
    description="Classic Template with dynamic product list and xml news list" />
<thumbnail filename="flashmo_078_heart_effect_2.jpg" url="http://www.flashmo.com/preview/flashmo_078_heart_effect_2" target="_blank" 
    title="Item No. 20 (078 heart effect 2)" 
    description="Falling hearts flash effect using Adobe's tween engine" />
<thumbnail filename="flashmo_078_heart_effect_1.jpg" url="http://www.flashmo.com/preview/flashmo_078_heart_effect_1" target="_blank" 
    title="Item No. 21 (078 heart effect 1)" 
    description="Falling hearts on mouse move using Adobe's tween engine" />
<thumbnail filename="flashmo_077_jeans.jpg" url="http://www.flashmo.com/preview/flashmo_077_jeans" target="_parent" 
    title="Item No. 22 (077 jeans)" 
    description="Jeans company flash template, XML product list and news list." />
<thumbnail filename="flashmo_076_wood.jpg" url="http://www.flashmo.com/preview/flashmo_076_wood" target="_parent" 
    title="Item No. 23 (076 wood)" 
    description="Wood company static flash template, vertical tab menu style" />
<thumbnail filename="flashmo_075_butterfly.jpg" url="http://www.flashmo.com/preview/flashmo_075_butterfly" target="_parent" 
    title="Item No. 24 (075 butterfly)" 
    description="Butterfly animated flash template with a smooth transition including the XML news list" />
<thumbnail filename="flashmo_074_film.jpg" url="http://www.flashmo.com/preview/flashmo_074_film" target="_blank" 
    title="Item No. 25 (074 film)" 
    description="Film template features the dynamic XML gallery and contact form" />
<thumbnail filename="flashmo_073_heart_pink.jpg" url="http://www.flashmo.com/preview/flashmo_073_heart_pink" target="_self" 
    title="Item No. 26 (073 heart pink)" 
    description="Heart pink template with animated heart buttons" />
<thumbnail filename="flashmo_072_blue.jpg" url="http://www.flashmo.com/preview/flashmo_072_blue" target="_self" 
    title="Item No. 27 (072 blue)" 
    description="Blue flash template using simple button animations and smooth transition" />

<thumbnail filename="flashmo_071_sunrise.jpg" url="http://www.flashmo.com/preview/flashmo_071_sunrise" target="_self" 
    title="Item No. 28 (071 sunrise)" 
    description="Sunrise flash template with dynamic XML lists" />
<thumbnail filename="flashmo_070_design.jpg" url="http://www.flashmo.com/preview/flashmo_070_design" target="_blank" 
    title="Item No. 29 (070 design)" 
    description="Static flash template design including scroll bar for news and animated header" />
<thumbnail filename="flashmo_069_stationery.jpg" url="http://www.flashmo.com/preview/flashmo_069_stationery" target="_blank" 
    title="Item No. 30 (069 stationery)" 
    description="Stationery flash template with photo swap effect" />
<thumbnail filename="flashmo_096_3d_cylinder_box.jpg" url="http://www.flashmo.com/preview/flashmo_096_3d_cylinder_box" target="_blank" 
    title="Item No. 31 (096 3d cylinder box)" 
    description="3D Cylinder Box, Thumbnail Gallery powered by Papervision3D and ActionScript 3" />
<thumbnail filename="flashmo_095_3d_thumbnail_box.jpg" url="http://www.flashmo.com/preview/flashmo_095_3d_thumbnail_box" target="_blank" 
    title="Item No. 32 (095 3d thumbnail box)" 
    description="3D Thumbnail Box, Thumbnail Gallery powered by Papervision3D and ActionScript 3" />
<thumbnail filename="flashmo_094_spiral_carousel_xml.jpg" url="http://www.flashmo.com/preview/flashmo_094_spiral_carousel_xml" target="_blank" 
    title="Item No. 33 (094 spiral carousel xml)" 
    description="Spiral Carousel using an external XML file. It is based on Lee Brimelow's example which is powered by Papervision3D." />
<thumbnail filename="flashmo_093_painter.jpg" url="http://www.flashmo.com/preview/flashmo_093_painter" target="_blank" 
    title="Item No. 34 (093 painter)" 
    description="Painter flash template using simple motion tweening and actionscripts for menu items." />
<thumbnail filename="flashmo_092_restaurant.jpg" url="http://www.flashmo.com/preview/flashmo_092_restaurant" target="_blank" 
    title="Item No. 35 (092 restaurant)" 
    description="Restaurant template which is integrated with dynamic thumbnail gallery list using an external XML file." />
<thumbnail filename="flashmo_091_intro.jpg" url="http://www.flashmo.com/preview/flashmo_091_intro" target="_blank" 
    title="Item No. 36 (091 intro)" 
    description="Attractive flash intro using hexagon masking effects, looping movieclips for text and photos." />

<thumbnail filename="flashmo_090_thumbnail_xml.jpg" url="http://www.flashmo.com/preview/flashmo_090_thumbnail_xml" target="_blank" 
    title="Item No. 37 (090 thumbnail xml)" 
    description="Perspective thumbnail gallery using an external XML file which is easy to replace thumbnails, URLs and URL targets." />
<thumbnail filename="flashmo_089_design.jpg" url="http://www.flashmo.com/preview/flashmo_089_design" target="_self" 
    title="Item No. 38 (089 design)" 
    description="Design Studio Template, an XML-powered portfolio, flash contact form" />
<thumbnail filename="flashmo_088_menu_xml.jpg" url="http://www.flashmo.com/preview/flashmo_088_menu_xml" target="_self" 
    title="Item No. 39 (088 menu xml)" 
    description="Simple XML menu with some color variations" />
<thumbnail filename="flashmo_087_random.jpg" url="http://www.flashmo.com/preview/flashmo_087_random" target="_self" 
    title="Item No. 40 (087 random)" 
    description="Random Art using actionscripts and Adobe's tween engine to generate simply attractive graphics." />
<thumbnail filename="flashmo_086_speaker.jpg" url="http://www.flashmo.com/preview/flashmo_086_speaker" target="_self" 
    title="Item No. 41 (086 speaker)" 
    description="Speaker Flash Template featuring dynamic music album list and XML-powered news list." />
<thumbnail filename="flashmo_085_stylish.jpg" url="http://www.flashmo.com/preview/flashmo_085_stylish" target="_self" 
    title="Item No. 42 (085 stylish)" 
    description="Stylish Template powered by XML product list and XML news list" />
<thumbnail filename="flashmo_084_intro.jpg" url="http://www.flashmo.com/preview/flashmo_084_intro" target="_blank" 
    title="Item No. 43 (084 intro)" 
    description="Flash Intro using motion tweening, rounded rectangles masking effects with a background music" />
<thumbnail filename="flashmo_083_mouse_effect_2.jpg" url="http://www.flashmo.com/preview/flashmo_083_mouse_effect_2" target="_blank" 
    title="Item No. 44 (083 mouse effect 2)" 
    description="Sparkling magic mouse effect using Adobe's tween engine." />
<thumbnail filename="flashmo_083_mouse_effect_1.jpg" url="http://www.flashmo.com/preview/flashmo_083_mouse_effect_1" target="_blank" 
    title="Item No. 45 (083 mouse effect 1)" 
    description="Magic mouse effect or sparkling flash effect using Adobe's tween engine." />

<thumbnail filename="flashmo_082_dream.jpg" url="http://www.flashmo.com/preview/flashmo_082_dream" target="_blank" 
    title="Item No. 46 (082 dream)" 
    description="Dream Flash Template features the XML product list, XML news list and contact form" />
<thumbnail filename="flashmo_081_design.jpg" url="http://www.flashmo.com/preview/flashmo_081_design" target="_blank" 
    title="Item No. 47 (081 design)" 
    description="Flash Design Template using XML news list and XML product list." />
<thumbnail filename="flashmo_080_movie.jpg" url="http://www.flashmo.com/preview/flashmo_080_movie" target="_blank" 
    title="Item No. 48 (080 movie)" 
    description="Movie Template featuring horizontal thumbnail list for movies" />
<thumbnail filename="flashmo_079_classic.jpg" url="http://www.flashmo.com/preview/flashmo_079_classic" target="_blank" 
    title="Item No. 49 (079 classic)" 
    description="Classic Template with dynamic product list and xml news list" />
<thumbnail filename="flashmo_078_heart_effect_2.jpg" url="http://www.flashmo.com/preview/flashmo_078_heart_effect_2" target="_blank" 
    title="Item No. 50 (078 heart effect 2)" 
    description="Falling hearts flash effect using Adobe's tween engine" />
<thumbnail filename="flashmo_078_heart_effect_1.jpg" url="http://www.flashmo.com/preview/flashmo_078_heart_effect_1" target="_blank" 
    title="Item No. 51 (078 heart effect 1)" 
    description="Falling hearts on mouse move using Adobe's tween engine" />
<thumbnail filename="flashmo_077_jeans.jpg" url="http://www.flashmo.com/preview/flashmo_077_jeans" target="_blank" 
    title="Item No. 52 (077 jeans)" 
    description="Jeans company flash template, XML product list and news list." />
<thumbnail filename="flashmo_076_wood.jpg" url="http://www.flashmo.com/preview/flashmo_076_wood" target="_blank" 
    title="Item No. 53 (076 wood)" 
    description="Wood company static flash template, vertical tab menu style" />
<thumbnail filename="flashmo_075_butterfly.jpg" url="http://www.flashmo.com/preview/flashmo_075_butterfly" target="_blank" 
    title="Item No. 54 (075 butterfly)" 
    description="Butterfly animated flash template with a smooth transition including the XML news list" />

<thumbnail filename="flashmo_074_film.jpg" url="http://www.flashmo.com/preview/flashmo_074_film" target="_blank" 
    title="Item No. 55 (074 film)" 
    description="Film template features the dynamic XML gallery and contact form" />
<thumbnail filename="flashmo_073_heart_pink.jpg" url="http://www.flashmo.com/preview/flashmo_073_heart_pink" target="_blank" 
    title="Item No. 56 (073 heart pink)" 
    description="Heart pink template with animated heart buttons" />
<thumbnail filename="flashmo_072_blue.jpg" url="http://www.flashmo.com/preview/flashmo_072_blue" target="_blank" 
    title="Item No. 57 (072 blue)" 
    description="Blue flash template using simple button animations and smooth transition" />
<thumbnail filename="flashmo_071_sunrise.jpg" url="http://www.flashmo.com/preview/flashmo_071_sunrise" target="_blank" 
    title="Item No. 58 (071 sunrise)" 
    description="Sunrise flash template with dynamic XML lists" />
<thumbnail filename="flashmo_070_design.jpg" url="http://www.flashmo.com/preview/flashmo_070_design" target="_blank" 
    title="Item No. 59 (070 design)" 
    description="Static flash template design including scroll bar for news and animated header" />
<thumbnail filename="flashmo_069_stationery.jpg" url="http://www.flashmo.com/preview/flashmo_069_stationery" target="_blank" 
    title="Item No. 60 (069 stationery)" 
    description="Stationery flash template with photo swap effect" />

您可以在此处查看不起作用的实际示例:Non-Working

如果有人可以帮我解决这个问题,我会很高兴的。我会字面上给你我的灵魂。真。我保证。

1 个答案:

答案 0 :(得分:0)

使用ExternalInterface.call进行JavaScript调用,而不是像在示例中那样进行URLRequest。