Archive for the ‘Flash’ Category

What Steve Jobs really means about the iPhone and Flash

Friday, March 7th, 2008

It’s been a hot topic these days and I thought I would add my two bits to it all.

I didn’t think I would write about this but then something struck me. It’s funny the angle this story took because when you step back a bit you knida see something else. The first thing you have to look at is the fact that the iPhone displays a website in its original version (not flash website) not the mobile one. I think that is a really nice feature that the iPhone has. I think that it is because of that fact that the whole story about Flash not being on the iPhone started. Steve Jobs doesn’t want is iPhone to deliver disminished web content, we get that. That rules out FlashLite from being used; also it wouldn’t fit well with HTML content being rendered normally and rich content being rendered with FlashLite instead of Flash. No developper would want to have yet another platform to develop for. Now here is the point I find funny; Steve Jobs says that “the version of Flash formatted to personal computers is too slow on the iPhone” but what that really mean is that the iPhone is not powerfull enough to output Flash content fast enough. From the angle that the media puts it, Flash is not good enough but Flash as nothing to do with it, what it should trully say is that the iPhone is not powerfull enough to render Flash at a decent pace. But I think I would have made the same thing if I was in his shoes, put the finger at somebody else, no one in is rigthfull mind would say is product is not strong enough…

Well that was it, it all came from the fact that the iPhone stands in the middle point, too strong for mobile content but not enough for full web content. I don’t know if will come soon, but I sure hope so

Flash CS3 extension to compress bitmap faster

Monday, February 18th, 2008

Have you ever had to import a sequence of images in Flash and then had to change the compression by hand for each of the images imported? It's really boring to do and also time consuming. I mean for each image, you have to select it in the library, right click, go in properties, choose the compression and than click apply. I couldn't believe that there wasn't any better way to do this. This week I saw a video by Lee Brimelow on how to create custom panel in the Flash IDE and decided to take the matter in my own hands.

So at the bottom of this post is the link to download my extension. It's not perfect, I think I could still had some options, but it does pretty much what I wanted.  Basically, it lets you select multiple bitmaps in your library and change the compression setting once for all of them. The zip file also contains the source code of the package if you want to play with it. If you just want to see how it is done, I will simply paste the code here. There is 2 kind of language in there: ActionScript 3 and JSFL. The JSFL is the string that the MMExecute function takes. Here is all of it:

Actionscript:
  1. compress.addEventListener(MouseEvent.CLICK, manageClick);
  2. function manageClick(e:MouseEvent):void{
  3.   if (numCompress.text != ""){
  4.     var myNum:int = int(numCompress.text);
  5.     if (myNum <0){
  6.       myNum = 0;
  7.     }
  8.     if (myNum> 100){
  9.       myNum = 100;
  10.     }
  11.     var jsfl:String = "var selItems = fl.getDocumentDOM().library.getSelectedItems();for (var i = 0; i <selItems.length; i++){if (selItems[i].itemType == 'bitmap'){selItems[i].allowSmoothing = " + mySmooth.selected + ";selItems[i].compressionType = 'photo';selItems[i].useImportedJPEGQuality = false;selItems[i].quality = " + myNum + ";}}"
  12.     MMExecute(jsfl);
  13.   }
  14. }

Here is the JSFL formatted in an understandable kinda way:

Actionscript:
  1. var selItems = fl.getDocumentDOM().library.getSelectedItems();
  2. for (var i = 0; i <selItems.length; i++){
  3.   if (selItems[i].itemType == 'bitmap'){
  4.     selItems[i].allowSmoothing = " + mySmooth.selected + ";
  5.     selItems[i].compressionType = 'photo';
  6.     selItems[i].useImportedJPEGQuality = false;
  7.     selItems[i].quality = " + myNum + ";
  8.   }
  9. }

It was pretty simple to do, but it seems strange how you use the JSFL since you have to put it all on one line in order to call the MMExecute function. Well here it is, have fun with it.

