覆盖flex中的公共函数initialize()错误

发布于 2024-11-05 13:17:45 字数 1145 浏览 4 评论 0原文

我想知道我应该在 .mx_internal 之前添加什么

override public function initialize() : void
    {
        var target:DialogButtons;
        var watcherSetupUtilClass:Object;
        .mx_internal::setDocumentDescriptor(_documentDescriptor_);
        var bindings:* = _DialogButtons_bindingsSetup();
        var watchers:Array;
        target;
        if (_watcherSetupUtil == null)
        {
            watcherSetupUtilClass = getDefinitionByName("_components_DialogButtonsWatcherSetupUtil");
            var obj1:* = watcherSetupUtilClass;
            obj1.watcherSetupUtilClass["init"](null);
        }
        _watcherSetupUtil.setup(this, function (param1:String)
        {
            return target[param1];
        }// end function
        , bindings, watchers);
        var i:uint;
        while (i < bindings.length)
        {

            Binding(bindings[i]).execute();
            i = (i + 1);
        }
        mx_internal::_bindings = mx_internal::_bindings.concat(bindings);
        mx_internal::_watchers = mx_internal::_watchers.concat(watchers);
        super.initialize();
        return;
    }// end function

i want to know what i should put befor .mx_internal

override public function initialize() : void
    {
        var target:DialogButtons;
        var watcherSetupUtilClass:Object;
        .mx_internal::setDocumentDescriptor(_documentDescriptor_);
        var bindings:* = _DialogButtons_bindingsSetup();
        var watchers:Array;
        target;
        if (_watcherSetupUtil == null)
        {
            watcherSetupUtilClass = getDefinitionByName("_components_DialogButtonsWatcherSetupUtil");
            var obj1:* = watcherSetupUtilClass;
            obj1.watcherSetupUtilClass["init"](null);
        }
        _watcherSetupUtil.setup(this, function (param1:String)
        {
            return target[param1];
        }// end function
        , bindings, watchers);
        var i:uint;
        while (i < bindings.length)
        {

            Binding(bindings[i]).execute();
            i = (i + 1);
        }
        mx_internal::_bindings = mx_internal::_bindings.concat(bindings);
        mx_internal::_watchers = mx_internal::_watchers.concat(watchers);
        super.initialize();
        return;
    }// end function

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我的鱼塘能养鲲 2024-11-12 13:17:45

mx_internal 应该不带点。

mx_internal should be without dot.

各自安好 2024-11-12 13:17:45

您不必每次访问 mx_internal 命名空间时都引用它。您只需将其导入到类中即可。使用这样的语句:

import mx.core.mx_internal;
use namespace mx_internal;

然后像这样重新编写代码:

override public function initialize() : void
    {
        var target:DialogButtons;
        var watcherSetupUtilClass:Object;
// line commented to snow the mx_internal less code
//        .mx_internal::setDocumentDescriptor(_documentDescriptor_);
        setDocumentDescriptor(_documentDescriptor_);
        var bindings:* = _DialogButtons_bindingsSetup();
        var watchers:Array;
        target;
        if (_watcherSetupUtil == null)
        {
            watcherSetupUtilClass = getDefinitionByName("_components_DialogButtonsWatcherSetupUtil");
            var obj1:* = watcherSetupUtilClass;
            obj1.watcherSetupUtilClass["init"](null);
        }
        _watcherSetupUtil.setup(this, function (param1:String)
        {
            return target[param1];
        }// end function
        , bindings, watchers);
        var i:uint;
        while (i < bindings.length)
        {

            Binding(bindings[i]).execute();
            i = (i + 1);
        }
// lines commented to snow the mx_internal less code
//        mx_internal::_bindings = mx_internal::_bindings.concat(bindings);
 //       mx_internal::_watchers = mx_internal::_watchers.concat(watchers);
        _bindings = _bindings.concat(bindings);
        _watchers = _watchers.concat(watchers);
        super.initialize();
        return;
    }// end function

You don't have to reference the mx_internal namespace every time you access it. You can just import it into the class. Use statements like this:

import mx.core.mx_internal;
use namespace mx_internal;

Then re-write your code like this:

override public function initialize() : void
    {
        var target:DialogButtons;
        var watcherSetupUtilClass:Object;
// line commented to snow the mx_internal less code
//        .mx_internal::setDocumentDescriptor(_documentDescriptor_);
        setDocumentDescriptor(_documentDescriptor_);
        var bindings:* = _DialogButtons_bindingsSetup();
        var watchers:Array;
        target;
        if (_watcherSetupUtil == null)
        {
            watcherSetupUtilClass = getDefinitionByName("_components_DialogButtonsWatcherSetupUtil");
            var obj1:* = watcherSetupUtilClass;
            obj1.watcherSetupUtilClass["init"](null);
        }
        _watcherSetupUtil.setup(this, function (param1:String)
        {
            return target[param1];
        }// end function
        , bindings, watchers);
        var i:uint;
        while (i < bindings.length)
        {

            Binding(bindings[i]).execute();
            i = (i + 1);
        }
// lines commented to snow the mx_internal less code
//        mx_internal::_bindings = mx_internal::_bindings.concat(bindings);
 //       mx_internal::_watchers = mx_internal::_watchers.concat(watchers);
        _bindings = _bindings.concat(bindings);
        _watchers = _watchers.concat(watchers);
        super.initialize();
        return;
    }// end function
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文