I finally got tethering on my iphone working!

February 17th, 2010 markledford No comments

So it was quite a chore but I finally got internet tethering working on my iPhone 3gs with firmware 3.1.2, baseband 05.11.07.
Btw firmware 3.1.3 was released a week or two ago, it won’t work with this and doesn’t have anything worthwhile so don’t update to it!
If you’re interested in tethering your iPhone then read on below. I haven’t been up on the jailbreak scene at all, so if I can do it, you can too, but
no promises if your set up isn’t exactly like mine and you end up bricking your phone. Oh and you need a Mac to do this.

This tethering is done through a jailbreak’ed app called MyWi.
MyWi
Its an app you actually have to pay for which is weird given its a jailbreak’ed app but its well worth the 10 bucks and has a free 10 day trial i’m still using.
Its actually better then the old hack for tethering that you could do with a custom ipcc  profile, mainly because it still works but also:
- it can allow you to share your iphone’s internet via USB / bluetooth OR by turning your phone into a WEPd wi-fi hotspot multiple computers can join
- shows up and down bandwidth usage as it runs in the background with a nice graphical display
- doesn’t require a custom ipcc profile

This also seams to be the best route for this firmware version because:
- you don’t have to unlock your phone and it doesn’t involve a tether’d jailbreak (where you have to plug your phone into the computer whenever you restart)
You don’t have to install ultrasn0w, blacksn0w, blackra1n (or any other program with 1s or 0s in it)
- at 10 bucks it isn’t worth the time-sink figuring out another reliable way of doing this

Drawbacks:
- your phone will be jailbroken(?) and may be less dependable (and will have a pineapple for a boot up logo) though mine seams to be working pretty well so far.

Steps:
1. Connect your iPhone to iTunes and back that ish up.
2. Download PwnageTool_3.1.5.dmg from http://blog.iphone-dev.org/ and install it
3. Use PwnageTool to create a jailbroken version of the iphone firmware and load it onto your iphone via iTunes. I followed a step-by-step tute like this one
3b. Resync your phone with iTunes to get all your apps, music, photos, etc back on your iphone. You can do this later as it takes forever.
4. You should have your jailbroken phone up and running at this point with Cydia app on it. A very slow, crude looking, not-apple-app-store App Installer with way too many ads in it.
Open Cydia and click on the search icon in the bottom right and type “rockapp”, and install it (its another App Installer like Cydia but from another company, the same one that makes iWi).
5. Open it, click on MyWi, install the trial, load it up and you should be good to go

Good luck!
Mark

Categories: iphone, not flash related Tags:

Cannot pass JSON string as String to ExternalInterface.call. It gets converted to an object

January 26th, 2010 markledford No comments

Note to self. This scenario isn’t mentioned here: http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000343.html

Categories: flex Tags:

cannot call ANY methods of XML or XMLList instances via bracket notation

January 18th, 2010 markledford No comments

Every single method, unique to XML and XMLList or inherited will be return as an empty XMLList instead of the intended method as a Function when its retrieved as a property of that instance. Note that this not calling XMLList methods but retrieving the actual methods as properties of the objects themselves.

For example:
myXML.contains is XMLList //true
myXML.toString is XMLList //true

This makes it impossible to call a method of an XML or XMLList programmatically via bracket notation like:
myXML['toXMLString']() //returns TypeError: Error #1006: value is not a function.

It feels like a Proxy is involved internally and these methods were not set to returning properly in getProperty. Anyone have any feedback or work arounds?

Categories: flex Tags:

mouse events aren’t dispatched for graphics drawn on main display class

January 5th, 2010 markledford No comments

This is bizarre. It appears the main display object’s graphics object is rendered on Stage and not its own display as in the example above:

In the Actionscript Project published above I have a red square drawn on the graphics of the main Sprite class and a child sprite with a green square and a textfield to the right to trace clicks.
I have MouseEvent.CLICK listeners on stage, main sprite ClickTest, and child Sprite. With mouse children disabled clicking anywhere will report a single MouseEvent.CLICK to stage even though they should be dispatching for both the main display and stage. With mouseChildren enabled the top square will still only trigger the Stage mouse listener but the bottom will correctly trigger the click on the child sprite, main parent ClickTest sprite, and stage showing that the main DisplayObject is participating in the mouse event bubbling.

Thus my conclusion that the main display object’s graphics object is rendered on Stage which can cause a lot of unexpected behavior and confusion.  Your root display class cannot listen to its own display to catch mouse events for its own graphics object. I guess this could make enough sense if the root display object shared its display with the root Stage but as this hierarchy diagram shows, it shouldn’t: http://www.adobe.com/devnet/flash/quickstart/display_list_programming_as3/

I’d consider it one of those bizarre architecture inconsistencies like swfs having references to stage in the constructor when ran stand alone but not when they are loaded into another swf, its just inconsistent and asking for trouble?

Categories: actionscript, bugs Tags:

major Flash Player GC bug converting string to XML

December 20th, 2009 markledford 2 comments

When converting a string to XML the memory used by the XML will never free up no matter the references or garbage collection tricks you have up your sleeve.  This is really excruciating when needing to parse large XML files from a Flex or AIR app.

http://bugs.adobe.com/jira/browse/SDK-11982

http://bugs.adobe.com/jira/browse/SDK-11244

http://bugs.adobe.com/jira/browse/FP-599 <- Looks like this issue has been open for well over a year and may be fixed for the next release of Flash Player (apparently not 10.0.42.34 released a few days ago, just checked, perhaps they mean the next full release :/)