Compress Images custom panel

How many times do you compile in a day?

Tuesday, January 29th, 2008

Well I'm working on the AS2 project right now so I don't really have stuff to blog about these days (that and the fact that I start too many projects at the same time). I did this little experiment today; I was curious about how many time I was compiling in a day so I counted it today. I compiled 68 times in 7 hours. I don't know what to think about this number, but at least now I know...

How many times do you compile in a day?

Using TweenLite in Preloaders

Thursday, December 13th, 2007

In the current project that I am doing, I need to do some Tweens in the preloader, nothing really fancy, just the habitual fade in / fade out ou move in / move out. I didn’t want to use Tweener because my preloader was only weighting 7k and using Tweener would have more than doubled the size of my preloader.

I was thinking at first about using the default Tweens classes from Adobe, but I decided to check out TweenLite. I was pretty amazed of what it can do. First it weights only 2k, but doesn’t include any easing functions, so if you want those you have to import the same classes as the Tween classes. If you use easing it adds 1k to the weight so it’s not too bad. So in total it’s only 1k more than the Tween classes.

So why use TweenLite instead of the Tween classes? Well the major advantage is that it uses a syntax really similar to Tweener. Since I use Tweener in the main Flash movie, I think it’s better for people that are going to use my code after me, they won’t have two syntax to learn in order to understand my code. Also this syntax is easy to understand and I can write it without have to copy and paste previous code.

Here is an example of code using TweenLite:

Actionscript:
  1. import gs.TweenLite;
  2. TweenLite.to(mc, 1, {x:46, y:43});

Using embedded fonts in Flash CS3 using ActionScript 3

Sunday, December 9th, 2007

I just thought  I'd make a quick post about how to use embedded fonts in Flash CS3 using ActionScript 3 because I had to do that last week and I did really know how to do it. Well it starts just as you did in Flash 8, you right click in the library and you choose New Font... Then choose the font you want to embed and click Ok. Now you'll have to right click on the new font in the library and choose linkage. In the pop window, click export for ActionScript and give it a class name. Once that is done you can use that font in any textfields you create  with ActionScript.

Here is code showing you how to do it:

Actionscript:
  1. var helve:Font = new Helve();
  2. buttonLabel = new TextField();
  3. txtFormat = new TextFormat();
  4. txtFormat.font = helve.fontName;
  5. txtFormat.color = 0x000000;
  6. txtFormat.size = 14;
  7. buttonLabel.embedFonts = true;
  8. buttonLabel.text = "place label text here";
  9. buttonLabel.setTextFormat(txtFormat);

My font class name in the library was Helve. I use the TextFormat object to set the font for the textfield, it's that easy.

A bit on Silverlight again and something cool with htmlText

Friday, December 7th, 2007

I have read a pretty good article today about exactly what I blogged about yesterday. It's actually about Keith Peters asking Bill Gates what has in plan for the future of Silverlight. Gates' answer is interesting, he mostly says that the end user doesn't mind if it's Flash or Silverlight; it's all the same for him. Where the battle will be fought is on the developer side. He also says that the competition will be good for the industry just as I believe.

On an other subject,  I found something very interesting today about  htmlText. I already knew that you could insert images using the img html tag. What I found is that using ActionScript 3 you can also embed MovieClips also using the img tag. All you have to do is put the linkage id of the library of the particular MovieClip you want to embed in the src attribute of the img tag inside the htmlText. What is pretty cool is that you can use a normal text scrollbar to scroll images and MovieClips. I blog about htmlText more later because there are tons of things you can do with that.

Impacts of Silverlight for a Flash Programmer

Thursday, December 6th, 2007

I have been thinking lately about what impacts will Silverlight have on me as a Flash Programmer. I came to the conclusion that it wasn't really threatening. It could have been threatening in the sense that it could have made Flash obsolete and make me loose future jobs at the same time. But the thing is, Flash is such a good technology, it's been around for a long time, the community supporting it is amazing and Adobe has big plan for it, Silverlight would have to be packed with a lot of feature in order to shake Flash's position in the market. I don't think it has just that.

