I am way out of my depth here.
I have some resources loaded from Illustrator - a background and a "Desk" symbol. My intent is to create a 60-second flash animation with a SitePal.com-exported avatar standing behind the desk. SitePal provides the AS3 code and I have a functioning mockup of all the elements, but I do not understand the relationship to the timeline nor how to export the file so the output can be played offline. The SitePal avatar requires a call to their server to animate and any export attempts do not capture the embedded avatar video.
This may make more sense to you with code:
import flash.display.MovieClip;
Security.allowDomain("content.oddcast.com","l.content.oddcast.com");
var ldr:Loader;
var length:Number;
var req:URLRequest;
var vh_player:MovieClip;
var _example_ui:MovieClip;
var Desk:MovieClip;
req = new URLRequest("http://content.oddcast.com/vhss/vhss_v5.swf?doc=http%3A%2F%2Fvhss-d.oddcast.com%2Fphp%2FplayScene%2Facc%3D4721272%2Fss%3D2383868%2Fsl%3D0&acc=4721272&bgcolor=0x&embedid=16775f9f202df0a426d32f2b6eec43e0");
ldr = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler);
ldr.load(req);
addChild(ldr);
addChild(Desk);
ldr.x = 700;
ldr.y = 400;
ldr.scaleX = .7;
ldr.scaleY = .7;
parent.setChildIndex(Desk, 0);
parent.setChildIndex(ldr, 2);
function completeHandler($ev:Event):void
{
trace("IT WORKED! "+$ev.target);
vh_player = MovieClip(ldr.content);
}
I am sure this is incorrect syntax. My Google-fu has failed me. I receive the following error when I test the animation within Adobe Flash:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/setChildIndex()
at flash.display::Stage/setChildIndex()
at DoesItWork_fla::MainTimeline/frame1()
IT WORKED! [object LoaderInfo]
Obviously I don't understand how to pair parents & child objects. But they work, visually.
How do I align that imported animation to the timeline? I know I need to introduce some form of length: designation, but I can't figure it out.
Even a link to a relevant tutorial would be helpful. I've been at this for a few days now.