AS3来自网络外部加载的SWF控制来自网络外部加载的SWF [英] as3 externally loaded swf from network to control externally loaded swf from network

查看:223
本文介绍了AS3来自网络外部加载的SWF控制来自网络外部加载的SWF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个职位是这样,但我还没有得到下降到最终的答案,所以我把这个图像一起,试图解释什么,我试图做的。我是如此接近。 如果你能帮助我谢谢SOOOO多。曾天这个至今。

I have had several posts like this but I have not gotten down to the final answer so I put this image together to try and explain what I am trying to do. I AM SO CLOSE. if you can help me THANK YOU SOOOO MUCH. Worked days on this so far.

如何控制儿童INSIDE外部加载SWF从code IN ANOTHER外部加载的SWF?

编辑:下面是THEE code位于ONE.swf,我需要帮助。只需一两行我知道,但我只是不能得到它。

Below is THEE code located in "ONE.swf" that I need help with. Just one or two lines I know but I JUST CANT get it.

function FunctionInOne()
{
var parentObj:Object = this.parent.parent as Object; //// GIVES ACCESS TO "Content.swf"
var TheStage:Object = this.parent.parent.parent as Object; //// GIVES ACCESS TO STAGE
trace(TheStage.stage.stageWidth);
trace(parentObj);  ///    [object MainTimeline]
trace(parentObj.ONE); /// [object Loader]
trace(parentObj.TWO); ///  [object Loader]

parentObj.alpha = .3; /// NOW I CONTROL THE ALPHA OF "Content.swf" from ONE.swf
var ControlTWO:Loader = parentObj.TWO; // GIVES ACCES TO LOADER TWO

ControlTWO.alpha = .3; // NOW I CONTROL THE ALPHA OF TWO.swf from ONE.swf


BUT HOW DO I GET ACCESS TO CONTROL THE CHILDREN IN "TWO.swf" from "ONE.swf"


var TWOchildren:MovieClip = MovieClip(TWO.content); // DOES NOT WORK
TWOchildren.ChildInTWO.alpha = .3;


var TWOchildren = TWO.content as MovieClip; // DOES NOT WORK
TWOchildren.ChildInTWO.alpha = .3;  // DOES NOT WORK

TWOchidren.FunctionInTWO(); /// DOES NOT WORK

}

修改:2012年3月16日

我能够从ONE.swf访问SWF TWO.swf和控制它的Alpha这一行:

I am able to access the swf TWO.swf from ONE.swf and control it's alpha with this line:

trace(MovieClip(parent.parent).ONE); 

不过,我需要控制一个孩子在这,所以我想这下code会工作,但它并不:

But I need to control a child in that so I thought this following code would work but it doesn't:

MovieClip(parent.parent).ONE.TheChild.alpha = .3;

编辑完---------------

END EDIT---------------

这里是另一个链接到它,如果你能看到它: http://mycontactcorner.com/sandbox/testing /ChildTwo.jpg

Here is another link to it if you can see it: http://mycontactcorner.com/sandbox/testing/ChildTwo.jpg

推荐答案

好,我找到了!谢谢你耶稣这个堆栈溢出以惊人的人FLOWING!

Ok I found it! Thank you JESUS for this STACK OVER FLOWING with amazing people!

var InsideConent:Object = this.parent.parent as Object; //// GIVES ACCESS TO "Content.swf"
var ItWorksNow:Sprite = MovieClip(InsideConent.TWO.content).ChildInTWO;  /// 

ItWorksNow.x = 333;  /// I can control property x
ItWorksNow.alpha = .3;  /// I can control the ALPHA! :)

WOO HOOOOOO! :)

WOO HOOOOOO! :)

GO GO堆栈过流! :)

GO GO STACK OVER FLOW! :)

这篇关于AS3来自网络外部加载的SWF控制来自网络外部加载的SWF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