Problems implementing a Timline Editor in my level editor in Adobe AIR. - actionscript-3

I'm currently working on an Adobe AIR project to pump out my level editor but I'm running into an issue. I basically need to implement an interactive movie editor. My question is how would you recommend I get the timeline editing started? Functionality wise it needs to be able to set tween key frames for position, scale, and alpha. Any ideas?
I've also been trying to look into pulling tween data from a swf. I'm not entirely sure how applicable this would be.

I'm not sure what you mean by movie editor - movie as in a sequence of images(bitmaps) or movie as in flash MovieClip ?
If it's the later, you could use a tweening engine like TweenLite to do the hard lifting and then it's up to you how you organize the scrollable GUI for the timeline (plenty of examples out there, starting with Flash/After Effectts/Blender/etc.) Feedback from your designer/animator is crucial I presume.
Pulling data from Flash could also be possible. If you'd like to parse the swf you can try Claus Wahlers' awesome as3swf library. Be sure to check some of his posts:
SWF Timeline Reconstruction with as3swf
Flash IDE Inspired Flex 4 Timeline Component
Another option would be to use jsfl (JavaScript scripting in the Flash IDE) and parse the tweens your designer/animator creates. It should be a matter of parsing a XML for the tween(be it old/classic or new/motion). If you go the JSFL route, you might also find the xJSFL project useful.
Also, for inspiration on game/animation tools check out Spriter

Related

How to use MXML mx.controls.Label in ActionScript

I have one AS3 application which was developed entirely in AS3 without using single line of code in MXML. Of late I am realizing that MXML has some rich controls which are not provided in open source Apache Flex SDK. One library which is of most interest to me in mx.controls, it includes Label, DataGrid etc.
Now, I want to extend my AS3 application to call mxml compiled into swf file. I tried to import mx.controls inside my AS3 programs but it does not sense that. Please tell me if I am doing anything wrong. If I am able to import mx.controls inside as3 class it would save me a lot of time. Can I do this?
Alternatively, I am trying to write a few applications in mxml and then call (.swf) in AS3. Is it possible?
I tried Googling but all examples are pointing to using ActionScript inside MXML with [CDATA[]]. But I want the inverse. Calling MXML from ActionScript.
Please explain me at nuts and bolts level as I am struggling with this a lot.
thanks in advace
You can't do that because Flex, that uses MXML, is framework built on top of the Actionscript. But you can do reverse. In Flex MXML you can use Actioscript code, and you can also use Flash components like Sprite, MovieClip... by using UIComponent or SpriteVisualElement as their parent container.

How to put code onto objects in as3

I am trying to create a kind of simple game where you move a player around and dodge some enemies. I was wondering if it was possible to add code onto a object in as3.
I want to be able to put code onto an object and not on the main timeline, so when it is on the stage, it will carry out the codes.
Sorry if this is confusing, I don't know how to explain it.
Each MovieClip object has its own timeline. Create a layer for code in your object's timeline and add actionscript in the usual way to it -- using the Actionscript panel.
You can start with a simple 'trace' statement to see that it works.
Please do not put code on the timeline.
Read a tutorial about Object-Oriented Programming in AS3. Learn about Document Classes and how to attach a class to a library object.
Here's a link to one of the first tutorials that popped up when I googled "Flash oop tutorial": http://code.tutsplus.com/tutorials/as3-101-oop-introduction-basix--active-5789

FLVPlayback without Flash CS

I'm implementing Google video Ads in flash game, using FlashDevelop. Google has a sample where they're using FLVPlayback component to display video... problem is, I don't have this class anywhere.
I've searched how to add it, but all solutions say "link to C:\Adobe\Flash CS\Components\etc" path, which obiouvsly without Flash CS I don't have... and don't want to install it just for this :)
I wonder if there is a way to get the FLVPlayback without installing Flash CS?
You can try import external adobe components swc through Flashdevelop interface.
Maybe this can help you: link
I quit and just installed the Flash Professional CC, and there linked to the component path, but it didn't work for some reason. Then I included the FLVPlayback.swf component inside my AS3 app, which compiled etc. but as I learned FLVPlayback wasn't really what I needed.
After some fumbling I made it work with Flex Spark component - VideoPlayer, used inside AS3. You can find some code on the devlist: https://developers.google.com/interactive-media-ads/community?place=msg%2Fima-sdk%2Fc3KH11vxSd0%2FeLuYneYpch4J

