A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Wierd navigateToURL behaviour

  1. #1
    Junior Member
    Join Date
    Sep 2012
    Posts
    26

    Wierd navigateToURL behaviour

    I have a custom class that post result from a Flash file to my website the in turns posts the data to a database. I create the string to post data to the website, I then use php to do the actual posting of the data. The problem I am having is the URL I pass to navigateToUrl does not take me to correct URL. The page displayed is the same page the Flash file is displayed on. However when I test to Flash program from the Flash IDE is goes to the right URL. I have a trace statement right before the navigateToUrl command, and It shows me the correct address but the address in the address bar of the browser is completely different.

    The code for creating the url is below:
    Code:
    		public function submitScore(sid:int, rid:int, lid:int, cscore:int, pScore:int):void {
    			var postScore:URLRequest;
    			var postAddress:String
    			var postData:String = sid + "/" + rid + "/" + lid + "/" + cscore;
    			if (pScore == 0) {			
    				postAddress = configFile[WEBSITE] + configFile[SUBMIT] + postData;
    			} else {
    				postAddress = configFile[WEBSITE] + configFile[UPDATE] + postData;
    			}
    			trace("Post Address: " + postAddress);
    			postScore = new URLRequest(postAddress);
    			navigateToURL(postScore);
    		}
    The value for configFile[WEBSITE] and configFile[UPDATE] are read form a config file and have the values of hrrp://mrsmarker.com and scores/update respectfully.
    The value of postScore is http://mrsmarker.com/scores/update/1/4/1/20 (the numbers vary, and are not important at this time.)
    The URL in the address line of the browser is: http://mrsmarker.com/students/viewTest/1/%3C!DOCTYPE%20HTML%3E/%3Chead%3E/1/4/1/20.
    It appears the some html is injected into the postScore value, but I am not sure where it is coming from. Thanks for help, Troy.

  2. #2
    Junior Member
    Join Date
    Sep 2012
    Posts
    26
    Progress Update:

    Well not preogress really, it still does not. I have been search different forums, and it seems I have a particully stubborn bug here. I just tried move the Submission class to the defualt package, where I thought it worked prior, still no luck. I am confuses why it does work when I test the program from within the Flash IDE, but it does not work when I wmbed it into my webpage. I have checked all the variables concerned(I think). I think I will try something else. At the moment the responding web page open in a new tab in IE, I will try to have it open in the tab that calls the Flash file. I probably will not work, but you never know. Troy

  3. #3
    Junior Member
    Join Date
    Sep 2012
    Posts
    26
    Quote Originally Posted by tlmarker View Post
    It probably will not work, but you never know.
    Now I know, it did not work. Still confused over why this is happening. On the bright side, it know respondes to he same window, so it was not a complete failure. Troy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center