May 30th, 2007 by
Jaap Kooiker
A couple of days ago I struggled with (at the time) seemed a strange problem.
I had a main application which on it’s part loaded new applications (sub swf’s). Both (the main and the sub) swf’s where on my local machine at the time of development and both swf’s used (besides many other classes) the same (from the same package) static class with static functions. Let’s say the Class had a counter which whenever called, a function called countUp() traced the current count, like so:
public static function countUp():Void{
trace(”current count: “+Sample.countUp++);
}
(output : current count: 1)
(output : current count: 2)
(output : current count: 3)
(output : current count: 4) and so on…
For now everything worked fine. So at the end of the day I uploaded all the swf’s to a test server. The next morning I started with a glimps at the victory I achieved the day before. I did this by compiling the main application and discovered it wasn’t working anymore. The output for an instance would be this:
(output : current count: 1)
(output : current count: 2)
(output : current count: 3)
(output : current count: 4)
and when the external loaded swf called the static method
(output : current count: 1)
(output : current count: 2)
(output : current count: 3)
After that the main application called the static method which resulted in this
(output : current count: 5)
(output : current count: 6)
(output : current count: 7)…
Somehow the two swf’s used a different static class??? At that time I had a big questionmark above my head and got up to get some coffee first.
While drinking my coffee I re-tested the whole on the test server and it worked fine…what the… After some struggeling I remembered that the XML for the main application had Urls to the sub swf’s. Of course these sub swf’s where comming from the server. Maybe that is the problem? I discussed this with a colleague of mine and we concluded flash does this (as in the sample above) for security reasons (of course). This way it is not possible for another external swf to manipulate the classes from another server. It’s all seems so logical now…
So from an interaction design point of view:
If there only was a Sercurity Warning in the flash output panel….
Jaap Kooiker
Posted in Actionscript 2.0, Did you know?, Experiments, Flash 8, Interaction Design |
1 Comment »
May 14th, 2007 by
Jaap Kooiker
I’m sorry to say the above out loud, but I just have to.
Personally I don’t like the standard flash components. Why? They are heavy and mostly unusable because we use flash to build custom interfaces and the standard components aren’t made to be custom easily. Take for instance a button and try to make a fade between off state and on state. Anyway, once in every couple of years I grab a component (as with the FLVPlayback in an earlier post) and start playing with it. The conclusion: I always get a little disappointed.
I know, I know, in a moment I’m going to tell you what I want, keep reading
Now with Flash CS3 Adobe has thrown away the one component that could be of any use and that’s the accordion component. Well that said…. I still think the components set shipped with Flash CS3 is wrong. I have my own custom AS2 components which do exactly what I want, when I want. I name a few: Button, DropDown, Accordion, List, Pane (which is Box in Flex), Scroll, Pager, and so on…. You noticed something? There are similarities in the standard Flash components set and mine! But I still (and many others out there) create my own, mine are very customizable and do exactly what I want. So for me the flash components are obsolete and ready to be thrown overboard.
So, what do I want…
…the basic, but apparently unappealing (I mean not selling) layout components (which are shipped with Adobe Flex Builder). I think these would be helpful. I know these would be heavy to, but at least they are usefull and I will use them. The layout components could have sober functionality and they probably do what I want anyway, layout other displayObjects. The great thing is that skinning is not needed. Though the components have to be somewhat extendable, like in Adobe Flex. A few important components I’d like to see in the standard Flash Components Library: Container, Box, VBox, HBox. Devider… So Adobe, if you please could make these suitable for flash (or tell me why they can’t, please), I would be a happy man. For now I will just create my own layout components…again.
Jaap Kooiker
EDIT
Here’s a button sample in reaction to Serge (my component isn’t in the swf because currently I don’t have them at home, but I tried to make it clear what I want: fading, state transition, etc.)
EDIT EDIT
I had comment from some people who worked in this branche for a long time now and which I respect. One day I hope to be one of them….
For now, there isn’t anyone saying this is a good idea, isn’t there enough information (maybe sitting around a table with a few guru’s and me helps :)). Or is it nearly impossible to create good layout “components”?
Posted in Actionscript 2.0, Actionscript 3.0, Components, Did you know?, Flash 8, Flash CS3, Flex, Interaction Design |
10 Comments »
May 5th, 2007 by
Jaap Kooiker
As I mentioned earlier I use a MVC framework which we created at my work. Now for AS3 we wanted to revise this MVC framework and review the whole, although it is already pretty good. The discussion about queuing commands raised. Here are some reasons why I think queuing commands is a good practice. Now there are some things you have to consider when using queued commands, like for instance build a (failure-) timeout when executing a command. Otherwise your next command may never be executed.
- You always know which result belongs to which command dispatched, because you can only execute one command at the time;
- Browsers have connection limits which opposes a problem when you dispatch multiple commands at the same time;
- You can use singletons instead of instances as commands, which makes is easier to create and manage EventListeners. It’s more likely you don’t build up countless EventListeners for each command (because it’s a singleton);
- Starting up an application can be better directed. If you know you have to execute, for example, 20 commands you only have to know if the last command’s result (or fault) event is dispatched. Now you can continue your startup of the application
So these are some main reasons why I think you should use this construction.
Jaap Kooiker
Posted in Actionscript 2.0, Actionscript 3.0, Did you know?, Experiments, Flash 8, Flash CS3 |
6 Comments »
May 3rd, 2007 by
Jaap Kooiker
The last couple of years my work with flash is more or less occupied by programming actionscript. I’ve learned to do everything with actionscript, from working on and with the Custom MVC framework we have at TFE, to tweening, using the drawing API and so on. Today a colleague of mine reminded me of the power (and flaws) of old school timeline tweening and masking. Since I totally shut my mind of this “old school” stuff I needed some convincing, so I tried it out.
Turns out very nice results can be achieved in a simple way.
Since I build more like applications, I always had much respect for the websites with trees or flowers growing from scratch. Now I have made a simple but (as I might say) nice example of what can be done with simple timeline tweening and masking.
Check it out : Old school tweening and let me know what you think of it.
So there you have it… when used right, timeline tweening can also be cool.
Jaap Kooiker
Posted in Did you know?, Experiments, Flash 8, Interaction Design, Open source |
6 Comments »
May 3rd, 2007 by
Jaap Kooiker
Using the FLVPlayback component and streaming is great….if your using flash media server. But I wanted to test it with the open-source flash server red5, and that is a problem.
In order to use the FLVPlayback component with Flash Communication Server or Flash Media Server, you will need to update your server-side application script.
Apparently such a script is needed to create a SIML XML file wich contains the server location, application name, instance name and video files. Sometimes (like mine) you don’t have the opportunity to place such a file on the target server.
I have read many posts here and there where people were asking themselves what they we’re doing wrong, because the flash help exactly describes how to setup the component. Well, your not doing much wrong, it just fails to tell people the quote above.
So if your not using flash media server don’t use the FLVPlayback component, instead use the video class (also shipped with flash) and pack this with your own player class. This way you can create your own NetConnection, NetStream and controls. The only downside is that it is far more work to create a simple FLV player.
Jaap Kooiker
Posted in Actionscript 2.0, Did you know?, Flash 8, Flash Video |
5 Comments »