Local Notification ANE – Source Code

I started using Adobe Native Extensions ANE on iOS projects months ago, but then I quickly felt limited because sometimes extensions didn’t do exactly what I wanted and sometimes there was no native extension for some not widely used iOS features. Then I started studying Objective-C to try to overcome these limitations myself. I started by modifying the Daniel Kostler’s Local Notification ANE posted in the Adobe site (see Added Features below). I don’t know anything about Android … yet … but I guess someone does, and might want to contribute with the Android solution. Anyway I tried to keep the original Android solution untouched, so it will still work but without the new additions.

This post explains how to download the ANE source code and update it if you want to. If you only want to include the ANE in your Flash projects wait for my next post.

Added Features

  • Although not a feature, you must know I placed all classes in a new namespace.
  • The NotificationManager.applicationBadgeNumber property allows you to set and get the value of the application icon badge number.
  • The Notification class has two additional properties:
    • fireDate: This property will let you pass a Date object with the date when you want the notification to be triggered.
    • repeatInterval: This property allows you to define a repeat interval between Notifications. If no repeat interval is specified it triggers a single time. This property must be set to one of the constants in the NotificationTimeInterval class.
  • The native iOS code was cleaned up. It looks like at the beginning they were trying to support Local as well as Remote(Push) Notifications. But then they just decided to support only Local, and a lot of garbage code was left in there. Besides, this test code was depending on a large library that was not included with the ANE. Without this library the project couldn’t compile.
  • Added a default version of the ANE that does nothing, to allow compiling debug versions on Desktop computers.
  • Documentation updated to reflect the extension additions.

The magnifying effect in the Mac OS X Dock

While I was working I needed to create a button bar that performs more like the Mac OS X Dock using the same magnifying effect. After many tries and many versions later I managed to get the desired effect in Flash, you can see the result in this preview at ActiveDen: http://activeden.net/item/dockmenu/full_screen_preview/155203?ref=juankpro. In this post I explain the math algorithm I used for this effect.

Idea #1

The first idea was to make icon under the cursor bigger and then start making the surrounding icons smaller and smaller using a linear progression. In the next image you can see how icons were shown using this algorithm.

This algorithm has two problems though:

  1. When and icon grows and shrinks it doesn’t have a smooth movement because of the linear progression.
  2. There is a side-effect in the algorithm that makes icons appear to be shaking. I’ve seen the same movement in a lot of bars of this type so I guess they are using this linear approach. Some others try to soften this movement with and smooth algorithm but the issue is still in there. You can see a practical example of this side-effect here.

Are you trapped in the Matrix?

Upload images from your computer or webcam to see if your still part of the Matrix, save the result and share it to  your friends!!! Click here 

A long time ago, when “The Matrix” movie was still playing I made an funny Flash application. At first it was a simple code-driven animation of the matrix movie intro. At that time I couldn’t fill the screen with letters because the computer memory and processor were limited and ActionScript 2.0 was slow. I couldn’t find the exact font for the letters either, just a similar one.

Then Flash and computers improved and I made the application faster and more efficient (It allowed me hundreds of letters in the screen), I found the original font that was used in the movie also. With a little adjustments I made the application able to be applied to any picture or webcam image and store its result.

It’s not a big deal … really. I’ll explain how I did it in a future post.

Here you have a preview of the effect after being applied:

If you look carefully this is the image I used in the header of my blog :D .

For now, enjoy the app!!!

What is and how to install Red5 in Windows?

I started looking at Red5 these days and decided to write a post about it.

What is Red5?

Many years ago Adobe (legacy Macromedia) created a software called Flash Communication Server. This was a media server that allowed users to transfer real-time data, audio and video to create multi-user applications. Adobe changed its name to Flash Media Server or FMS. To send data it uses a protocol called RTMP (Real Time Messaging Protocol) and a data format known as AMF (ActionScript Message Format).

The license is pretty expensive. The cheapest one is about 999 USD and the most expensive one 4500 USD (or more) and not so many people and/or small companies have this amount of money for a single software.

A cheaper alternative is SmartFox Server that is very similar to Flash Media Server and manages prices between 500 a 2000 euros. This server is better for MMO games and supports connections not only from Flash but also from Unity, Silverlight, .net, Java, Android and iPhone. You can also buy an isometric game engine called OpenSpace by paying 2200 euros more. It keeps being expensive though.

