Putting background in flash

From this previous question:
http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/Q_23118289.html
How do I put a background in? I can't just drag an image from my library, it blocks everything.

Thanks!
894359Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobOwner (Aidellio)Commented:
what about if you add a layer at the bottom of your timeline, select it and then drag in your image?
0
894359Author Commented:
I get the text showing but not the images fading in and out!
0
cforantCommented:
Put background image on a separate layer (Insert > Timeline > Layer) and drag the layer to the bottom of all layers.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

894359Author Commented:
I did that but still don't see the images fading in and out.
0
894359Author Commented:
Here's the as involved.
package{
	import caurina.transitions.Tweener;
	
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.IOErrorEvent;
	import flash.net.URLLoader;
	import flash.net.URLLoaderDataFormat;
	import flash.net.URLRequest;
	import flash.net.URLVariables;
	import flash.text.Font;
	import flash.text.TextField;
	import flash.text.TextFormat;
 
	public class SlideShowText extends Sprite{
		private var images:XMLList;
		private var texts:XMLList;
		private var delay:Number = 0;
		private var currentIndex:int = 0;
		private var loader:Loader;
		//private var text:TextField;
		private var xml:XML;
		private var uloader:URLLoader;
		
		public function SlideShowText(){
			uloader = new URLLoader();
			uloader.addEventListener(Event.COMPLETE,onComplete);
			//First we load the xml
			uloader.load(new URLRequest("images.xml"));
			//And set the loader for the images
			loader = new Loader();
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE,imageComplete);
			loader.addEventListener(IOErrorEvent.IO_ERROR,onError);
			loader.alpha = 0;
			//Text was created on stage
			text.alpha = 0;
			//Must embed fonts so it accepts alpha
			//Look at the library there is a font item there to, exported for actionscript
			text.embedFonts = true;
			//add the loader to stage in depth 0, below the text that was already there
			addChildAt(loader,0);
		}
		
		private function onComplete(e:Event):void{
			//On complete xml download
			xml = new XML(uloader.data as String);
			//fill properties with xmllists - like arrays
			images = xml..image;
			texts = xml..text;
			delay = Number(xml.@delay);
			//Then we can start the slideshow
			initSlideShow();
		}
		private function onError(e:IOErrorEvent):void{
			trace(e.text);
		}
		private function loadImage(index:int):void{
			var url:String = images[index].toString();
			loader.load(new URLRequest(url));
		}
		private function initSlideShow():void{
			//First step - load first image
			loadImage(currentIndex);
		}
		public function imageComplete(e:Event):void{
			//when download is complete
			text.text = texts[currentIndex];
			//set its size to stage size 200x200
			loader.width = stage.stageWidth;
			loader.height = stage.stageHeight;
			//then fadeIn image
			imageIn();
		}
		public function imageIn():void{
			//fades image in
			Tweener.addTween(loader,{alpha:1.0,time:1,onComplete:textIn});
			//after fadein complete: textIn
		}
		public function textIn():void{
			//fades text in
			Tweener.addTween(text,{alpha:1.0,time:1,onComplete:textOut});
			//fades text out
		}
		public function textOut():void{
			//fades text out but wait for the delay - 3000/1000 = 3 seconds
			Tweener.addTween(text,{alpha:0.0,time:1,delay:delay/1000,onComplete:imageOut});
			//imageOut
		}	
		public function imageOut():void{
			//fades image out
			Tweener.addTween(loader,{alpha:0.0,time:1,onComplete:nextImage});
			//nextImage
		}
		public function nextImage():void{
			//increase index
			currentIndex++;
			//if index greater than number of images, back to image 0
			if(currentIndex >= images.length())currentIndex = 0;
			//load next image based on the index
			loadImage(currentIndex);
		}		
	}
}

Open in new window

0
julianopolitoCommented:
The background should be put in the FLA document, in a layer below the text layer. Also you should change the line 42 in the .AS file for this:

addChildAt(loader,1);

This will add the image loaded below the text, but above your custom background. I'm sorry for taking so long to respond, I was not home for th weekend
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
894359Author Commented:
Thanks for the response! Much appreciated again! :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.