UPDATE: Luca in the comments pointed me to an apparent fix they’ve added to AIR 1.5.2 via System.disposeXML(xml) found in the release notes here.

I’ve verified that this new method works like a charm. It seams like a bit of a strange one-off hack that they’ve put it in under System for AIR only but I’m guessing that they wanted to address it quickly for the SDK that needed it most. Hopefully the regular Flash Player fix is coming in the next major update and won’t require this unusual method.

Categories: actionscript, bugs, flex Tags:

Using [Embed] with fonts in Flex / Flash Builder Actionscript projects includes SDK specific core Flex classes

September 3rd, 2009 markledford 1 comment

Have you gotten this error when upgrading a Flex project to Flex 4?

1044: Interface method allowDomain in namespace mx.core:IFlexModuleFactory not implemented by class _Main_mx_managers_SystemManager.
1044: Interface method get preloadedRSLs in namespace mx.core:IFlexModuleFactory not implemented by class _Main_mx_managers_SystemManager.

Looking at the error its clear that Flex 3.4’s IFlexModuleFactory got compiled in and referenced by Flex 4’s SystemManager (which no longer has these methods) but how?

If you’re in my boat you have a central Actionscript-only Flex Library Project repository where you keep all your reusable Actionscript classes. This project is compiled with an older Flex SDK (3.4 in this instance) as it targets Flash Player 9 and other Flash 9 / Actionscript Only projects reference it. Your library  may also includes metatags even though the compiler adds some basic mx.core classes to do the embedding. This normally wouldn’t be an issue but you’ll find your boat will capsize if you’ve included any fonts embedded this way as the compiler includes some SDK specific classes, namely IFlexModuleFactory via FontAsset. You can verify this by including “-link-report linkreport.xml” compiler argument to this project.

Solution: Export the fonts separately, perhaps in a separate swc that isn’t referenced directly in your updated Flex 4 projects.

Categories: flex Tags:

flash player 10 security change can break focus logic with cross domain swfs

August 28th, 2009 markledford 1 comment

With the barrage of player updates and security changes to the Flash Player staying on top of the issues and incompatibilities from player to player is sometimes as troublesome as cross browser compatibility for regular web development. This is especially true for the upgrade from Flash Player 9 to 10.

There were some well publicized major security changes for policy files and the filereference class included with the Flash Player 10 security updates but a seemingly less significant new restriction regarding cross domain swf focus can wreak havoc on an existing flash project . The new restriction is outlined here:
Related-object properties in events may not be available

Starting in Flash Player 10.0.2, if an object that would be referred to by any of these properties [MouseEvent.relatedObject, FocusEvent.relatedObject, ContextMenuEVent.mouseTarget] resides in a different security sandbox (for example, because it is part of a different SWF that was served from a different domain), and the two sandboxes do not both trust each other (by means of the Security.allowDomain method), then the value of this property is changed to null.

I’ve found this is a significant change for cross domain swfs that utilize any of Flash’s V3 Components. Some 3rd party crossdomain swfs that once worked fine will no longer focus properly when clicking on textfields. Digging into this component architecture’s FocusManger you can find the culprit:

fl.managers.FocusManager::mouseFocusChangeHandler(event:FocusEvent)

/**
*  @private
*  This gets called when mouse clicks on a focusable object.
*  We block Flash Player behavior.
*
* @langversion 3.0
* @playerversion Flash 9.0.28.0
*/

private function mouseFocusChangeHandler(event:FocusEvent):void {
   if (event.relatedObject is TextField) { //<- related object will always be null
      return; // pass it on
   }
   event.preventDefault();
}

The solution is to add a Security.allowDomain(“YourDomain”) if you have access to republish, otherwise you’d have to use a proxy server.

Categories: flex Tags: ,

swfObject javascript error in Internet Explorer

April 15th, 2009 markledford 3 comments

We’ve had this IE error reported 3 times this week:

Line: 130
Character: 4
Code: 0
Error Message: ’script.parentNode’ is null or not an object

The issue:
The SWFObject library is included multiple times on a page causing the IE DOM ready check hack it uses internally to be triggered multiple times. This hack inserts and removes a test node. Since the first instance removes this node, additional tries cause the error.

Solution:
Remove multiple imports of <script src=”swfobject.js” type=”text/javascript”></script> from your page.

Categories: flex Tags:

embed parameter “menu” = false and ContextMenuEvent.MENU_SELECT

March 11th, 2009 markledford No comments

In the Adobe LiveDocs it states:

  • menu- Possible values: true, false.
    • true: isplays the full menu, allowing the user a variety of options to enhance or control playback.
    • false: displays a menu that contains only the Settings option and the About Flash option.

Naturally not wanting the clutter in my context menus I had menu set to false in its embed code. Today I noticed new Context Menu support I had added to my app was not showing up in Flash 9 Player though it was appearing in Flash 10. Apparently setting this option to false will also keep the ContextMenuEvent.MENU_SELECT option from being dispatched in Flash Player 9 :-x

Categories: flex Tags:

AS3 htmlDecode htmlEncode xml hack

February 25th, 2009 markledford 3 comments

You’d think there would be a straight forward way to htmlEncode and htmlDecode strings in flash but there doesn’t seam to be any sort of built-in utility class that supports this. Oddly enough there isn’t one in Javascript either. Like this Javascript hack, here is a handy hack to pimp AS3’s native XML object instance to do the htmlEncoding/decoding for you.

Unfortunately this doesn’t work for  many encoded characters like “&iacute;”, “&oacute;”,  “&aacute;”, and “&ntilde;”. It seams the best route to robust html html encoding/decoding is to roll your own utility function like this.

Categories: flex Tags: