【问题标题】:How to use geturl using class in AS3如何在 AS3 中通过类使用 geturl
【发布时间】:2012-12-26 13:15:54
【问题描述】:

我试试这个代码(我的班级名称是 bAEForm)

package {

      import flash.display.SimpleButton;
      import flash.display.Sprite;
      import flash.net.navigateToURL;
      import flash.net.URLRequest;
      import flash.net.URLRequestMethod;
      import flash.net.URLVariables;

    public class bAEForm extends Sprite {

        public function bAEForm() {
            var url:String = "http://www.google.com";
            var request:URLRequest = new URLRequest(url);

            var variables:URLVariables = new URLVariables();
variables.exampleSessionId = new Date().getTime();
variables.exampleUserLabel = "guest";
request.data = variables;
request.method = URLRequestMethod.POST;

navigateToURL(request);
        }
    }
}

我收到了这个错误

“bAEForm”类必须是“flash.display.SimpleButton”的子类,因为 它链接到该类型的库符号。

【问题讨论】:

    标签: actionscript-3 flash flash-cs5


    【解决方案1】:

    在您的 Flash 库中的“bAEForm”中可能继承了一个 SimpleButton 或强制转换为一个。

    如果有误,您应该将其更改为 MovieClipSprite

    否则,如果是按钮,则更新:

    public class bAEForm extends SimpleButton { ...
    

    【讨论】:

    • 感谢它的工作,但再次面临一些问题。当我去我的场景(我放按钮的地方)时,会自动打开 2 个浏览器。我不需要这个。我需要,当我按下按钮时,浏览器应该打开
    • 很难解决您的问题。把它作为一个新问题详细地提出来,也许还有一些截图。请记得勾选任何对您有帮助的答案旁边的绿色勾号。
    • 没有截图简单地说就是这个……我有2个场景。在第二个场景中,我创建了一个按钮(在这个按钮中我使用了代码)。发布后,当我自动进入第二个场景时,我需要打开 2 个浏览器,当我按下按钮时,浏览器应该打开,但它会自动打开
    • 查看我对您的问题的回答here。也许这会有所帮助
    猜你喜欢
    • 2019-04-18
    • 2013-07-29
    • 2017-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多