0

i try this code (my class name is 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);
        }
    }
}

I got this error

The class “bAEForm” must subclass “flash.display.SimpleButton” since it is linked to library symbol of that type.

loxxy
  • 12,990
  • 2
  • 25
  • 56
Nav
  • 25
  • 1
  • 8

1 Answers1

1

In the "bAEForm" in your flash library is probably inheriting a SimpleButton or casted as one.

If it's a mistake you should change that to a MovieClip or a Sprite.

Else, if it is a button, update :

public class bAEForm extends SimpleButton { ...
loxxy
  • 12,990
  • 2
  • 25
  • 56
  • Thx dear its work but again facing some problem. When I go my scene (where I put my button), Automatically 2 browsers are open. I don’t need this. I need, when I press my button then browser should to be open – Nav Dec 26 '12 at 14:30
  • 1
    Hard to get your problem. Put it up in detail as a new question with perhaps some screenshots. Do remember to check the green tick next to any answer that helps you. – loxxy Dec 26 '12 at 14:42
  • There is no screenshot to put simply is this… I have 2 scenes. In 2nd scene I create a button (in this button I use the code). After publish when I go my 2nd scene automatically 2 browsers is open, I need, when I press my button then browser should be open but its opening automatically – Nav Dec 26 '12 at 15:42
  • See my answer to your question [here](http://stackoverflow.com/questions/14042593/how-to-use-geturl-in-the-class-as3/14043052#14043052). Perhaps that could help – loxxy Dec 26 '12 at 16:07