GrabIt HTML within Apollo

grabit.jpg

The Apollo HTML control is built with Webkit which is the same rendering engine used by Safari on Mac. The GrabIt application used the HTML control as a browser window. It then allows the user to take a screen shot of the web page being displayed and manage those screen shots using Apollo’s file system access. It also allows the user to view the source of the html and save that to the file system as well. There are some features using the FileSystem components that have been disabled in this build due to bugs with them being used within the windowing API.

In this application all files are stored within the File.appStorageDirectory. For more information on File and FileStream please see this post.

Download the application

12 Responses to “GrabIt HTML within Apollo”

  1. Ahmet Says:

    Great demo,
    I’m writting right now from Grabit. Just some issue
    - cannot display swf from html
    - keyboard is all mess up, it’s hard to find special char.

  2. everythingflex Says:

    There are some limitations with the alpha dealing with certain characters and function keys. Also, swf is not yet supported withinin the HTML component of this alpha.

  3. argv Says:

    hi,

    how you could add content in new nativewindows, when you creating these. for instance when i want view a saved snag…so it appears an neu native window with content…so die alphaDoc writes that in the alpha release its not possible to add content in new native windows….how did you get this?

    merci

  4. everythingflex Says:

    You can use the addChild function to add content to your windows.

  5. Sebastian Says:

    Is it possible to get the source code for this program?

  6. everythingflex Says:

    The source will not be released for this one, but if you have specific questions, please ask and I will try to help.

  7. Sebastian Says:

    Alright, just wanted to know more about how to actually capture what’s in the HTML control. Is that functionality built in the actual control or how does that work?

  8. everythingflex Says:

    Here is the code used to retrieve the HTML. Adobe is currently considering making this part of the API where it would return in the htmlText property. html is the id of the mx:HTML control.

    var str:String = html.htmlControl.window.document.documentElement.innerHTML;
    str = str.replace(/\r/g, File.lineEnding);
    str = ‘<html> + str + ‘</html>’;

  9. Sebastian Says:

    I meant how to take a screenshot of the content?

  10. everythingflex Says:

    Oh, take a look at the PNGEncoder and JPGEncoder classes that are part of the core lib:

    http://code.google.com/p/as3corelib/

    I’ll see if I have time to put up another tutorial on this.

  11. Sebastian Says:

    Excellent, thanks!

  12. Mike Downey » Apollo Alpha release link roundup Says:

    [...] – http://blog.everythingflex.com/2007/03/19/grabit-html-within-apollo/ [...]

Leave a Reply