On 6/15/15, 3:00 PM, "Michael Schmalle" <teotigraphix...@gmail.com> wrote:

>Hmm, Can you post an example of what that looks like when your try it?
>
>I have a few thoughts but I want to see what you write before I say
>anything.

Below is the way HTTPService is looking right now (with lots removed).
The header, package, static consts, and most of the getter setters are
exactly the same in AS (the JS private var convention seems to have “_” as
a suffix not prefix).  Even the import list is mostly the same.

What HTTPService extends is different and the guts of the send() method is
different.  I don’t recall if you can conditionally compile what you
extend, but I’m pretty sure we can conditionally compile the code in
send() and I think the code in the constructor that creates an
XMLHTTPRequest.

So it isn’t clear that you’d want to have two HTTPService.as files in
different folders in a project.  Having one with conditional compilation
might be better.

-Alex

---

///////////////////////////////////////////////////////////////////////////
/////
//
//  Licensed to the Apache Software Foundation (ASF) under one or more...
//
///////////////////////////////////////////////////////////////////////////
/////
package org.apache.flex.net
{
        
        import org.apache.flex.core.IBead;
        import org.apache.flex.core.IStrand;
        import org.apache.flex.events.Event;
        import org.apache.flex.events.EventDispatcher;
        
    /**
     *  The HTTPService class is a class designed to transfer text...
*/
        public class HTTPService extends HTMLElementWrapper implements IStrand,
IBead
        {
        /**
*...
*/
                public static const HTTP_METHOD_GET:String = 
URLRequestMethod.GET;
        
/**
*...
*/
        public static const EVENT_COMPLETE:String = "complete";
        

/**
         *  Constructor...
*/
                public function HTTPService()
                {
                        super();
            element = new XMLHTTPRequest();
                }
                

                private var contentType_:String = 
"application/x-www-form-urlencoded";
        
        /**
*...
*/
                public function get contentType():String
                {
                        return contentType_;
                }

        /**
         *  @private
         */
        public function set contentType(value:String):void
                {
  if (contentType_ != value)
  {
    contentType_ = value;
    dispatchEvent(new Event("contentTypeChanged"));
  }
                }
                


/**
         *  Sends the headers and contentData to the server...
*/
        public function send():void
        {
  // XMLHTTPRequest calls
}

Reply via email to