Creating skinned components and UI editor for scaleform

Our project is a MMORPG, using scaleform to render UI. Now we use Flash CS5 to create UI panels with scaleform CLIK. With the development of this project, we encountered some problems:
CLIK is not skinned, we have to create separate symbols for each component with different disappearance, so we have PushButton1, PushButton2, RadioButton1, RadioButton2...
Flash CS5 is not a What You See is What You Get tool. For instance, we have a shared component named Window, it has a close button as it's child. In a fla, we first pull a Window on the stage, and modify its size, the close button will be scaled in the stage.
We can constrain the close button in as code, but artists have to see the right result in Gfx Player on runtime.
We have some common components fla like common_button.fla with most of button components in it. Common components are runtime shared in different fla. In a UI fla (e.g. friendpanel.fla), when we need a common component, we copy it from common_xxx.fla and paste it in the new fla library. If a panel is complex, it's library will be confused and not easily managed. If the common one is not satisfying requirement, we will double-click the pasted component and modify it in the local fla, and this caused more resource management troubles.
So I consider if we should create a skinned UI component lib and an UI editor to handle this problems. Does any one has similar experience?
These are common workflow problems reported by many Flash IDE users unfortunately. Certainly, creating your own tool to solve these problems is a good option, but a costly one. The Scaleform team is investigating possible solutions to these types of issues for future versions of the SDK. In the meantime, there's not much that can be done to remedy these issues that I am aware of.

Flash AS3 error when importing 3D-tweened movieclip

I've been working on an AS3 application and it's nearing completion. At the same time, one of the designers I work with has been building a movieclip in a separate .fla that acts as an intro animation to the application. The intro uses the 3D motion tweening capabilities of Flash CS4 / Player 10, and runs fine in the .fla in which it was built.
The problem is that when I import the movieclip into the main .fla for the application, when I dynamically instantiate the movieclip and add it to the stage, I get a barrage of the following runtime error:
ReferenceError: Error #1069: Property null not found on fl.motion.KeyframeBase and there is no default value.
at fl.motion::KeyframeBase/getValue()
at fl.motion::MotionBase/getValue()
at fl.motion::Animator3D/setTime3D()
at fl.motion::AnimatorBase/set time()
at fl.motion::AnimatorBase$/processCurrentFrame()
at fl.motion::AnimatorBase$/parentEnterFrameHandler()
I'm guessing just based on the number of errors like this that I receive that there's one per keyframe in the tweening movieclip. I've checked to ensure that the Flash publish settings are identical across the two .fla files, and although the stage sizes differ slightly, I don't think that's the issue here. I've also googled the issue and found nothing but but this lonely thread on kirupa.
Any thoughts?
Okay--turns out the problem was that we had a local version of the fl.motion package in the Actionscript source paths that was out of date. Now everything's tweening along happily!
As far as I know you once you apply a 3D Motion Tween to a clip, you can no longer modify it by actionscript.
I'd suggest either copying the clip, without the tween, so you can access and modify it via actionscript, as for the animation, maybe go for Copy Motion as Actionscript 3.0. It will spit out a nasty looking bulk of code. The alternative is to 'redo' the animation using something like TweenLite which has nicer syntax. You would select the motion tween, give it an instance then use instance.motion.keyframes to loop through the keyframes and get the position and rotation values for example.
It's not as ideal as it should be :(
Have a look at the flashthusiast.com website for more insights on the new tweens and how to work with them.
Goodluck,
George