Most of the time I design and code user interfaces.
Flash, CSS, iPhone, you name it. Involved with this industry since 1996.
In my spare time I draw things
and shoot photos.
And I am a father, husband and altogether pretty happy guy,
currently living with my family around Prague, Czech Republic.
Currently I am exlusively contracted by the game design studio Falanxia, developing Facebook games.
Featured project.
Tsentas Developers
Real estate developer of residential and commercial properties on Cyprus. This site heavily uses Papervision3D library and advanced 3D navigation. I've produced the whole project: user interface graphics, Flash programming, Drupal administration and remoting via AMFPHP and search engine optimization.
Tags.
flash Illustration life gui actionscript animation music cyprus usability travelling icon network video 3d sideshow print html/css neurobion game audio papervision3d flier creation logo prague falanxia media security open source player software character pour feliciter source project facebook cover jsem.cz homepage osx seo comics reflex kids turkey downloadArchives.

Dummy Tween Plugin
A somewhat different approach to periodical calling of a method. This time with TweenLite/TweenMax by Greensock
As I said before, last few months I’ve been working for Falanxia.com, where I help to develop social games in Flash (and more platforms coming). I was not very happy with the way how to periodically call a method:
Is there a shorter approach to do the same thing? While we already use TweenLite/TweenMax a lot, I thought there has to be a plugin which should handle this task (no, I don’t need TweenLite.delayedCall(). Well, nope, there’s not. But sure it can be handled this way:
var tweenObj:Object = {pass:0}; TweenLite.to(tweenObj, 1, {ease:Liner.easeNone, onUpdate:method}); // 100 * 10 ms = 1 secondIMHO this way is a bit cumbersome and you need to create an Object to be tweened. I came up with a simple TweenLite plugin to do the job:
/* * Falanxia Utilitaris. * * Copyright (c) 2010 Falanxia (http://falanxia.com) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package com.falanxia.utilitaris.plugins { import com.greensock.*; import com.greensock.plugins.*; /** * Dummy tween plugin. * * @author Vaclav Vancura @ Falanxia a.s. vaclav@falanxia.com * @author Falanxia (falanxia.com, @falanxia) * @since 1.0 */ public class DummyTweenPlugin extends TweenPlugin { public static const API:Number = 1.0; protected var _target:Object; /** * Constructor. */ public function DummyTweenPlugin() { super(); this.propName = "dummy"; this.overwriteProps = ["dummy"]; } /** * Tween initialization. * Gets called when any tween of the special property begins. Store any initial values * and/or variables that will be used in the "changeFactor" setter when this method runs. * @param target Target object of the TweenLite instance using this plugin * @param value The value that is passed in through the special property in the tween. * @param tween The TweenLite or TweenMax instance using this plugin. * @return If the initialization failed, it returns false. Otherwise true. It may fail if, for example, the plugin requires that the target be a DisplayObject or has some other unmet criteria in which case the plugin is skipped and a normal property tween is used inside TweenLite */ override public function onInitTween(target:Object, value:*, tween:TweenLite):Boolean { return true; } } }How to use it?
TweenPlugin.activate([DummyTweenPlugin]); // first you need to activate the plugin, but only once in the whole app TweenLite.to(this, 1.0, {dummy:{}, onUpdate:method});This way there’s no need to create an Object variable. I think it’s a bit simpler. Actually this article took much more time to write than to code the DummyTweenPlugin.
Related Posts. Probably.
TrazzlePublisher Vancura-AS3-Libs Bzoonkbar: seznámení Involver Media Player MumboJumboT WebExpo 2010: Příprava dat pro rychlé a malé aplikace ve Flashi Weekly Digest for October 22nd Bzoonkbar Preview