Showing posts with label flex. Show all posts
Showing posts with label flex. Show all posts

Monday, 18 October 2010

Error #1069 using namespaced members

Error:
ReferenceError: Error #1069: Property myNamespacedProperty not found on a.b.c.MyClass and there is no default value.
Seen when attempting to access a member (property/method/accessor) of a class that uses a custom namespace, e.g:
messaging_internals function getMillisecondsSinceSent():uint {
    return getTimer() - _lastSentTime;
  }
Obviously here "messaging_internals" is the namespace.

Answer:
Check that both declaration and use are using exactly the same definition of the namespace.  For example, check that you don't have a duplicate definition!

We saw this problem when project A had namespace An on methods in class Ac.  Used by project B in class Bc.  All looked fine, compiled fine but unit testing saw Error #1069.  Eventually realised that a bad refactoring had left a second copy of the namespace An in project B (where it had orignally been), leaving An obscured by the identically named Bn.  Bc was using Bn which failed to resolve to An hence members in Ac were unreachable!
 (Yes, I can add a diagram if anyone wants.)

Obviously ideally the tooling should highlight this.
HTH!

Sunday, 17 October 2010

FlexUnit from both FlashBuilder and FlexMojos for library projects

FlashBuilder leaves its FlexUnitTestRunnerUI files in "src".
For packaging:swf FlexMojos projects, that's fine (*1), it builds them.
*1: OK, it may not be all that fine but it doesn't cause failure.
For packaging:swc FlexMojos projects, they fail with "Type was not found" etc errors! How to fix, after the break...

Sunday, 10 October 2010

How to fix Flash Builder debugging after breakage by installing Flash Professional

Short version:
Flash Professional messed up Flash Builder's debugging capability.  On Windows, one can replace references to the FP runtime from 'Professional with that to a FlashPlayerDebugger.exe and all will be well.

Wednesday, 9 December 2009

day off 9'th, BlazeDS, day off 11'th, networking 12'th

Day off 2009/12/09.

In the evening, ...

JSON decoding caught me out by turning a property "feeds.list" into a member "feeds.list" -- rather reasonable on the face of it.  Of course, this means one can only access via object["feeds.list"] (not object.feeds.list!)

LiveCycle/BlazeDS
Tutorial Invoking web services using custom components
N.b. Adding BlazeDS' Tomcat install to Eclipse doesn't start the Blaze samples -- guess something's not set.
Realization: useProxy on HTTPService (etc) can only ever go to the server that the app was served from.  (While it would make some sense to allow alternative routing, Adobe don't appear to allow this.)

Day off 2009/12/11.

FlexPMD Eclipse plugin YakAxe!
Cute port/reuse of [Java] PMD to Flex including an Eclipse (FlashBuilder) plugin.
Installation notes:
  • Eclipse plugin uses a set of Jar files supplied from a zip that one downloads separately then points to from Preferences.
  • Jars must be in a directory withoutspaces in the path.
First installation and it doesn't appear to work.  Watching videos for hints.  More in later post.

Saturday 2009/12/12
Flex network classes -- there appears to be something of a progression:
  • URLLoader = mentioned since it's used by HTTPService (and possibly WebService)
    Loads a URL, allows HTTP header overriding: most control, least web-service like = lowest level
  • HTTPService = REST
  • WebService = SOAP
  • RemoteObject = Call Java object methods in BlazeDS/LC*S via AMF
  • DataService = Call... ? (includes offline capabilities)

    Monday, 7 December 2009

    Async FlexUnit 4 testing

    So the JSONCallHelper() of the last post needs better testing.
    I gave it the following signature...
    public static function JSONCall(urlQuery:String, responder:IResponder):void
    
    ...but then went looking for how to test in FlexUnit 4.

    Sunday, 6 December 2009

    Flex HTTP header customization problems again

    So, again I hit Flex's HTTP networking constraint -- HTTPService rather than URLRequest this time.
    HTTPService does not seem to allow modification of certain headers, amongst them the "Accept" header (it was "Cookie" last time for URLRequest).  Specific need: to call a RESTful webservice with "application/json" before "text/html" in the list (otherwise, I get back HTML!).