2 Replies Latest reply on May 28, 2008 10:11 PM by sakura102384

    Appending label tag in URL

    sakura102384 Level 1
      Hi guys,

      I just want to ask what's the correct way to append a label tag on my URL, I was able to do it in URLRequest but when i tried to do it in another way it doesn't seem to work, I only get gray background instead seeing my application. Here's my code:

      Note: This is the code that I used to do before and it works

      public function Getrnum(event:MouseEvent):void {
      var u:URLRequest = new URLRequest(" http://dev.mashuparts.com/beta/1.1/mashups/play/play_mashup.php?rid=" + rnum.text + "&a=1");
      navigateToURL(u,"_self");
      }


      Note: this is the code that didn't work

      public var uploadDestination:String = " http://dev.mashuparts.com/beta/1.3/inc/ui/apps_bguploader.php?rid="rid.text;


      Any response would be very much appreciated. Thanks in advance.


        • 1. Re: Appending label tag in URL
          Gregory Lafrance Level 6
          These are different urls. Maybe something else is wrong? Can you create a complete yet simple example.
          • 2. Re: Appending label tag in URL
            sakura102384 Level 1
            the first block of script i've written was a function of a button that links to another page that has the right session id appended on it. Here's the example:

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
            creationComplete="feedRequest.send();">

            <mx:HTTPService id="feedRequest" url=" http://mydomain/xml_WebService.php" useProxy="false"/>

            <mx:Script>
            <![CDATA[

            import flash.net.*;

            public function Getrnum(event:MouseEvent):void {
            var u:URLRequest = new URLRequest(" http://dev.mashuparts.com/beta/1.1/mashups/play/play_mashup.php?rid=" + rnum.text + "&a=1");
            navigateToURL(u,"_self");
            }
            </mx:Script>
            <mx:Label id="rnum" text="{feedRequest.lastResult.subscribers.sessionid}" x="-57" y="-57" visible="false"/>

            <mx:LinkButton y="11" x="37" click="Getrnum(event)" icon="@Embed('bttn/playagain.png')" downIcon="@Embed('bttn/playagain_o.png')" overIcon="@Embed('bttn/playagain_o.png')"/>

            </mx:Application>

            ===================================================

            The second script was used in a flex uploader, it was a bit harder to provide an example for that coz it was just an open source, but all it was doing is it is the filepath of my php file that I'm using to upload files. But i'll provide you some block of codes i hope it can help a bit. This is from an AS file of uploader.

            // Modify this variable to match the URL of your site
            public var uploadDestination:String = " http://dev.mashuparts.com/beta/1.3/inc/ui/apps_bguploader.php?rid="rid.text;

            public function initApp():void{

            var postVariables:URLVariables = new URLVariables;
            postVariables.projectID = 55;
            postVariables.test ="Hello World";

            multiFileUpload = new MultiFileUpload(
            filesDG,
            browseBTN,
            clearButton,
            delButton,
            upload_btn,
            progressbar, " http://dev.mashuparts.com/beta/1.3/inc/ui/apps_bguploader.php",
            postVariables,
            350000,
            filesToFilter


            );
            multiFileUpload.addEventListener(Event.COMPLETE,uploadsfinished);

            }

            Note that the rid.text appended on it was also my session id i get using HttpService. Im trying to append it in my uploadDestination path so that i can pass the correct session id to my php file.

            Many thanks!!!