It's true that videos in Silverlight look good, but now with the moviestar release of the Flash Player, I don't think one is better than the other on that characteristic. It's nice for programmers who know .net, they can just jump right in and start programming Silverlight applications (maybe with a small learning curve). Good for them, .net programmers are already in demand, now they are going to be even more in demand, their salary is going to increase, so does the cost of building a Silverlight application.

One of the thing that Flash as always suffered was the penetration rate of the Flash Player, as a proof, website using flash 9 are now starting to emerge even if its been more than 6 month since it's been release. Silverlight will suffer even more as people are not willing to download anything anymore. Flash as the chance to be adopted by huge website like Youtube and Facebook and has been around for way longer, people trust the Flash brand.

A big advantage Flash has over Silverlight is all the documentation lying around the web. If you want to know how to do something in Flash, just Google it, it's that easy. Also open source projects like papervision3d and Tweener are just amazing.

For all these reasons, I don't think Flash programmers have to be afraid for their jobs because of Silverlight and that for at least five years. I actually think Silverlight is a good thing; a little competition never hurt anyone, Adobe will have to keep improving Flash which is very good for us.

Dominic Gelineau is zedia.net

Monday, December 3rd, 2007

I've been thinking about this post for a long time now. The thing is, when I write my name (Dominic Gelineau) in Google, it doesn't return zedia.net since I have started this blog. This is problematic in the sense that it would be good for my career that when people or future employer search my name in Google they find this blog. In not looking for a job right now, but I think that this blog is a very positive thing in proving my knowledge of ActionScript 3. So here it is, Dominic Gelineau is zedia.net.

I thought I could also talk a bit about my professional background and my education. Well first of all I am French Canadian and I think Montreal is one of the best city in the world to live in. I've traveled a bit in my life and I've never really found another city I'd be comfortable to live in maybe except Amsterdam.

I have to bachelor's degrees; one in Computer Sciences that I finished at McGill in 2003 and one in Communication that I finished at UQAM in 2006. I am pretty happy with the mix of these two domains. I think Flash and Internet are really the just middle.

I have worked for one year for Blue Communications, a small web agency, where I was a web programmer. That's where I really started doing Flash. Now I work at TwistImage where I do ActionScript programming 100% of the time and it's really great.

When you write Dominic Gelineau there is actually one result that is related to me It is this a paper about simulated decorative mosaics. Well now that this post is out there I hope that zedia.net will show up as a result for Dominic Gelineau.

Flex problems again

Thursday, November 29th, 2007

Seems like every time I want to use Flex there is something that prohibits me from doing it. Today I was trying  to make a website using papervision3D; what I want to do is use a grid of video planes. So each of my plane has a MovieMaterial Movie has a FLV embedded in it. Well the thing is that you cannot import FLV files in Flex. So it makes it just more complicated in this case to use Flex and Flash together instead of just using Flash. Oh well, no profiler for me this time either.

ActionScript 3 and Events

Monday, November 26th, 2007

I originally thought that dispatching events in ActionScript 3 would be more complicated than in ActionScript 2. But I was wrong, I wasn't very complicated to dispatch events in ActionScript 2, well, it's even less complicated to do so in ActionScript 3. The thing is that version 3 of ActionScript is built around the event model. Another interesting thing is that usually your class that you'd want to dispatch an event from would have to extend EventDispatcher in order to do so, but if this class already extends Sprite or MovieClip you don't have to extend EventDispatcher; Sprite and MovieClip are already descendant of the EventDispatcher class.  What this means is that you can call the dispatchEvent method from inside a Sprite or MovieClip extending class with no other code to write.

What is a bit more complicated is when you want to create a custom event. It's not really harder but the thing you have to know is that you have to override the clone and toString method. Once you've done that you're ready to dispatch your own events. I'll post an example about that soon.


Close
E-mail It