A better approach is using Red5 which is a Flash Media Server clone, with the difference this is open-source and free. The only problem is its lack of documentation and that its installation is not as straightforward as FMS. I’ll explain the installation process in Windows below.

Continue reading

Word Tricks – Writing

When I was in high school I read the Word 2.0 for Windows 3.1 manual completely to find out what the application could offer me that makes my life easier. Fifteen years later, I thought it might be a good idea talking about what I learned since then and up until the latest versions of Word. Each trick will begin with a description of the problem and what people commonly do, and will end describing how the trick solves the problem.

Show/Hide special characters

In case you don’t know, not only letters and numbers we can see  are characters in Word, but also some others we cannot see, like tabs, spaces and new line characters. To see this special characters you must press in the Home bar (Word 2007) or the Standard toolbar (Word 2003). Spaces are shown as dots, tabs as arrows, and paragraphs as an inverted P character, like the one in the button. This is useful for some of the tricks. To hide these characters press the same button again.

Switch between uppercase/lowercase

Problem: Some times after writing text you discover you need to rewrite the first letter (or maybe everything) as uppercase or lowercase. In this case you can: erase all and rewrite again, or go to the first letter, erase it and rewrite it.

Solution: An easiest way is to select the text and press Shift+F3; as easy as that. Press Shift+F3 many times to change the word to uppercase, lowercase or first letter capitalization. If you want to capitalize the last written word, you don’t even need to select it. Immediately after writing it press Shift+F3.

Continue reading

Using Styles in Word

Note: Before starting with Word trips and tricks y prefer starting with one of the fundamental features in Word which is the base for many tricks; Styles. This document shows the easiest way to create, modify and apply styles without getting into advanced and uncommon techniques.

You have no idea how many times I’ve heard people saying ”…now I need a title” and then they just simply write it, select the text, apply bold, change the font, etc… and they repeat the whole process again and again. This is consuming a lot of time; what’s worse, if there is change in format they’ll have to repeat it again for the whole document. The more you write the more you forget the format you used, and you start creating documents with an incoherent look and feel. To avoid all this problems and make our lives easier we have Styles.

What are Styles?

Every time you change a text characteristic (font, size, color, margins, etc…) you are changing the text Format, one at a time. A Style is a group of formats that are applied to text all at once. For example one style could define color, font, alignment and size formats and apply them to text all at the same time, reducing the time it takes doing it one by one. Styles can also be reused many times in the document and one change to the style will reflect to all texts using it.

Continue reading

The Video Games

The beginning

I started, as many people my age, playing Atari and then going through Sega, Nintendo, SNES, GameCube, PlayStation, XBox etc. Because there was no Game development in Ecuador I started with the closest thing I to games I saw; Macromedia Flash. In the beginning I started with Flash websites and applications (nothing to do with video games), but suddenly I started getting closer to games with some Flash “adver games”.

My Job

Then it happened!!!! the first video games company appeared in Ecuador and I became part of it immediately. Obviously you cannot start with the big fish “hardcore games”. This kind of games need a budget not suitable for Ecuadorian companies. Hence we started with “casual games”. Here I developed Spa Mania 1 y 2, a Time Management game and Lost Realms - Legacy of the Sun Princess, a Hidden Objects game. You can download trials of these games here:

By the way, they were translated to many languages and were developed for PC and Mac. I’m really proud of these games because they are the first “real” games I developed.

One way took me to the other and now I became Karibu Games CTO where we keep doing “casual games” plus “adver games” also. We also started with Facebook games and a couple of iOS games. To name a few:

There are plenty of them waiting to see the light. Well, I just leave you with this link of Karibu Games ;) http://www.karibugames.com

About the blog

So many year doing Multimedia and it is the first time I write a blog. I can begin everything by saying the same thing I said in my first love letter: “Hi … I don’t know where to start …”, however I wrote a lot that time and I hope I can do the same in this blog.

I dedicate this blog to the application development and related topics not only for developers but also for people who uses technology software in a daily basis, which by today there are plenty of them. Since high school I also liked drawing and painting, so my first career was graphic design. Even though I never finished it I keep something of an artist in my blood so I’ll talk about that from time to time.

About the header image, it is not just an art using some eyes. It’s a composition using a “Matrix” effect applied to a picture of my eyes plus some other art stuff. I made the “Matrix” effect using a Flash component I developed years ago. I’ll talk about this component on time.

Well … enjoy the rest!!!!

By Juankpro Posted in Other