I have been having major issues with getting my flash file to play with UFO.js 3.22 on a server.
<div style="width:974px; height:300px; margin:auto; text-align:center;">
<script type="text/javascript">
var FO = { movie:"/ContactUS/_Swf/en/main_Home.swf", width:"974", height:"300", majorversion:"8", build:"0", xi:"true",allowfullscreen:"true", menu:"false", wmode:"transparent" ,allowscriptaccess:"sameDomain" };
UFO.create(FO, "flashmedia");
</script>
<asp:DataGrid id="dg" runat="server"></asp:DataGrid>
<div id="flashmedia">
The file plays fine on the server if I run it by itself, but will not play friendly embedded in a page. (When I click within the flash placeholder, I only get the flash menu over the place where the dynamic text boxes would be.)
I am using XML and external images.
I am guessing it has something to do with “setChildIndex” in the code. Not sure though. Any gurus out there that can help?!?! 
Here is the code:
import fl.transitions.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
import flash.filters.DropShadowFilter;
import flash.filters.GlowFilter;
import flash.filters.BlurFilter;
import flash.events.*;
import flash.net.*;
import flash.display.*;
var nr_photos:Number;
var photos:XMLList;
var photoWidth:Number = 322;
var photoHeight:Number = 322;
var loaderArray:Array=[];
var loadCounter:Number=0;//counters
var playback_counter:Number=0;
var start_counter:Number=0;
var slideshow:Sprite = new Sprite();//slideshow
var images:Sprite = new Sprite();//image container
var listOfMovieClips:Array = new Array();//variable that holds movie clips
var timer:Timer;//timers
var prevTween:Tween;
var tweensArray:Array=[];//array of tweens
var dir:Number = 1;
var myLoader3:Loader=new Loader();
myLoader3.load(new URLRequest("images/ltblbackgroundgrad.png"));
addChild(myLoader3);
setChildIndex(myLoader3, numChildren -4);
var myLoader2:Loader=new Loader();
myLoader2.load(new URLRequest("images/globe2.png"));
addChild(myLoader2);
setChildIndex(myLoader2, numChildren -3);
var myLoader:Loader=new Loader();
myLoader.load(new URLRequest("images/hands.png"));
addChild(myLoader);
setChildIndex(myLoader, numChildren - 1);
var myXML_loader:URLLoader = new URLLoader();
myXML_loader.load(new URLRequest("xml/gallery.xml"));
// NO XML CACHE HACK
// myXML_loader.load(new URLRequest("gallery.xml" + "?uniq=" + new Date().getTime()));
myXML_loader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void {
var myXML:XML=new XML(e.target.data);
photos=myXML.item;
nr_photos=photos.length();
loadImages();
myXML_loader.removeEventListener(Event.COMPLETE, processXML);
myXML_loader=null;
}
function loadImages():void {//load images into an array
for (var i:Number = 0; i < nr_photos; i++) {
var my_url:String=photos*.@path;
var my_loader:Loader = new Loader();
my_loader.load(new URLRequest(my_url));
my_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
loaderArray.push(my_loader);
}
}
function onComplete(e:Event):void {
loadCounter++;
if (loadCounter==nr_photos) {//start show when all images are stored in array
startShow();
}
var my_loaderInfo:LoaderInfo=LoaderInfo(e.target);
my_loaderInfo.removeEventListener(Event.COMPLETE, onComplete);//removing event listener
}
function startShow():void {
addChild(slideshow);//adding components to stage
slideshow.addChild(images);
setChildIndex(slideshow, 4);
textHolder4.titleText3.text = photos[playback_counter].@textstat;
textHolder4.titleText4.text = photos[playback_counter].@textstat2;
setChildIndex(textHolder4, 5);
nextImage(playback_counter);
}
function nextImage(num:int):void {
timer=new Timer(photos[playback_counter].@speed);
timer.addEventListener(TimerEvent.TIMER, timerListener);
timer.start();
var myImage:Loader=Loader(loaderArray[playback_counter]);
myImage.width = photoWidth;//setting image size
myImage.height = photoHeight;
images.addChild(myImage);
tweensArray[0]=new Tween(myImage,"alpha",Strong.easeInOut,0,1,photos[playback_counter].@tweentime,true);//here you can change easing of tween (In, Out, InOut)
if (String(photos[playback_counter].@textvis) == "true") {//loading text
textHolder.titleText.text = photos[playback_counter].@text;
textHolder2.titleText2.text = photos[playback_counter].@texturl;
new Tween(textHolder.titleText, "alpha", Strong.easeInOut,0, 1, photos[playback_counter].@tweentimetext, true);
new Tween(textHolder2.titleText2, "alpha", Strong.easeInOut,0, 1, photos[playback_counter].@tweentimetext, true);
setChildIndex(textHolder,2);
setChildIndex(textHolder2,3);
var format:TextFormat = new TextFormat();
format.font = photos[playback_counter].@textfont;
format.size = photos[playback_counter].@textsize;//setting text's size, alignment and color
format.align = photos[playback_counter].@textalign;
format.color = photos[playback_counter].@textcolor;
textHolder.titleText.setTextFormat(format);
} else if (String(photos[playback_counter].@textvis) == "false") {
textHolder.titleText.text = "";
textHolder2.titleText2.text = "";
}
images.buttonMode = false;//making a hand cursor over images
images.useHandCursor = false;
images.mouseChildren = false;
textHolder.buttonMode = false;//making a hand cursor over text
textHolder.useHandCursor = false;
textHolder.mouseChildren = false;
textHolder2.buttonMode = false;//making a hand cursor over text
textHolder2.useHandCursor = false;
textHolder2.mouseChildren = false;
textHolder4.buttonMode = false;//making a hand cursor over text
textHolder4.useHandCursor = false;
textHolder4.mouseChildren = false;
}
function timerListener(e:TimerEvent):void {
hidePrev();
playback_counter++;
if (playback_counter==nr_photos) {
playback_counter=0;
}
timer.stop();
nextImage(playback_counter);
}
function hidePrev():void {//hiding previous images
var myImage:Loader=Loader(images.getChildAt(0));
prevTween=new Tween(myImage,"alpha",Strong.easeInOut,1,0,photos[playback_counter].@tweentime,true);
prevTween.addEventListener(TweenEvent.MOTION_FINISH, onFadeOut);
}
function onFadeOut(e:TweenEvent):void {//removing images
images.removeChildAt(0);
}