|
-
error 2044 and 2035
I'm using xml to load gallery images and content. Whenever I test the movie everything seems to load fine but i get:
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
I've checked the xml url and it's correct. Since all the content loads I'm not really sure why I'm getting the error. You can see the site functioning here
The swf that contains this code is nested within another clip. Both of these files are in the root directory, and the xml is in includes/site_xml.xml
I know the code snippet is long, but on the chance that the problem is with something other than the xml I wanted to be safe.
Any ideas? Thanks for any help.
Code:
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import caurina.transitions.Tweener;
import caurina.transitions.properties.DisplayShortcuts;
public class Page_Shoes extends MovieClip {
private var thumbs_condensed:Boolean = false;
private var my_il:ImageLoader = new ImageLoader( "", 464, 348);
private var view_bg:Button_Group;
public function Page_Shoes() {
//xml
var info_request:URLRequest = new URLRequest( "includes/site_xml.xml" );//loads xml file
var loader:URLLoader = new URLLoader();//creates a new URLloader variable object
loader.load( info_request );//loades content of xml file into the new variable object
loader.addEventListener( Event.COMPLETE, on_complete );//runs on_complete function when xml is loaded
addEventListener(Event.ENTER_FRAME, thumbScroller);
DisplayShortcuts.init();
Tweener.addTween( productShell, { alpha:0 } );
productShell.imageShell.addChild( my_il );
productShell.btn_1.addEventListener( MouseEvent.CLICK, click_1 );
productShell.btn_2.addEventListener( MouseEvent.CLICK, click_2 );
productShell.btn_3.addEventListener( MouseEvent.CLICK, click_3 );
productShell.btn_4.addEventListener( MouseEvent.CLICK, click_4 );
} // End OF CONSTRUCTOR
private function on_complete( e:Event ):void {
setup_shoe_list( e.currentTarget.data );//when complete, runs setup_shoe_list function with contents of xml
}
private function setup_shoe_list( _xml ):void {
var shoe_xml = new XML( _xml ); //makes and xml variable object
var shoe_list:XMLList = shoe_xml.shoe; //populates new object with xml data
var thumb_array:Array = new Array();
for ( var p in shoe_list ) {
var _mc:Thumbnail_Frame = new Thumbnail_Frame(); //makes new thumbnail holder
thumbnailTrack.addChild( _mc ); //adds thumnail holder to the track clip
_mc.y = p * 162; //sets the thumnail's y value based on it's index in the array
_mc.addEventListener( MouseEvent.CLICK, on_click ); //adds the click listner to the button
var my_th:ThumbnailLoader = new ThumbnailLoader( shoe_list[p].shoeThumbnail.toString(), 265, 150 ); //selects image for thumnail
_mc.emptyThumb.addChild( my_th ); //adds image to the thumnail
thumb_array.push( _mc ); //adds the thumnail to an array
_mc.image_three_quarter = shoe_list[p].shoeImage_threeQuarter.toString();
_mc.image_front = shoe_list[p].shoeImage_front.toString();
_mc.image_top = shoe_list[p].shoeImage_top.toString();
_mc.image_side = shoe_list[p].shoeImage_side.toString();
_mc.shoe_name = shoe_list[p].shoeTitle.toString();
_mc.shoe_desc = shoe_list[p].shoeDesc.toString();
_mc.shoe_price = shoe_list[p].shoePrice.toString();
_mc.shoe_size = shoe_list[p].shoeSize.toString();
_mc.shoe_color = shoe_list[p].shoeColor.toString();
}
var thumb_bg:Shoe_Button_Group = new Shoe_Button_Group( thumb_array );
}
private function thumbScroller(e:Event):void {
var mouse_location_percent = Math.round((this.mouseY/486)*100);
if ((this.mouseY >= 0) && (this.mouseY<= 486) && (this.mouseX >= 260)&& (this.mouseX <= 526)) {
thumbmail_scroll_engine(mouse_location_percent);
}
}
private function thumbmail_scroll_engine( scroll_direction ):void {
var speed_exponent = Math.abs(50-scroll_direction)/5; //sets the point of measure to the center, then adjusts the speed based on distance from center
if ( scroll_direction <= 40 ) {
scroll_up( speed_exponent );
}
if ( (scroll_direction <= 100) && (scroll_direction >= 60) ) {
scroll_down( speed_exponent );
}
}
private function scroll_up( speed_exponent ) {
if ( thumbnailTrack.y <= 0 ) {
thumbnailTrack.y = thumbnailTrack.y+(1*speed_exponent);
}
}
private function scroll_down( speed_exponent ) {
var scrollable_height = thumbnailTrack.height-486; //486 is the height of the visible area
if ( Math.abs(thumbnailTrack.y) <= scrollable_height) {
thumbnailTrack.y = thumbnailTrack.y-(1*speed_exponent);
}
}
private function on_click( e:MouseEvent ):void {
if ( thumbs_condensed == false ) { //compresses thumnails and shows product
view_bg = null;
productShell.btn_1.gotoAndStop( "_up" );
productShell.btn_2.gotoAndStop( "_up" );
productShell.btn_3.gotoAndStop( "_up" );
productShell.btn_4.gotoAndStop( "_up" );
productShell.btn_1.mouseEnabled = true;
productShell.btn_2.mouseEnabled = true;
productShell.btn_3.mouseEnabled = true;
productShell.btn_4.mouseEnabled = true;
productShell.btn_1.buttonMode = true;
productShell.btn_2.buttonMode = true;
productShell.btn_3.buttonMode = true;
productShell.btn_4.buttonMode = true;
view_bg = new Button_Group([ productShell.btn_1, productShell.btn_2, productShell.btn_3, productShell.btn_4 ], 0);
Tweener.addTween( thumbnailMask, { width:125, time:1 } );
Tweener.addTween( thumbnailTrack, { x:191.25, alpha:.3, time:1 } );
Tweener.addTween( productShell, { alpha:1, time:.5, delay:.5, transition: "linear" } );
removeEventListener(Event.ENTER_FRAME, thumbScroller);
my_il.load_image( e.currentTarget.image_three_quarter );
productShell.image_three_quarter = e.currentTarget.image_three_quarter;
productShell.image_front = e.currentTarget.image_front;
productShell.image_top = e.currentTarget.image_top;
productShell.image_side = e.currentTarget.image_side;
productShell.shoe_title.text = e.currentTarget.shoe_name;
productShell.shoe_desc.text = e.currentTarget.shoe_desc;
productShell.shoe_price.text = e.currentTarget.shoe_price;
productShell.shoe_size.text = e.currentTarget.shoe_size;
productShell.shoe_color.text = e.currentTarget.shoe_color;
productShell.image_front = e.currentTarget.image_front;
thumbs_condensed = true;
} else { //expands thumbnails and hides product
Tweener.addTween( thumbnailMask, { width:268, time:1, delay:.5 } );
Tweener.addTween( thumbnailTrack, { x:260, alpha:1, time:1, delay:.5 } );
Tweener.addTween( productShell, { alpha:0, time:.5, transition: "linear" } );
addEventListener(Event.ENTER_FRAME, thumbScroller);
thumbs_condensed = false;
}
}
private function click_1( e:MouseEvent ): void {
my_il.load_image( productShell.image_three_quarter );
}
private function click_2( e:MouseEvent ): void {
my_il.load_image( productShell.image_front );
}
private function click_3( e:MouseEvent ): void {
my_il.load_image( productShell.image_top );
}
private function click_4( e:MouseEvent ): void {
my_il.load_image( productShell.image_side );
}
} // END OF CLASS
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|