I started working on a Flash (AS3) project last week which makes use of the new AS3 based FLVPlayback component.
My FLA makes use of Document class feature (which let's you assign a class to the root of your movie) and uses a bunch of other classes too.
The following may seem obvious to some of you who know Flash and Flex inside out but to me these issues posed some small hurdles I needed to take in order to stop Flex Builder from flagging up errors and problems in my As files which otherwise woudl compile fine in Flash. The reason being is that Flash uses some classes which Flex Builder does not 'know' about and they therefore need adding to the classpath in your Flex Builder project.
Problem 1: Flex Builder does not know about the FLVPlayback Component
Flex Builder did not know how to handle a reference to the FLVPlayback Component I had on stage. I knew I had to somehow add the necessary classes to my project and from looking at the Flash docs I knew that the component lives in fl.video.FLVPlayback and I managed to find the classes in C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\Component Source\ActionScript 3.0\FLVPlayback.
However after adding them to Flex Builder's project source path I got this error:
1180: Call to a possibly undefined method Icon.
FLVPlayback.as FLVPlayback/fl/video line 4366
It referred to this code:
preview_mc.icon_mc.name = "icon_mc";<br>
preview_mc.addChild(preview_mc.icon_mc);
Fortunately the solution was easy - after some poking around inside the Flash install directory I found the SWC file for FLVPlayback at C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\Components\Video\FLVPlaybackAS3.swc
I added this to Flex Builder's Library path and that did the trick (I removed the previously added classpath again too).
I had to do the same for the new FLVPlaybackCaptioning component, a SWC for which can be found in the same location as the FLVPlaybackAS3.swc.
Problem 2: Flex Builder also does not know about some Flash class packages, such as Transitions and Easing
This one was easier to sort out. After Flex Builder complained about missing classes inside the fl.* package (I think the whole package is not on FB's classpath) I simply added C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\ActionScript 3.0\Classes to my project class path in Flex Builder.
It now appears I can use Flex Builder to write AS3 code for my Flash projects without having to put up with Problems popping up in FB. Turns out it's just a matter of classpath issues but it surely is a little confusing to realize that Flex and Flash do not share the same classes by default, even though both produce AS3 based SWF files. It woudl be great to see more tutorials explaining how both programs can be used hand in hand. I also can't figure out if this Adobe technote addresses the issues I have witnessed or if it's covering something entirely different. Can somebody advise? Nico also blogged about this with a solution that offers a SWC download of all the CS3 classes.


I've been looking for information on how to do this and your page is the ONLY decent one yet.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*" xmlns:video="fl.video.*" creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.flash.UIMovieClip;
import flash.events.Event;
import mx.controls.Alert;
import fl.livepreview.*;
import fl.video.*;
public function init() : void
{
pl.width = 320;
pl.height = 240;
pl.x = 0;
pl.y = 0;
pl.visible = true;
pl.source = "rtmp://click.dyndns.tv/CTSstreaming/movies/400x300_On2_Italy_France_match.flv";
pl.skin = "SkinOverAll.swf";
pl.autoPlay = false;
pl.playWhenEnoughDownloaded();
}
]]>
</mx:Script>
<video:FLVPlayback id="pl" />
</mx:Application>
that's a different approach to mine - I was only writing As code in FB, not compiling a Flex app... Are you using the the Flex/Flash integration kit?
I don't want to use the videoDisplay component in FB2 because from what I can tell, it doesn't support captioning out of the box.
I'll try some more next week and blog my findings.
Email me: stefan AT flashcomguru DOT com and we can swap files, then I'll blog it.
Severity and Description Path Resource Location Creation Time Id
unable to load SWC FLVPlaybackAS3.swc
Any other settings that need to happen as wel?
place in the library? Do you mean you've linked the SWC in your project properties?
I've this error too, and I have version 2.01 !
So I don't understand why FLVPlaybackAS3.swc isn't loadable ?
See this technote: http://www.adobe.com/go/kb401493
The problem is that Flex Builder (with the update) reads Flash-CS3-created SWC files differently than Flex-created SWC files.
Fun stuff.
I meant, "The problem is that Flex Builder (withOUT the update)..."
And I should have read the actual article. So the technote Stefan referenced (and I again) does the trick. You may have to close and reopen the project one more time if it doesn't work right away.
Any suggestions?
I had created one component in Flex and that component is working in Flex 3.0 IDE,
Now I need to access the same component in Flash CS3, in Flash CS3 there is a tool for converting the Flash component to Flex , but let me know how to access the Flex component to Flash component,
1. Where to call the class file?
2. Whether I need set any properties for accessing the component?
Please let me know how to call the component in Flash CS3
Waiting for the reply
Regards
Balaji
thanks...