Error URLRequest

Dear all.
I want to write an application in flash media server.
I installed FMS 4.5 Enterprise.
I want to get web content that it is json format.
My code:
//Get web content example 1
                var url = "http://10.84.70.133:8084/?q=external_api_transcode/getProgramByChannelAndDate&channel=vtv3 &date=20130404";
                var request = new URLRequest(url);
                var loader = new URLLoader();
                loader.load(request);
                trace(loader.data);
But when I load this application then there is error related URLRequest as below:
Sending error message: /opt/adobe/fms/applications/dvrcast_origin/main.asc: line 44: ReferenceError: URLRequest is not defined
I don't know why error appeared?
Can you help me as soon as?

My code :
var url = "http://10.84.70.133:8084/?q=external_api_transcode/getProgramByChannelAndDate&channel=vtv3 &date=20130404";
        var loadvar = new LoadVars();
        loadvar.onData = function(src) {
        if (src == undefined) {
                trace("Error loading content.");
                return;
        trace(src);
        loadvar.load(url,loadvar,"GET");
        trace(loadvar.toString());
But it is not ok.
Can you help me?

Similar Messages

  • Error with Posting..URLRequest

    package
              import flash.events.MouseEvent;
              import flash.net.URLLoader;
              import flash.net.URLRequest;
              import flash.net.URLVariables;
              import flash.net.URLLoaderDataFormat;
              import flash.net.URLRequestMethod;
              import flash.events.Event;
              import com.adobe.serialization.json.JSON;
              import flash.utils.Timer;
              import flash.events.TimerEvent;
              import flash.errors.IOError;
              import flash.events.IOErrorEvent;
              public class Score
                        private var loader : URLLoader = new URLLoader;
                        private var urlreq:URLRequest = new URLRequest("http://western_education/scores/submit");
                            private var urlvars: URLVariables = new URLVariables;
                        private var sessionId:int = 0;
                        private var sendingScore:Boolean = false;
                        public var msg:String = "";
                        public var isSuccessful:Boolean = false;
                        private var timeoutTmr:Timer = new Timer(5000, 0);
                        public function Score(){
                                  loader.dataFormat = URLLoaderDataFormat.TEXT;
                                  urlreq.method = URLRequestMethod.POST;
                                  sessionId = Math.random()*10000000;
                                  timeoutTmr.addEventListener(TimerEvent.TIMER, timeoutTmrListener);
                        public function setSendingScore(val:Boolean){
                                  sendingScore = val;
                        public function getSendingScore(){
                                  return sendingScore;
                        public function sendScore(gameId:int, score:int, knowledgeTokens:int):void{
                                  urlvars.score = score;
                                  urlvars.knowledgeTokens = knowledgeTokens;
                                  urlvars.gameId = gameId;
                                  urlvars.sessionId = sessionId;
                                  urlreq.data = urlvars;
                                  loader.addEventListener(Event.COMPLETE, completed);
                                  loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
                                  loader.load(urlreq);
                                  setSendingScore(true);
                                  timeoutTmr.start();
                        private function onIOError(e:IOErrorEvent){
                                  setSendingScore(false);
                                  msg = "Connection Timed Out.";
                        private function timeoutTmrListener(e:TimerEvent){
                                  setSendingScore(false);
                                  msg = "Connection Timed Out.";
                                  timeoutTmr.stop();
                        public function completed(event:Event): void
                                  try{
                                            var returnData: URLLoader = URLLoader(event.target);
                                            var jsonData:Object= com.adobe.serialization.json.JSON.decode(returnData.data);
                                            msg = jsonData.message;
                                            isSuccessful = ((jsonData.isSuccessful == "true") ? true : false);
                                            sessionId++;
                                            setSendingScore(false);
                                            timeoutTmr.stop();
                                  }catch(e:Error){
                                            msg = e.message;
                                            setSendingScore(false);
                                            timeoutTmr.stop();
    This code works perfectly fine but when I create another class and just change the name of the respective class, but with the same logic, it no longer handles the post properly [and it will return that nothing was posted]..  Even though it's the same URL and code...
    How I stumbled upon this was because I was trying to do a post to another URL but couldn't figure out for the life of me what was failing.  Any help is appreciated.
    Thanks,
    Tim

    Hey kglad,
    My apologies; I figured out the problem which turned out to be stupid.  I didn't have the constructor matching the new name.. :-/
    Welp.  Thanks for helping out though.

  • I am getting an error report and not sure how to fix the script. Please help... 3

    So now Im getting a new error report. I named the instance of the button in the properties panel btn_ccbil.
    Here is the code I have now:
    import flash.net.URLRequest;
    var url:String = 'http://www.lexiefyfe.com/ccbill9001/index.htm';
    btn_ccbil.addEventListener(MouseEvent.CLICK, onOrderClick);
    function onOrderClick():void
          var request:URLRequest = new URLRequest(url);
          try {
                navigateToURL(request, '_blank');
          } catch (e:Error) {
                trace('An error occurred');
    Here is the error report:
    Scene=photogallery, layer=buttons, frame=1, Line 7 A type identifier is expected after the ':'.
    Scene=photogallery, layer=buttons, frame=1, Line 9 The class or interface 'flash.net.URLRequest' could not be loaded.
    This is the original code for the billing from ccbill I am trying to get to work with flash:
    <A HREF="http://www.lexiefyfe.com/ccbill9001/index.htm"><img src="ccbutton.jpg"></A>
    Is this just something that flash can't do? If so will someone please let me know. I am running in circles at this point and very frustrated... I'm new to as3 but I thought it could work.
    Thank you to all for the help and consideration,
    Thomas

    You appear to be using AS3 code in an AS2 setting.  Go into your Publish Settings and change the actionscript version to AS3 in the Flash section.
    Other matters...
    You do not need to import the URLRequest class while coding in the Flash IDE.
    You need to put an argument in the function definition due to the listeners throwing one when it is triggered...
    function onOrderClick(evt:MouseEvent):void

  • I am getting an error report and not sure how to fix the script. Please help...

    I am using action script 3. I have html codes from ccbill that I am trying to make work with flash. Here is the script I am trying to use:
    import flash.net.URLRequest;
    var url:String = 'http://www.lexiefyfe.com/ccbill9001/index.htm';
    myButton.addEventListener(MouseEvent.CLICK, onOrderClick);
    function onOrderClick():void
          var request:URLRequest = new URLRequest(url);
          try {
                navigateToURL(request, '_blank');
          } catch (e:Error) {
                trace('An error occurred');
    Here is the code from ccbill:
    <A HREF="http://www.lexiefyfe.com/ccbill9001/index.htm"><img src="ccbutton.jpg"></A>
    This is the error report I am getting:
    Scene=photogallery, layer=buttons, frame=1, Line 1 Statement must appear within on handler
    Scene=photogallery, layer=buttons, frame=1, Line 3 Statement must appear within on handler
    Scene=photogallery, layer=buttons, frame=1, Line 5 Statement must appear within on handler
    Scene=photogallery, layer=buttons, frame=1, Line 7 A type identifier is expected after the ':'.
    Scene=photogallery, layer=buttons, frame=1, Line 9 The class or interface 'flash.net.URLRequest' could not be loaded.
    Scene=photogallery, layer=buttons, frame=1, Line 7 Statement must appear within on handler
    If anyone can help me with this issue I would be most grateful.
    Thank you for any consideration,
    Thomas

    You have a mixture of things going on... AS3 code in an AS2 setting.  Those are all AS2 error messages, and they are indicating you have placed the code on the buttons.  To use that code, it must be placed on the timeline, and your Flash Publish Settings need to have AS3 specified instead of AS2.  AS3 does not allow code to be placed on objects like AS2 does.

  • Need help non-null error: xml or onComplete?

    Can someone tell me what this means?
    The slideshow its referring to is a something I purchased online and is embedded into my movie.
    Does it mean  I need to put and onComplete function on the page thats loading this?  Is it for the xml or the slideshow movie?
    Or am I missing eventListener somewhere?
    Error #2007: Parameter listener must be non-null.
        at flash.events::EventDispatcher/addEventListener()
        at slideshow_fla::TheWholeSlideshow_1/xmlLoaded()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at flash.net::URLLoader/onComplete()
    Thanks in advance
    Barbara

    Thats is my question, I just have this code on the frame  that I want it to play on and it plays on the first try, after that it's not loading.
    I don't know what i am doing wrong or how or where to code to put the listener.  I've tried so many things, obviously not the right thing!
    var ss1Req:URLRequest = new URLRequest("slideshow/slideshow.swf");
    var ss1loader:Loader = new Loader();
            _1a.x = 10;
            _1a.y = 70;
            ss1loader.load(ss1Req);
            _1a.addChild(ss1loader);
        ss1loader.unload();
    This is the buttoncode that takes user to the page
    smm1_btn.addEventListener(MouseEvent.MOUSE_DOWN, slide);
            function slide(event:MouseEvent):void  {
                if (this.vidPlayer == !null)
            this.vidPlayer.stop();
            SoundMixer.stopAll();
                MovieClip(this.parent).gotoAndStop("photo");
    This is the site :
    http://www.stacykessler.com/test.html
    Thanks,

  • TypeError: Error #1034 - Want to display a swf

    Hi,
    I´m new to AS3 and try to load/display swf´s on the stage. The swf´s should run and if the user clicks a button the next swf should be displayed.
    That works so far if I use some swf´s that are created also with FlashPlayer 9 and AS3. But if I use a swf created by someone else I get a TypeError: Error #1034. So far, I have no idea why this happens. Maybe you can have a look at my code and give me a hint. Thanks in advance.
    var configfile = "test.xml";
    var xml_url:String = configfile;
    var urlLoader:URLLoader = new URLLoader();
    urlLoader.addEventListener(Event.COMPLETE, setClips);
    var xml:XML;
    var currentClip:int = 0;
    var clips:Array = new Array(); btnPrevious.addEventListener(MouseEvent.CLICK, previousClip);
    setChildIndex(btnPrevious,1);
    btnNext.addEventListener(MouseEvent.CLICK, nextClip);    
    setChildIndex(btnNext,1);
    function setClips(e:Event) {
        this.xml = new XML(e.target.data);
        this.playClip(this.currentClip);
    function playClip(index:Number) {              
        if (!this.clips[index]) {           
            var request:URLRequest = new URLRequest(this.xml.item[index]);           
            var loader:Loader = new Loader();
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.setMovieClip);    
            loader.load(request);
        else {
            this.currentClip = index;              
         this.clips[this.currentClip].play();    
            this.addChild(this.clips[this.currentClip]);
            setChildIndex(this.clips[this.currentClip],0);              
            this.clips[this.currentClip].addEventListener(Event.ENTER_FRAME, this.onEnterFrameCheck);
    function nextClip(e:MouseEvent) {
         this.clips[this.currentClip].gotoAndStop(0);
            this.removeChild(this.clips[this.currentClip]);
         this.currentClip = this.currentClip + 1;    
         if(this.currentClip == this.xml.item.length()) {
              this.currentClip = 0;
         this.playClip(this.currentClip);    
    function previousClip(e:MouseEvent) {
        this.clips[this.currentClip].gotoAndStop(0);
        this.removeChild(this.clips[this.currentClip]);
        this.currentClip = this.currentClip - 1;
        if(this.currentClip == -1) {
           this.currentClip = this.xml.item.length() - 1;    }         this.playClip(this.currentClip);    
    function setMovieClip(e:Event):void {    this.clips[this.currentClip] = MovieClip(e.target.loader.content);
        this.addChild(this.clips[this.currentClip]);
        setChildIndex(this.clips[this.currentClip],0);  
        this.clips[this.currentClip].addEventListener(Event.ENTER_FRAME, this.onEnterFrameCheck);
    function onEnterFrameCheck(e:Event):void {
        if(this.clips[this.currentClip] && this.clips[this.currentClip].currentFrame == this.clips[this.currentClip].totalFrames) {
            this.clips[this.currentClip].gotoAndStop(0);    
            this.clips[this.currentClip].removeEventListener(Event.ENTER_FRAME, this.onEnterFrameCheck);         
            this.removeChild(this.clips[this.currentClip]);    
            if(this.currentClip >= this.xml.item.length()-1) {
                 this.currentClip = -1;
         }                               this.currentClip++;              
            this.playClip(this.currentClip);
    urlLoader.load(new URLRequest(this.xml_url)); 
    stop();
    And here The XML:
    <banners>
    <item>banner1.swf</item>
    <item>banner2.swf</item>
    <item>banner3.swf</item>
    </banners>
    The full Error Message (In German:)
    TypeError: Error #1034: Typumwandlung fehlgeschlagen: flash.display::AVM1Movie@34d4df9 kann nicht in flash.display.MovieClip umgewandelt werden.
        at teaser_fla::MainTimeline/setMovieClip()

    The problem will be related to trying to manipulate an AS1/AS2 file using AS3... it cannot be done.  In this case, you are probably just seeing the first of a few errors where you try to manipulate an AS2 object by trying to cast it as an AS3 MovieClip object.  You would run into problems later when you try controlling/reading that same file (currentFrame is not an AS1/AS2 property, but you attempt to extract it).
    Per the Flash Help documentation...
    "ActionScript 3.0 code can load a SWF file written in ActionScript 1.0 or 2.0, but it cannot access the SWF file's variables and functions. "
    You can implement the LocalConnection class to overcome some of the issues, but if you are using other people's files, you are likely to hit a wall...
    "LocalConnection objects created in ActionScript 3.0 can communicate with LocalConnection objects created in ActionScript 1.0 or 2.0.
    The reverse is also true: LocalConnection objects created in ActionScript 1.0 or 2.0 can communicate with LocalConnection objects created in ActionScript 3.0. Flash Player handles this communication between LocalConnection objects of different versions automatically."

  • Another TypeError: Error #1009 Problem

    Hey all,   I've searched the 'net and searched these forums but can't seem to figure out what I'm doing wrong.  I'm creating a flash based game for school that so far has ten frames on the timeline.  I have buttons on frame one, frame 5, and frame 10. I have actionscript code to control those buttons on frame 1, frame 5, and frame 10 respectively.  The code is worded identically on each frame with the exception that I've changed the button names and the function names that are called when the mouse button is pressed.   The code works fine on frame 1 and on frame 5, but when I click the button on frame 5 that sends me to frame 10, I get this error immediately:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at keys2BibleTest_fla::MainTimeline/frame10()
        at flash.display::MovieClip/gotoAndStop()
        at keys2BibleTest_fla::MainTimeline/stormBtnHandler1()
    I have verified that each instance of the buttons do indeed have the name of the button being listened for in the event handlers. I can change the type from button to movieclip and it works fine.  I can also remove frames 1 through 9 and the code works.
    Here's the code:
    Frame 1:
    stop();
    enterBtn.addEventListener(MouseEvent.MOUSE_DOWN, enterBtnHandler1);
    function enterBtnHandler1(event:MouseEvent):void {
        gotoAndStop(5, "Scene 1");
    Frame 5:
    import flash.events.MouseEvent;
    stormBtn.addEventListener(MouseEvent.MOUSE_DOWN, stormBtnHandler1);
    function stormBtnHandler1(event:MouseEvent):void {
        gotoAndStop(10, "Scene 1");
    chickenOutBtn.addEventListener(MouseEvent.MOUSE_DOWN, chickenOutBtnHandler1);
    function chickenOutBtnHandler1(event:MouseEvent):void {
        gotoAndStop(1, "Scene 1");
    Frame 10:
    import flash.events.MouseEvent;
    creationBtn.addEventListener(MouseEvent.MOUSE_DOWN, creation);
    function creation(event:MouseEvent):void {
        gotoAndStop(3, "Scene 1");
    lifeBtn.addEventListener(MouseEvent.MOUSE_DOWN, lifeOfChrist);
    function lifeOfChrist(event:MouseEvent):void {
        navigateToURL(new URLRequest("http://www.ceoutreach.org"));
    I can't for the life of me figure out what's wrong.  Can anyone help?
    Thank you,
    Mike

    Ned,
    thank you for your reply. Unfortunately, my buttons are on separate layers and separated by blank keyframes to boot.  When I posted originally, the buttons were all on the same layer BUT separated by blank keyframes. After doing some research on the web, I moved the buttons to their own separate layers (one button per layer) and kept the blank keyframes as well.
    Currently, my only filled keyframes are one, five, and ten. All other keyframes are blank except for my labels and actionscript code. I'm using separate layers for labels and actions, too. I attempted to attach the file with my original post but received the message that .fla files are not allowed.  I don't know about your window, but mine says Max size 5.0 MB (my file is 2), All files types allowed except.... .fla is not one of those in the exception list so I expected it to go.
    It's got something to do with the two buttons on frame 10.... I just went into the actionscript and bypassed frame 5, going directly to frame 10 when the Enter button is depressed, and got the same error message.   There's something in the code I'm just not seeing.... when I comment out the code for the buttons, no error message.  Put the code back in, error message comes back.  Delete the buttons and the code and insert new ones, the error message comes back.
    It's got me totally stumped.
    Thank you for trying,
    Mike
    Edit: I forgot to mention, frame ten is the only place on the timeline where instances of these particular buttons are being used. The other frames are populated with different buttons.  Also, when I change the type to movieclip, everything works.  Weird, huh?

  • Error Message with Form Sending

    Hi there,
    My form is working fine and the PHP is fully functional,
    however I get this error message once the form has been submitted.
    Error: Error #2101: The String passed to
    URLVariables.decode() must be a URL-encoded query string containing
    name/value pairs.
    at Error$/throwError()
    at flash.net::URLVariables/decode()
    at flash.net::URLVariables$iinit()
    at
    flash.net::URLLoader/flash.net:URLLoader::onComplete()
    Does anyone know what this means?
    Here is my function that sends the message
    function sendMessage(event:MouseEvent):void
    var contactVariables:URLVariables = new URLVariables();
    contactVariables.custName = textName.text;
    contactVariables.custEmail = textEmail.text;
    contactVariables.custPhone = textPhone.text;
    contactVariables.custSubject = textSubject.text;
    contactVariables.custMessage = textMessage.text;
    var postMessage:URLRequest = new
    URLRequest("mailContact.php");
    postMessage.data = contactVariables;
    postMessage.method = URLRequestMethod.POST;
    var loader:URLLoader = new URLLoader();
    loader.dataFormat = URLLoaderDataFormat.VARIABLES;
    loader.load(postMessage);
    gotoAndStop(2);
    As mentioned before, my form does work fine. Anyone know what
    the problem could be??
    Thanks
    CM

    Ok ive figured out that Flash does not like the '&' sign
    when data is sent back to it as a string. The thing that I dont get
    is that my PHP script does NOT send the data back to flash. Why oh
    why is this message being displayed?
    Also ive discovered that on some machines it does not display
    the error at all. I just don't get it. Anyone had this problem
    before?
    Thanks
    CM

  • Voting poll using PHP & MySQL TypeError: Error #2007: Parameter text must be non-null.

    I am getting this back:
    TypeError: Error #2007: Parameter text must be non-null.
    at flash.text::TextField/set text()
    at AS3_Flash_Poll_PHP_MySQL_fla::WholePoll_1/completeHandler()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    PHP code:
    <?php
    // ---------------------------------------- Section 1 -----------------------------------------------
    //  IMPORTANT!!!! Connect to MySQL database here(put your connection data here)
    mysql_connect("ginaty05.fatcowmysql.com","fall2010","@regina") or die (mysql_error());
    mysql_select_db("poll_2010") or die (mysql_error());
    // When Flash requests the totals initially we run this code
    if ($_POST['myRequest'] == "load_numbers") {
    // Query the totals from the database
        $sql1 = mysql_query("SELECT id FROM votingPoll WHERE choice='1'");
        $choice1Count = mysql_num_rows($sql1);
        $sql2 = mysql_query("SELECT id FROM votingPoll WHERE choice='2'");
        $choice2Count = mysql_num_rows($sql2);
        $sql3 = mysql_query("SELECT id FROM votingPoll WHERE choice='3'");
        $choice3Count = mysql_num_rows($sql3);
        echo "choice1Count=$choice1Count";
        echo "&choice2Count=$choice2Count";
        echo "&choice3Count=$choice3Count";
    // ---------------------------------------- Section 2 -----------------------------------------------
    // IF POSTING A USER'S CHOICE
    if ($_POST['myRequest'] == "store_choice") {
        //Obtain user IP address
        $ip = $_SERVER['REMOTE_ADDR'];
        // Create local variable from the Flash ActionScript posted variable
        $userChoice = $_POST['userChoice'];
        $sql = mysql_query("SELECT id FROM votingPoll WHERE ipaddress='$ip'");
        $rowCount = mysql_num_rows($sql);
        if ($rowCount == 1) {
    $my_msg = "You have already voted in this poll.";
    print "return_msg=$my_msg";
        } else {
    $sql_insert = mysql_query("INSERT INTO votingPoll (choice, ipaddress) VALUES('$userChoice','$ip')")  or die (mysql_error());
    $sql1 = mysql_query("SELECT * FROM votingPoll WHERE choice='1'");
    $choice1Count = mysql_num_rows($sql1);
    $sql2 = mysql_query("SELECT * FROM votingPoll WHERE choice='2'");
    $choice2Count = mysql_num_rows($sql2);
    $sql3 = mysql_query("SELECT * FROM votingPoll WHERE choice='3'");
    $choice3Count = mysql_num_rows($sql3);
    $my_msg = "Thanks for voting!";
            echo "return_msg=$my_msg";
            echo "&choice1Count=$choice1Count";
    echo "&choice2Count=$choice2Count";
    echo "&choice3Count=$choice3Count";
    ?>
    AS3 code:
    stop(); // Stop the timeline since it does not need to travel for this to run
    // Assign a variable name for our URLVariables object
    var variables1:URLVariables = new URLVariables();
    //  Build the varSend variable
    var varSend1:URLRequest = new URLRequest("parse_my_poll.php");
    varSend1.method = URLRequestMethod.POST;
    varSend1.data = variables1;
    // Build the varLoader variable
    var varLoader1:URLLoader = new URLLoader;
    varLoader1.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader1.addEventListener(Event.COMPLETE, completeHandler1);
    // Set variable to send to PHP here for the varloader below
    variables1.myRequest = "load_numbers";  
    // Send data to php file now, and wait for response using the COMPLETE event
    varLoader1.load(varSend1);
    function completeHandler1(event:Event):void{
        count1_txt.text = "" + event.target.data.choice1Count;
        count2_txt.text = "" + event.target.data.choice2Count;
        count3_txt.text = "" + event.target.data.choice3Count;
    // hide the little processing movieclip
    processing_mc.visible = false;
    // Initialize the choiceNum variable that we will use below
    var choiceNum:Number = 0;
    // Set text formatting colors for errors and success messages
    var errorsFormat:TextFormat = new TextFormat();
    errorsFormat.color = 0xFF0000; // bright red
    var successFormat:TextFormat = new TextFormat();
    successFormat.color = 0x00FF00; // bright green
    // Button Click Functions
    function btn1Click(event:MouseEvent):void{
        choiceNum = 1;
        choice_txt.text = choice1_txt.text;
    function btn2Click(event:MouseEvent):void{
        choiceNum = 2;
        choice_txt.text = choice2_txt.text;
    function btn3Click(event:MouseEvent):void{
        choiceNum = 3;
        choice_txt.text = choice3_txt.text;
    // Button Click Listeners
    btn1.addEventListener(MouseEvent.CLICK, btn1Click);
    btn2.addEventListener(MouseEvent.CLICK, btn2Click);
    btn3.addEventListener(MouseEvent.CLICK, btn3Click);
    // Assign a variable name for our URLVariables object
    var variables:URLVariables = new URLVariables();
    //  Build the varSend variable
    var varSend:URLRequest = new URLRequest("parse_my_poll.php");
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
    // Build the varLoader variable
    var varLoader:URLLoader = new URLLoader;
    varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader.addEventListener(Event.COMPLETE, completeHandler);
    // Handler for PHP script completion and return
    function completeHandler(event:Event):void{
        // remove processing movieclip
        processing_mc.visible = false;
        // Clear the form fields
        choice_txt.text = "";
        choiceNum = 0;
        // Load the response from the PHP file
        status_txt.text = event.target.data.return_msg;
        status_txt.setTextFormat(errorsFormat);
        if (event.target.data.return_msg == "Thanks for voting!") {
            // Reload new values into the count texts only if we get a proper response and new values
            status_txt.setTextFormat(successFormat);
            count1_txt.text = "" + event.target.data.choice1Count;
            count2_txt.text = "" + event.target.data.choice2Count;
            count3_txt.text = "" + event.target.data.choice3Count;
    // Add an event listener for the submit button and what function to run
    vote_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);
    // Validate form fields and send the variables when submit button is clicked
    function ValidateAndSend(event:MouseEvent):void {
        //validate form fields
        if(!choice_txt.length) {  
            // if they forgot to choose before pressing the vote button
            status_txt.text = "Please choose before you press vote.";  
            status_txt.setTextFormat(errorsFormat);
        } else {
            status_txt.text = "Sending...";
            processing_mc.visible = true;
            // Ready the variables for sending
            variables.userChoice = choiceNum;
            variables.myRequest = "store_choice";  
            // Send the data to the php file
            varLoader.load(varSend);
        } // close else after form validation
    } // Close ValidateAndSend function ////////////////////////

    This error means that you are trying to set the text field but there is no data in the variable. As a first step, try to identify where this is happening, eg Is it the first call, or once you have submitted your data or only if you try to submit data second time?
    Trace out the data that is returned for both completeHandlers to see if there is a missing var. Try this for "load_numbers" and "store_choice". Do it twice for "store_choice". Do you get back what you expected?
    You could also try altering the php to return some fixed dummy variables, eg  choice1Count=11&choice2Count=22&choice3Count=33, etc. If this works then you know that the error is in the PHP.
    It looks to me like the issue is when you submit the data a second time and just get back the return_msg - the handler then tries to assign the choice1Count etc but doesn't have any count data back from the poll.php.
    Test that there is data before assigning it, eg
        if(event.target.data.choice1Count){
            count1_txt.text =  event.target.data.choice1Count;
            count2_txt.text =  event.target.data.choice2Count;
            count3_txt.text =  event.target.data.choice3Count;

  • ActionScript 3 + PHP: TypeError: Error #2007: Parameter text must be non-null.

    Hi - Still new to flash as3 and php -
    it is a contact form page - user puts in information - i am to receive it in an email address their information
    as well the variables get sent back from the php to the .swf file.
    I am receiving these errors and not knowing how to fix them.
    any help would be much appreciated. thank you in advance really.
    below are the errors in flash - as3 code - and php code setup.
    errors:
    ActionScript 3 + PHP: TypeError: Error #2007: Parameter text must be non-null:
      at flash.text::TextField/set text()
              at kwangjaekim_fla::wholeform_16/completeHandler()
              at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at flash.net::URLLoader/flash.net:URLLoader::onComplete()
    my as3 code is the following:
    // build variable name for the URL Variables loader
    var variables:URLVariables = new URLVariables();
    //Build the varSend variable
    var varSend:URLRequest = new URLRequest("contact_parse.php");
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
    //Build the varLoader variable
    var varLoader:URLLoader = new URLLoader;
    varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader.addEventListener(Event.COMPLETE, completeHandler);
    //handler for the PHP  script completion and return of status
    function completeHandler(event:Event):void{
              //value is cleared at ""
              name_txt.text = "";
              contact_txt.text = "";
              msg_txt.text = "";
              //Load the response PHP here
              status_txt.text = event.target.data.return_msg;
    //Add event listener for submit button click
    submit_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);
    //function ValidateAndSend
    function ValidateAndSend(event:MouseEvent):void{
              //validate fields
              if(!name_txt.length){
                        status_txt.text = "Please Enter Your Name";
              }else if(!contact_txt.length){
                        status_txt.text = "Please Enter Your Contact Detail";
              }else if(!msg_txt.length){
                        status_txt.text = "Please Enter Your Message";
              }else {
              // ready the variables in form for sending
      variables.userName = name_txt.text;
              variables.userContact = contact_txt.text;
              variables.userMsg = msg_txt.text;
              // Send the data to PHP now
    varLoader.load(varSend);
    submit_btn.addEventListener(MouseEvent.CLICK, function(){MovieClip(parent).gotoAndPlay(151)});
              } // Close else condition for error handling
    } // Close validate and send function
    my php code is the following:
    <?php
    // Create local PHP variables from the info the user gave in the Flash form
    $senderName   = $_POST['userName'];
    $senderEmail     = $_POST['userContact'];
    $senderMessage = $_POST['userMsg'];
    // Strip slashes on the Local variables
    $senderName   = stripslashes($senderName);
    $senderContact     = stripslashes($senderContact);
    $senderMessage   = stripslashes($senderMessage);
    //!!!!!!!!!!!!!!!!!!!!!!!!!     change this to my email address     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                              $to = "put iny me email address";
         // Place sender Email address here
        $from = "$senderContact ";
        $subject = "Contact from your site";
        //Begin HTML Email Message
        $message = <<<EOF
    <html>
      <body bgcolor="#FFFFFF">
    <b>Name</b> = $senderName<br /><br />
    <b>Contact</b> = <a href="mailto:$senderContact">$senderEmail</a><br /><br />
    <b>Message</b> = $senderMessage<br />
      </body>
    </html>
    EOF;
       //end of message
        $headers  = "From: $from\r\n";
        $headers .= "Content-type: text/html\r\n";
        $to = "$to";
        mail($to, $subject, $message, $headers);
    exit();
    ?>
    thank you once again
    jay

    thank you Ned -
    i put in the trace line as you mentioned -
    and this is what i received -
    returns: undefined
    TypeError: Error #2007: Parameter text must be non-null
              at flash.text::TextField/set text()
              at kwangjaekim_fla::wholeform_16/completeHandler()
              at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at flash.net::URLLoader/flash.net:URLLoader::onComplete()
    what does this mean exactly?
    thank you for the help really

  • TypeError: Error #2007: Parameter text must be non-null

    I am new to AS period, but I am following some training videos for AS 3.0 to create a portfolio site where the images and text are loaded by xml.
    I have followed the instructions to the letter; however I am getting the #2007 Parameter text must be not-null error.
    I have pasted my code below:
    var titleArray:Array = new Array();
    var descriptionArray:Array = new Array();
    var largeImageArray:Array = new Array();
    var thumbnailImageArray:Array = new Array();
    var imageNum:Number=0;
    var totalImages:Number;
    //XML
    //load in XML
    var XMLURLLoader:URLLoader = new URLLoader();
    XMLURLLoader.load(new URLRequest("assets/portfolio/portfolio.xml"));
    XMLURLLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(event:Event):void {
    var theXMLData:XML=new XML(XMLURLLoader.data);
    totalImages=theXMLData.title.length();
    for (var i:Number = 0; i < totalImages; i++) {
    titleArray.push(theXMLData.title[i]);
    descriptionArray.push(theXMLData.description[i]);
    largeImageArray.push(theXMLData.largeImage[i]);
    thumbnailImageArray.push(theXMLData.thumbImage[i]);
    loadThumbnail();
    myScrollPane.source=allThumbnails;
    //LOAD THE THUMBNAILS
    function loadThumbnail():void {
    trace(imageNum);
    var thumbLoader:Loader = new Loader();
    thumbLoader.load(new URLRequest(thumbnailImageArray[imageNum]));
    thumbLoader.x = 90*imageNum;
    //stores the appropriate info for thumbnail
    var thisLargeImage:String = largeImageArray[imageNum];
    var thisTitle:String = titleArray[imageNum];
    var thisDescription:String = descriptionArray[imageNum];
    thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);
    function thumbLoaded(event:Event):void {
    //add the thumbnails to the allThumbnails instance
    allThumbnails.addChild(thumbLoader);
    allThumbnails.buttonMode = true;
    myScrollPane.update();
    thumbLoader.addEventListener(MouseEvent.CLICK, loadMainImage1);
    function loadMainImage1(event:MouseEvent):void {
    largeUILoader.source=thisLargeImage;
    selectedTitle.text=thisTitle;
    selectedDesc.text=thisDescription;
    //add to imageNum (1);
    imageNum++;
    if (imageNum<totalImages) {
    loadThumbnail();
    I know my error has something to do with this part of the code:
    //stores the appropriate info for thumbnail
    var thisLargeImage:String = largeImageArray[imageNum];
    var thisTitle:String = titleArray[imageNum];
    var thisDescription:String = descriptionArray[imageNum];
    but I can't figure out what's wrong. When I test my movie, everything functions correctly except when I click on a different thumbnail, the proper description does not load. My xml file is set up correctly. Here is a bit of that code:
    <?xml version="1.0" encoding="UTF-8"?>
    <portfolio>
    <!--Image 1-->
    <title>Spark Your Imagination Ad</title>
    <![CDATA[<description>These black & white ads were designed to run in the trade publication The Green Sheet in the Merchant Acquiring Industry</description>]]>
    <largeImage>assets/portfolio/lg/1.jpg</largeImage>
    <thumbImage>assets/portfolio/thumbs/1.jpg</thumbImage>
    <!--Image 2-->
    <title>Corporate Business Card - iMax Bancard</title>
    <![CDATA[<description>This full color double-sided business card is the current standard card being used by employees and agents of iMax Bancard</description>]]>
    <largeImage>assets/portfolio/lg/2.jpg</largeImage>
    <thumbImage>assets/portfolio/thumbs/2.jpg</thumbImage>
    </portfolio>
    The only thing different with my xml code is that in the tutorial I am following, the <description></description> tags are on the outside of the CDATA tags (which I have seen examples of both)... but when I put the code that way, it causes breaks in my code at the first special character I use.
    Any help is appreciated. Thanks, Jen

    click file/publish settings/flash and tick "permit debugging".  retest.  the line number with the non-existant object will be in the error message.

  • Error when retrieving data from remote url

    Hello,
    I'm trying to do something that should be very simple --
    letting a user enter something in a textbox, then using that data
    as a script parameter when calling a remote cgi script, and
    returning the results to the screen.
    The remote cgi is sending data in plain text. I have looked
    at several examples, and I've tried using an XMLHttpRequest, I've
    tried using the servicemonitor.swf methods, and I've tried with
    URLRequest and URLLoader methods. All fail in one way or another.
    Here's the code for the URLRequest/URLLoader method...
    function fetchISSN(myform) {
    air.trace("Starting Fetch");
    var mytitle = myform.title.value;
    air.trace("TITLE: " + mytitle);
    var reqURL = "
    http://grlinker.coalliance.org/grbin/ilu_rmt.cgi";
    air.trace("URL: " + reqURL);
    var variables = new air.URLVariables("title=" + mytitle +
    "&isf=plain");
    air.trace("URLPARMS: " + variables);
    // var element = document.getElementById('results');
    var request = new air.URLRequest(reqURL);
    air.trace("Request Object Created");
    request.data = variables;
    air.trace("Data Added to request");
    request.method = air.URLRequestMethod.POST;
    var loader = new air.URLLoader();
    air.trace("Loader Object Created");
    loader.addEventListener(air.Event.COMPLETE, loadComplete);
    loader.addEventListener(air.Event.OPEN, loadOpen);
    try {
    loader.load(request);
    } catch(e) {
    alert('Could NOT load data: ' + e);
    } // end of function fetchISSN
    function loadComplete(event) {
    // alert('Downloaded ' + loader.bytesTotal);
    alert('Complete');
    // element.innerText = loader.data;
    } // end of function loadComplete()
    function loadOpen(event) {
    alert('Downloading');
    } // end of function loadComplete()
    And the HTML that calls it...
    <table width="280" border="1" align="center">
    <tr><td align="center">
    <font size="2">Enter a title and click
    submit.</font>
    <form name="issn">
    <input type="text" name="title" /><br>
    <input type="submit" name="submit" value="Submit"
    onClick="javascript:fetchISSN(this.form)" />
    </form>
    </td></tr>
    </table>
    Things go fine until it hits the loadComplete function. At
    that point, the following error is generated...
    Error: The application attempted to reference a JavaScript
    object in an HTML page that is no longer loaded.
    at __HTMLScriptFunction/throwJSObjectDead()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    Can anyone give me any advice or even a reason for this
    failure. I did find a bug about this in the bugtracker, it says it
    is resolved with an "external" resolution. I'm not sure what that
    means. Is there a patch I'm missing? Am I doing something really
    stupid?
    Just for reference, I'm on a Mac running OS X 10.5.6, using
    the SDK for development.
    Thanks!
    Scott

    Hi,
    Can you try putting the declaration of the URLLoader instance
    outside your fetchISSN function and see?
    That is:
    var loader;
    function fetchISSN(myform) {
    //your code above this line
    loader = new URLLoader();
    //rest of your code

  • Error message while executing a SWF File

    Hi All,
    Iam trying to execute a SWF file which has its actionscript
    written in AS3. When i execute this, I am getting an error message
    which is as follows
    Verify Error 1030# Stack Depth unbalanced 1 != 0.
    Can anyone tell me what could be the root cause?
    Thanks in advance,
    Prabakaran Srinivasan.

    Hi All,
    I am able to find the root cause for this. For AS 3 classes,
    while parsing the ABC code, every method body will be a set of
    instructions in which each instruction will have an offset to it.
    This offset will be useful to mark the target for branching
    instructions like if, while etc.... Because, these instructions
    contains targetoffset as a parameter to which the instruction has
    to jump when the condition becomes true or false. The process what
    i am doing is i do some code injection to replace the URLRequest
    calls. The flash file in which i got this error, i did replace the
    URLRequest call to my own method call and this code was being
    wrapped up by an IF block. Because of the code injection, i need to
    update the offset of the instructions with the difference offset
    value. I did this, but i missed the jumpoffset parameter of the if
    block wrapping my injected code which was the root cause. I did fix
    this...
    Thanks,
    Prabakaran Srinivasan.

  • Error #1010 While trying to link a button to a PDF

    Hi all, I am completely new to AS3 and Flash in general, but because of a project here at work I decided to venture in creating a site. I imported a Photoshop file into the stage and created buttons from some headings. I need to link the headings to PDF files when they are clicked, but when I wrote the code (actually in various different formats) I keep getting the following error (while permitting to debug):
    TypeError: Error #1010: A term is undefined and has no properties.
        at extras3_fla::MainTimeline/frame1()[extras3_fla.MainTimeline::frame1:9]
    My simple code is
    var pdfURL:URLRequest = new URLRequest("images\Other\LetterHansen.pdf");
    //PDF Link
    function pdfLink(event:MouseEvent):void {
        navigateToURL(pdfURL,"_blank");
    Text.daniels_btn.addEventListener(MouseEvent.CLICK, pdfLink);
    Any suggestions? I'm sure it's something simply, but I figured I'd ask for help instead of banging my head against the wall
    Thanks!

    Whichever line is line 9 of your code has a problem.  If it is the last line, chances are you have not named your daniels_btn inside the Text object, or it is not named in the first frame within Text.

  • Error #2007

    These are the code for the php and flash page:
    <?
    // Create local variables from the Flash ActionScript posted variables
    $senderName   = $_POST['userName'];
    $senderEmail     = $_POST['userEmail'];
    $senderMessage = $_POST['userMsg'];
    // Strip slashes on the Local variables for security
    $senderName   = stripslashes($senderName);
    $senderEmail     = stripslashes($senderEmail);
    $senderMessage   = stripslashes($senderMessage);
    // IMPORTANT - Change these lines to be appropriate for your needs - IMPORTANT
    $to = "[email protected]";            
    $from = "$senderEmail";
    $subject = "Contact from gharweg.org.uk";
    // Modify the Body of the message however you like
    $message = "Message from Gharweg.org.uk:
    Their Name:   $senderName
    Their Email:   $senderEmail
    Their Message is below:
    $senderMessage";
    // Build $headers Variable
    $headers = "From: $from\r\n";
    $headers .= "Content-type: text\r\n";
    $to = "$to";
        // Send the email
        mail($to, $subject, $message, $headers);
        // Assemble the message that goes back to Flash
        // The flash ActionScript is looking for a return variable of "return_msg"
        $my_msg = "Thanks $senderName, your message has been sent.";
        // Print the data back to flash who is patiently waiting for it in the onCompleteHandler
        print "return_msg=$my_msg";
    // Exit script   
    exit();
    ?>
    // Set text formatting colors for errors, waiting..., and success mechanisms
    var errorsFormat:TextFormat = new TextFormat();
    errorsFormat.color = 0xFF0000;
    var waitingFormat:TextFormat = new TextFormat();
    waitingFormat.color = 0x001111;
    var successFormat:TextFormat = new TextFormat();
    successFormat.color = 0x3366FF;
    // hide the little processing movieclip
    processing_mc.visible = false;
    // Assign a variable name for our URLVariables object
    var variables:URLVariables = new URLVariables();
    //  Build the varSend variable
    var varSend:URLRequest = new URLRequest("new/contact_parse.php");
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
    // Build the varLoader variable
    var varLoader:URLLoader = new URLLoader;
    varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader.addEventListener(Event.COMPLETE, completeHandler);
    // Handler for PHP script completion and return
    function completeHandler(event:Event):void{
        // remove processing movieclip
        processing_mc.visible = false;
        // Clear the form fields
        name_txt.text = ".";
        email_txt.text = ".";
        msg_txt.text = "-";
        // Load the response from the PHP file
        status_txt.text = event.target.data.return_msg;
        status_txt.setTextFormat(successFormat);
    // Add an event listener for the submit button and what function to run
    submit_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);
    // Validate form fields and send the variables when submit button is clicked
    function ValidateAndSend(event:MouseEvent):void{
        //validate form fields
        if(!name_txt.length) {   
            status_txt.text = "Please enter your name.";   
            status_txt.setTextFormat(errorsFormat);
        } else if(!email_txt.length) {
            status_txt.text = "Please enter an email address";
            status_txt.setTextFormat(errorsFormat);
        } else if(!validateEmail(email_txt.text)) {
            status_txt.text = "Please enter a VALID email address";
            status_txt.setTextFormat(errorsFormat);
        } else if(!msg_txt.length) {
            status_txt.text = "Please enter a message.";
            status_txt.setTextFormat(errorsFormat);
        } else {
            // All is good so send the message to the parse file
            // Show the little "processing_mc" movieclip
            processing_mc.visible = true;
            // Ready the variables for sending
              variables.userName = name_txt.text;
               variables.userEmail = email_txt.text;
               variables.userMsg = msg_txt.text;  
            // Send the data to the php file
               varLoader.load(varSend);
            // Put a temporary message in the response field while the PHP file sends back
            // If the code does not connect to the PHP file this message will remain visible to user
            status_txt.text = "Waiting for server connection...";
            status_txt.setTextFormat(waitingFormat);
        } // close else after form validation
    } // Close ValidateAndSend function //////////////////////////////////////////////////////////////
    // Validate email function
    function validateEmail(str:String):Boolean {
        var pattern:RegExp = /(\w|[_.\-])+@((\w|-)+\.)+\w{2,4}+/;
        var result:Object = pattern.exec(str);
        if(result == null) {
            return false;
        return true;

    When you get error messages and post about them, you should include the entire error message in your posting.  In my case I have no idea what a 2007 error involves.  Also, to get the most info into your error messages you should enable the option to Permit Debugging found in the Flash section of the file's Publish Settings.  Selecting that option can often add more details into the error message.

Maybe you are looking for

  • In MD05 system show message "The MRP element no longer exist".

    Hi Guru, Need some help . In MD04 transaction contain Purchase order, when I double click purchase order,It will get open .  But when I open same purchase order in MD05 system show message u201CThe MRP element no longer exist". Please help me , if an

  • Adobe Reader won't work on My mac

    Hi, I've installed Adobe Reader but when I try to open a file online, it sends me straight back to the downloader page. I tried to re-install it but it tells me it's already installed and it is. I've tried to work with the plug-in's and selected "alw

  • Not seeing iPhotos 'photos' in Photo Library on iPhone.

    I have some photos in the Photos, Events folders in iPhoto. However, they are not in the Photo Library on iPhone. They are in the Photo Stream folder on iPhone.  I am confused they are not showing up in the iPhone Photo library when they are in iPhot

  • Making Chess puzzle in Flash

    Hi guys! I'm pretty new to Flash, but I love chess and would like to make chess puzzles in Flash to get more familiar with the program. I've looked in my CS3 book and browsed google for tutorials, but didn't find any on chess. Then I figured that may

  • After updating my 5S phone to 8.0.2 twitter app won't work

    updated OS on my iPhone 5S to 8.0.2 and the twitter app won't work anymore. Tried deleting and re-installing and it still won't work - any ideas?