1

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.

Miki
  • 2,493
  • 2
  • 27
  • 39
  • Where are you calling this from? apparently your parent can not reference desk as a child. which means all you have to do is find out its path, maybe try stage.setChildIndex? Secondly, when setting indexes, they MUST be in linear order. (very annoying) for instance you can't have: movieclip1's index at 0 and movieclip2's index at 15, and nothing in between. See: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObjectContainer.html#setChildIndex%28%29 Hope this helps :) – Zze Oct 03 '14 at 23:30
  • Thank you, @Zze. Desk is a symbol in the same layer as the imported MovieClip. I don't know how to reference things not specifically called out in the ActionScript 3.0 frame. That link you sent is a great directory for those terms, thank you. I am still unsure how to sync the streaming MovieClip with the displayed timeline for export purposes. Any thoughts? – Jacob Scott Oct 04 '14 at 05:39
  • Glad I could help. I just booted up the SitePal site, and it looks like the animations just stop working when you switch to offline mode.. So may not be anything i can help you with in regards to that.. Are you asking how to reference elements on other frames? ("I don't know how to reference things not specifically called out in the ActionScript 3.0 frame.") – Zze Oct 04 '14 at 08:43
  • @Zze, that is correct. I know the EXPORT option in Adobe Flash CS5 will allow me to "capture" the streaming MovieClip video from SitePal's website. My only remaining issue is how to align the streaming clip with the other frames on the timeline. I cannot add a symbol on another layer at frame 120, for example, and have it appear during the playback of the streaming SitePal avatar. The workaround I am considering is to export the stage + avatar as a .MOV and then add in other elements (speech bubbles) in iMovie. Clunky, but it works. I'd prefer to add the bubbles to Flash before export. – Jacob Scott Oct 04 '14 at 17:49

0 Answers0