闪光:我怎么可以在Flash中投滑块类的DisplayObject? [英] Flash: how can I cast a slider class to DisplayObject in Flash?

查看:117
本文介绍了闪光:我怎么可以在Flash中投滑块类的DisplayObject?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试这样做:

 项(DisplayObject(滑块))parent.addEventListener(CustomEvent.CUSTOM_EVENT_TYPE,onCustomEventType)。
 

但闪光灯不喜欢

有关整体环境看 <一href="http://stackoverflow.com/questions/5604384/why-flash-doesnt-recognize-this-parent-property-how-to-get-the-parent-which-in">Why Flash不认识到这一点parent属性?如何获得这些实例化一个对象的父?

解决方案

 (滑动器的DisplayObject).parent.addEventListener(CustomEvent.CUSTOM_EVENT_TYPE,onCustomEventType);
 

I tried this:

    (DisplayObject(slider)).parent.addEventListener(CustomEvent.CUSTOM_EVENT_TYPE, onCustomEventType);

but flash doesn't like

For whole context see Why Flash doesn't recognize this parent property ? How to get the parent which instantiated an object ?

解决方案

(slider as DisplayObject).parent.addEventListener(CustomEvent.CUSTOM_EVENT_TYPE, onCustomEventType);

这篇关于闪光:我怎么可以在Flash中投滑块类的DisplayObject?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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