-
[RESOLVED] SWF loads in local preview but not from URL
I am having a problem with a couple of swf's loading within a main swf when published to the Internet. Local viewing (ctrl-enter) looks fine as well as "publish preview->html".
But, after loading it to the domain it breaks somehow. The swfs do not load. I've verified all the swfs are correct and present. No errors are thrown.
Here is my code if it helps to determine what I'm doing wrong.
TIA for any direction.
PHP Code:
import fl.controls.Button;
var loader:URLLoader=new URLLoader();
loader.addEventListener(Event.COMPLETE, loadXML);
loader.load(new URLRequest("buttons.xml"));
var flamesLoader:Loader=new Loader();
flamesLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, addFlames);
flamesLoader.load(new URLRequest("psychoflames.swf"));
var swfLoader:Loader=new Loader();
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,swfLoaded);
swfLoader.load(new URLRequest("home.swf"));
var infoFont:TextFormat = new TextFormat("verdana",12,0x4DE73A);
var buttonDrop:DropShadowFilter = new DropShadowFilter(4,45,0x4DE73A,1);
var myButton:Array = new Array();
var flames:MovieClip=new MovieClip();
var swf:MovieClip=new MovieClip();
var xml:XML;
var buttonCount = 1;
var i:int;
var len:int;
function addFlames(e:Event):void {
trace("flames Loaded");
flames.addChild(flamesLoader);
flames.x=10;
addChild(flames);
}
function swfLoaded(e:Event):void {
//swfLoader.removeEventListener(Event.COMPLETE,swfLoaded);
swf.addChild(swfLoader);
swf.x=300;
swf.scaleX=.75;
swf.scaleY=.75;
addChild(swf);
}
function loadXML(e:Event):void {
loader.removeEventListener(Event.COMPLETE, loadXML);
xml=new XML(e.target.data);
trace(xml);
len=xml.buttons.length();
buttonSetup();
infoSetup();
}
function infoSetup():void {
var daysWeek:String=xml.shop.days[0];
var daysWeekend:String=xml.shop.days[1];
var weekHours:String = xml.shop.hours[0];
var weekendHours:String=xml.shop.hours[1];
var psychoCompany:String=xml.shop.company;
var address:String=xml.shop.address;
var phone:String=xml.shop.phone;
trace(weekHours, weekendHours, daysWeek, daysWeekend, psychoCompany, address, phone);
}
function buttonSetup():void {
for(i=0; buttonCount<=len; i++) {
myButton[i] = new Button();
myButton[i].label=xml.buttons.button[i];
myButton[i].useHandCursor=true;
myButton[i].setSize(100,25);
myButton[i].move((300-myButton[i].width)/2,(150+30*i));
myButton[i].filters=[buttonDrop];
myButton[i].setStyle("textFormat",infoFont);
addChild(myButton[i]);
buttonCount++;
myButton[i].addEventListener(MouseEvent.CLICK, clicked);
}
}
function clicked(e:Event):void {
trace(e.target.label);
}
-
rabid_Delineator
What specifically is breaking ? Are you not seeing anything , is the flash debug player throwing errors ? Have you verified that your xml files are loading , and or in the right directories ? Need more specifics please.
-
well, while working with it, I deleted my browser cache and history and it is displaying correctly now from the Internet.
Thanks for a quick response Rabbit.
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
|