Why your tweens aren't workingAugust 27 2011. Sometimes it's Saturday night and you don't feel like partying and drinking habanero infused tequila. Instead, you feel like spending the night working on your Flash project wondering why you're not doing it in HTML5. And while doing this, you run into a problem while trying to tween a property: ReferenceError: Error #1056: Cannot create property on ... And the error is happening at fl.transitions::Tween/setPosition() !??! WTF? This isn't how my Saturday night nerd fest is supposed to work. I don't even own that code. And I've totally defined the variable it's erroring on. Here's the catch: any variable you manipulate with a Tween object has to be public since the Tween object is referencing and manipulating it. It's not that it's not defined - it's that it's not accessible! With that solved, we can move to the Flash vs. HTML5 question. It's really a question of audience. While it's obvious the future (present) is HTML5, it may not be as widespread as it may seem according to Periscopic's report on HTML5 support (spoiler alert: 40% of users support HTML5. 99% support Flash.) Since the target audience of my secret Saturday night nerd project is the opposite of tech savvy, Flash actually makes sense. If you thought this post might teach you something about the work ethic of 9-12 year olds, you thought wrong. |
|