Use Flash CS3 component in Flex
As a bit of a n00b, this may be a stupid question...
If I were to get a component made for use with "Flash CS3",
once it's compiled to a swf & fla, is it entirely usable in
Flex [Builder] 3 ? Say I didn't want to re-skin it, and it was
fully programable via AS?
Is this a "it depends"? Is it a "absolutely, you just need
CS3 to compile it first"?
Thanks in advance,
AJ
"GuinnessIsGoodness" <[email protected]>
wrote in message
news:gbe131$c20$[email protected]..
> As a bit of a n00b, this may be a stupid question...
>
> If I were to get a component made for use with "Flash
CS3", once it's
> compiled
> to a swf & fla, is it entirely usable in Flex
[Builder] 3 ? Say I didn't
> want
> to re-skin it, and it was fully programable via AS?
>
> Is this a "it depends"? Is it a "absolutely, you just
need CS3 to compile
> it
> first"?
I think you need to either use it as an as file or compile it
as a swc,
unless you want to load it into a swfloader.
HTH;
Amy
Similar Messages
-
Hi,
There is great and easy way to create flash based component
in flash cs3 using action script 3.0.
I am going to make a simple My button component which will
behave likely same as flash native button component.
You can modify this according your requirement this is just
you give an idea about how we can go for creating a component in
flash cs3.
Follow these steps…
1. Create a fla file and save this file with any name
2. Create a movieClip and draw a rectangle shape on first
frame.
3. Right click on movieclip in library, select linkage
4. Provide class name in text field area [MyButton] (you can
use any name here which should matched with your class)
5. Click Ok button
6. Write class [MyButton]
(you can copy and use this)
* author @ sanjeev rajput
* [email protected]
* A flash action script 3.0 based component without extending
UIComponent class
package {
import flash.display.Sprite;
import flash.text.TextField;
import flash.events.MouseEvent;
import flash.events.Event;
import fl.motion.Color;
public class MyButton extends Sprite{
private var _tf:TextField;
private var _Label:String="My Button";
private var _bgColor:uint=0xCCCCCC;
private var _rollOverColor:uint=0xFFCCCC;
private var _borderColor:uint=0x000000;
private var _borderThickness:int=1;
private var _width:Number = 100;
private var _height:Number =100;
private var _background:Sprite;
public function MyButton() {
init();
createChildren();
initEventListeners();
draw();
//-------------property section [Start]
[Inspectable]
public function set Label(lbl:String){
_Label=lbl;
draw();
public function get Label(){
return _Label
[Inspectable]
public function set bgColor(color:uint):void{
_bgColor=color;
draw();
[Inspectable]
public function set borderColor(color:uint):void{
_borderColor=color;
draw();
[Inspectable]
public function set borderThickness(thickness:int):void{
_borderThickness=thickness;
[Inspectable]
public function set rollOverColor(color:uint):void{
_rollOverColor=color;
//-------------property section [End]
private function init():void {
trace('welcome');
_width = width;
_height = height;
scaleX = 1;
scaleY = 1;
removeChildAt(0);
private function initEventListeners():void{
addEventListener(MouseEvent.MOUSE_OVER, eventHandler);
addEventListener(MouseEvent.MOUSE_OUT, eventHandler);
private function eventHandler(event:Event):void{
if(event.type == MouseEvent.MOUSE_OVER){
toggleColor(_rollOverColor);
if(event.type == MouseEvent.MOUSE_OUT){
toggleColor(_bgColor)
private function createChildren():void {
_background = new Sprite();
_tf = new TextField();
_tf.autoSize = "center";
_tf.selectable=false;
addChild(_background);
addChild(_tf);
protected function draw():void {
toggleColor(_bgColor);
_tf.text = _Label;
_tf.x = Math.floor((_width - _tf.width)/2);
_tf.y = Math.floor((_height - _tf.height)/2);
//width = _tf.width;
private function toggleColor(color:uint):void{
_background.graphics.clear();
_background.graphics.beginFill(color, 1);
_background.graphics.lineStyle(_borderThickness,
_borderColor, 1);
_background.graphics.drawRoundRect(0, 0, _width, _height,
10, 10);
_background.graphics.endFill();
public function setSize(w:Number, h:Number):void {
_width = w;
_height = h;
draw();
7. Now right click again on your movieclip in library and
select component definition.
8. In class name text field provide same class name
[MyButton]
9. Click on ok button
10. Right click again on movieClip in library and select
Export SWC file.
11. Same your exported SWC file in (For window only)
[c:\Documents and Settings\$user\Local Settings\Application
Data\Adobe\Flash CS3\en\Configuration\Commands\
12. Now just open another new flash file open component
panel/window reload component you will your component in component
panel with MyButton name.
13. Drag your custom component on stage provide inputs form
property window and text it.
Enjoy!Lt.CYX[UGA] wrote:
> if anyone is using Flash CS3, try creating a flash
movie, using the FLVPlayer
> component to play an flv video and make it an executable
projector. Run it
> fullscreen and watch how the screen just stays black
when the video should
> appear. If you stay windowed, it works fine.
>
>
steps to reproduce:
> 1. create flash movie
> 2. put an FLVPlayer component on a frame that's not the
first (for testing
> purposes)
> 3. before the projector reaches the frame with the
FLVPlayer component, change
> it to fullscreen (by script or CTRL+F)
>
>
observed behaviour:
> not only the video doesn't play, but the whole screen is
black until the
> player goes back to windowed mode
>
>
expected behaviour:
> video should play
>
>
remarks:
> if you skip step 3, video plays correctly
>
Works just fine.
Made new movie, on frame 2 places Full screen action, on
frame 5 placed video component
and stop(); action attached to frame. Projector pops large
following by video playing
just fine.
I tried variety, first frame, many frames, all on one. Not
able to reproduce your problem.
Works on first go.
Best Regards
Urami
Beauty is in the eye of the beer holder...
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami> -
Was using Flash 8 on a PC now using Flash CS3 on MAC X and having problems
Hello,
I'm currently creating a photo gallery displaying thumbnails
of the original main image.
I was using Flash 8 on a PC and now am using that same file
on a MAC OS X using Flash CS3. And now the thumbnails are not
visible. The main image appears but the thumbnails do not.
The SWF created with Flash 8 viewed properly but when I
opened the fla in Flash CS3 the thumbnails stopped appearing and
I'm not sure what to do?
Any help or suggestions would be greatly appreciated!
ThanksWhoops, maybe I posted this in the wrong forum
-
Simple data inventory using flash cs3
is it possible to create very simple data inventory for
example for a library using flash cs3?
This is not for online purpose... the application contain a
form where users can enter data about the books like date returned
and so on..you're welcome :)
1) that is correct. unfortunately, we can't 'write' to an xml
file from Flash, one needs to parse the data sent from Flash using
a server-side script such as php to perform the actual writing of
the file and store it to a directory location. so in this sense, it
may be 'easier' to use a local database and server (running on the
same machine) and use a intermediary 'helper' interface such as
amfphp.
2) Flash does contain several classes to work with xml data
internally, and is quite powerful in that regard. however, if you
opt to use a system like a DB and amfphp, it can use 'regular'
Flash objects to send and receive data and handles the conversion
automatically, so would ultimately be both simpler to implement and
very very fast. some basics on amfphp can be found here:
http://www.gotoandlearn.com/play?id=78
(don't worry about your English, it's just fine :) -
Can't play mp4s using flash playback component CS3 after reinstall
I had to reinstall my flash cs3 and now application I made that played mp4 videos using the flvplayback component won't play anymore I get a video error
VideoError: 1005: Invalid xml: URL: "videos/Logo Animation WEB.mp4" No root node found; if url is for an flv it must have .flv extension and take no parameters
at fl.video::SMILManager/http://www.adobe.com/2007/flash/flvplayback/internal::xmlLoadEventHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
I dont know whats wrong. I have all the latest updates. Does anybody know whats the solution and why after a reinstall I would be experiencing this problem.Hi-
Referring to this post:
"The AIC codec is installed by iMovie HD and is just what its name implies. Intermediate (temporary conversion from one file format to another).
Your G4 will not be able to play the file past a few frames per second because of the large dimensions and high data rate even if you did find the codec. You'll find editing it using QuickTime or iMovie a frustrating experience because of those facts."
I'm a little confused-- do you mean that the G4 computer is just not strong enough to edit HD files "even if I did find the codec"? I was planning to edit it with Final Cut Pro (have never edited a HD project before), but is my computer not adequate? Let me know if there is any way for me to tackle an HD project with my current laptop-- otherwise I guess I really need to look into a new one.
-shc -
Flash CS3 Component Help?
I have a menu component I've created in Flash CS3. I'm
running into a small problem. Currently, in Flash, I create an
array in the first frame of the movie and then assign a
"menu_items" property (an array) on my menu object as that array.
The array is an array of specialized menu item objects that is
defined in a separate class. In Flex, I would like to do this:
<mxml:macMenu>
<mxml:macMenuItem image="btn1.png" click="{clickHandler}"
/>
<mxml:macMenuItem image="btn2.png" click="{clickHandler}"
/>
.....etc
</mxml:macMenu>
I'm not quite sure how I can get my object to realize the
children should be part of the array inside of macMenu called
"menu_item" and at the same time make sure they are an instance of
my menu item class.
I have posted the full AS3/Flash CS3 source of my menu at
http://www.adambergman.com/as3/macMenu.html
Any help or ideas are appreciated!!!Hi Rajesh,
I've seen your query all over the internet, so I should warn you I don't believe it's possible to disable a List Item.
For that you should use Josh Tynjala's open source Advanced List (http://code.google.com/p/flextoolbox/downloads/list).
Best Regards,
Filipe. -
Flash CS3 vs. Flex Builder 2
Here's the $64,000 question: should we be developing in Flash
CS3 or should we shift over to Flex Builder 2? I maintain that AS
3.0 is a pain in the proverbial, but I've been researching and
finding as much help as possible online about it, and I've found
that by and large people are using Flex Builder 2 as the basis of
tutorials about AS 3.0. Does anyone have an official slant on this
question? Should we abandon Flash for Flex? Will it help? Will it
mitigate the difficulties non-programmers are experiencing with AS
3.0 - or as I call it simply ***? Would I be getting more responses
to my *** questions if I post them over in the *** forum under Flex
Builder?
Any thoughts on this matter would be most welcome, thank
you.Beatie3,
>> Help please.
Sorry about that ... some days are crazier than others. :-/
[From an earlier reply ...]
> Thank you very much, that's exactly the sort of answer I
> needed. Hmmm, cheque's in the mail. ;)
Heh, good on ya! :)
> I'm definitely a 'deseloper' and will stick with Flash.
I wish
> I had the luxury of only dipping into AS3.
I don't know that I'd call it a luxury, really. Work is
work. ;) As
you might imagine, though, Flex Builder 2 provides a number
of scripting
improvements over the Actions panel (there's really no
comparison; if you've
tried them both, the Actions panel barely feels useful) and
the Flex
framework offers significantly more UI Components. Ideally,
if the pocket
book allows it, using both applications is the killer setup.
> My problem is that I built a little program that draws
scale bars
> on uploaded images that can then be printed. It did
everything
> it needed to, but in AS2.0 you can't control the quality
of the
> imported jpgs.
When you say imported, you mean dynamically loaded (loaded
at runtime),
right? Otherwise, I'm confused. The Flash IDE itself allows
you to
determine the quality of imported JPGs. In ActionScript 3.0
... are you
talking about the Stage.quality property?
> I'm experimenting with Sprites and I have something
appearing
> as the line is drawn but I can't crack the new way to
express
> coordinates.
Not sure what might be tripping you up, actually. The
coordinate grid
is the same. Horizontally, higher numbers move toward the
right;
vertically, higher numbers move toward the bottom. That's the
same as it's
been.
> I just want a blue hair line with a nice green dot at
each end
> that can be seen while the line is drawn. Once the
mouseUp
> happens the drawing guide should disappear and the black
> line appear.
Having heard what you're after, I just started a quick
experiment from
scratch. Here's my version, below. Note: I've made no effort
to optimize
my code. This is just a first draft to achieve a blue line
segment with
green dots on each end that becomes a black line segment when
the mouse
lifts.
var startX:Number;
var startY:Number;
var canvas:Sprite = new Sprite();
addChild(canvas);
canvas.stage.addEventListener(MouseEvent.MOUSE_DOWN,
mouseDownHandler);
canvas.stage.addEventListener(MouseEvent.MOUSE_UP,
mouseUpHandler);
function mouseDownHandler(evt:MouseEvent):void {
startX = mouseX;
startY = mouseY;
var dot:Sprite = new Sprite();
dot.name = "dotStart";
dot.graphics.beginFill(0x00FF00);
dot.graphics.drawCircle(mouseX, mouseY, 5);
dot.graphics.endFill();
canvas.addChild(dot);
dot = new Sprite();
dot.name = "dotEnd";
dot.graphics.beginFill(0x00FF00);
dot.graphics.drawCircle(0, 0, 5);
dot.graphics.endFill();
canvas.addChild(dot);
canvas.addEventListener(Event.ENTER_FRAME,
enterFrameHandler);
function enterFrameHandler(evt:Event):void {
var dot:DisplayObject = canvas.getChildByName("dotEnd");
dot.x = mouseX;
dot.y = mouseY;
canvas.graphics.clear();
canvas.graphics.lineStyle(1, 0x0000FF);
canvas.graphics.moveTo(startX, startY);
canvas.graphics.lineTo(mouseX, mouseY);
function mouseUpHandler(evt:MouseEvent):void {
canvas.removeEventListener(Event.ENTER_FRAME,
enterFrameHandler);
canvas.removeChild(canvas.getChildByName("dotStart"));
canvas.removeChild(canvas.getChildByName("dotEnd"));
canvas.graphics.clear();
canvas.graphics.lineStyle(2, 0x000000);
canvas.graphics.moveTo(startX, startY);
canvas.graphics.lineTo(mouseX, mouseY);
There's a lot of repeated code there, and this isn't how I'd
leave the
above in an actual project, but by spilling out a rough cut
like this, I'm
hoping it gives you something to work with -- showing the
mechanics of how
this might be done.
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/
"Luck is the residue of good design." -
Error when trying to use Flash CS3...
I just downloaded the Flash CS3 free trial from the Adobe
website. I installed everything and it installed fine.
After the install I try to open the program and an error
saying "License for this product has stopped working." Now I did a
search on the Adobe support site and found the page with supposed
fixes for this problem, but none of them work. I am using Windows
Vista Home Premium. When I go to the Administrator Controls panel
and go to Services I don't even see FLEXNet on the list.
I have tried uninstalling and reinstalling it multiple times
but the same thing happens every time.
Any advice?How are you trying to update? and What exactly are you doing before you get this error?
If you downloaded the updater, it could be corrupt, so you should try downloading again. -
Using Flash CS3 Within Authorware 7
I'm having trouble getting a Flash CS3 piece to work correctly.
I wrote a Flash program to print a completion certificate based on the data passed from Authorware. However when I try to run it from Authorware using the Flash Movie Sprite icon, the print dialog box comes up multiple times.
The variables are passed and everything works correctly except the print dialog box comes up 3 times.
Any thoughts on what could be causing this? I've attached the files.
How would I go about doing this using only Authorware?
Thanks
MarkHi Mark,
I think your problem may be the actual Flash file (or version of Flash you have used).
I have found Flash newer than the old v5 does not work well in AW. I think it has something to do with Action Script Version 2 and especially Version 3. AW has not been updated since AS1 came out. You might be able to save as an early version of flash (v5?).
I don’t think this will work because AS3 is completely different to AS1 & 2. AS3 is more a developers tool. Adobe need to update AW so it can take advantage of the new Flash functions.
If you can’t get it to work you might try this method of printing:-
On you AW CDROM:\Goodies\BrummellAssociates\PrintDemo and print this way.
From what I can remember it is confusing in that some of the measurements are set in inches and some in pixels (or something like that, I’m sure you will find out if you look).
Chris Brummell has a better version (for sale at £100!), they have a web site:
wwwDOTbrummell-associatesDOTcoDOTuk (please replace the “DOT” with a “.”)
This seems expensive to print a certificate but if you have enough customers.
I like your certificate though. Nice idea and good feed back.
Neill -
Use flash video coponent in flex?
Hi
I want to use flash player video player feature.Please let me
know how to do this.
I need use the class fl.video.VideoEvent but it is not flex
libary.do I have to build swc file,what is the steps to do this.
Thanks
MkHi Mk,
Emanuil Rusev has created an an easy to use, open source Flex
video player called FX Video. You can find the FX Video home page
here:
http://www.fxcomponents.com/?p=29
And the FX Video source here:
http://www.fxcomponents.com/src/fxvideo_0.92/
Thank you Emanuil!!!
Please take a look at the FX Video video player and see if it
provides the functionality that you need. If not, please post back
with detail on what further functionality you require.
Regarding
fl.video.VideoEvent,
Flex does have a similar event
mx.events.VideoEvent
The Flex VideoEvent is related to the Flex UI control
mx.controls.VideoDisplay.
VideoDisplay is pretty rudimentary. The FX Video video player cited
above uses both VideoDisplay and VideoEvent. If you are not
familiar with the Flex VideoDisplay control, you can find a
runnable example online in the Flex docs here:
http://livedocs.adobe.com/flex/3/langref/mx/controls/VideoDisplay.html#includeExamplesSumm ary
Please post back regarding whether the above answers your
question, and if you find it helpful :-)
Best regards,
g -
Hi,
I am creating some custom controls whose interface is a bit
complicated (and hence would be far too much of an effort to create
using graphics.draw methods). So I tried building the user
interface as Flash 8 symbols. What I do is,
- Create the symbols in Flash 8
- Embed them in my Custom Control class
- Create instances of the embedded class as a SpriteAsset
object
- Add it to the childrens list of my control class so that it
is drawn
So far, so good.
The slight issue is that I also need to allow the user to
modify the custom control interface (line color, fill color etc.)
and I cant figure out how I can modify these properties on the
Flash Symbol through the SpriteAsset class.
Any ideas....The short answer is you can't do that. Flash 8 is
ActionScript 2 while Flex 2 is ActionScript 3. When ActionScript 2
is loaded into the Flash Player it is put into a separate virtual
machine than the ActionScript 3 code. This is how the Flash Player
maintains backward compatability. There isn't a way for the AS3
code to reach in and tinker with the AS2 code and vice-versa.
But all is not lost. You can use LocalConnection to
communicate between the two virtual machines. Check my blog,
there's an article about doing that:
Using
ActionScript 2 SWFs with Flex 2 -
How to build a custom Flash CS3 component
I just googled in the hope to find some resources about how
to build custom Flash CS3 components, but nothing turned up. I also
couldn't find any info on Adobe's Flash developers center.
Do you know of any resource that sheds some light on this
subject?
If not then I'll have to try to find my way around custom
components by learning from the ones that came with Flash CS3 I
guess.Flash CS3 has been out for a few weeks. At this point, your
best bet is Amazon books or Barnes & Noble. I've read a few
books that should shed light on the subject. Otherwise, you'll need
to wait a few more weeks while people start hashing it out and
posting it to blogs and other sites. -
Text doesn't show, scroll bar does? using Flash CS3 Please help!
A little background: I made text box, typed some text, converted it to a movie clip, named etc. Used a purchased and proven scroller component ... followed directions to the letter, including referencing/linking the files. However, when I tried to test the scroll bar .... the scroll bar appears, scrolls and works perfectly except the text does not appear. I have tried making a scroll bar with the UIscrollbar same thing happens. I made an other attempt and put pics along with the text in the movie clip ... this time the pics appeared and scrolled, but the text still would not appear. PLEASE HELP. I am on a deadline and can't get past this scroll bar issue. THANK YOU!
Hi
Thanks for the tip. I did embed the text, but still not showing. Currently, I have the text box set to the following: Dynamic Text, Multiline, Border Around text, Anti-Alias for Animation (but I have tried all choices and embed the text each time).
Here are the original instructions with the FTscrollbar which I followed exactly.
1. Drag the component (FTscrollbar) from the components panel to the stage.
2. Create a new movie clip to be scrolled:
a. create a textfield on the scene and type in a few lines of text
b. select the text fields and covert them to a move clip symbol having the registration point top left. (I did top right since my scroll bar is on the right).
c. give the new movie clip an name in properties panel.
3.Select the component of the stage and configure its parameters in the parameters panel or component inspector panel.
a. Instruc the component to scroll the new created movie clip as the targetMovieClip
b. Set the viewAreaHeight and viewAreaWidth
c. set snapMode to snapToView value
d. leave rest of parameters unchanged unless you want to adjust.
4. Test Movie (contol/test movie)
On the FTscrollbar, I have the targetMovieClip set to the movieclips name the only other parameters the instructions said to change were veiwAreaHeight=100 veiwAreaWidth=150 which were the defaults. When I change this numbers the scroll bar goes away and the text still doesn't appear? The scroll bar is 16 x 140, the text box to be scrolled is 130 x 143 and the entire flash page is 500 x 550. I am not sure what the viewAreaHeight and viewAreaWidth are for ... or if that could be the problem? I have never had problems with scrollers but I used MX. I just recently purchased the CS3 and I am not sure what I am not selecting or not selecting but if feel it's probably something simple I am overlooking. So any more ideas are MOST APPRECIATED. If you need more info from me to help solve, please feel free to ask. THANKS! -
Using flash debugger player with Flex application
I am building my first Flex app and have run into a problem that I can't figure out. When publishing a .swf in Flash I sometimes run the debugger to generate the swf. When I do so, I can view the swf through my browser (using the debugger version of flash player) and the exceptions that are thrown include a stack trace (complete with line numbers) of any error that occurred. I have tried running the debug compiled version of my swf from Flex and it does not show the line numbers.
Is there some way to do this? I have several thousand lines and the location of the error is tough to figure out becuase it is an instance where I am casting an event to the wrong type through my typed params for a function. So, for example, I am dispatching a MouseEvent but the listener function has a typed parameter of Event instead.
Can someone please point me in the right direction?
Thanks.Thanks for the feedback. Our debugger documentation definitely needs to be refreshed. The PPAPI debugger on Chrome is even more complex. I blocked some time out on my calendar for Friday to try and get these revised.
-
Autorun CD Menu Using Flash CS3
I created a Flash file that I will use as a menu for an
autorun cd. I have CS3 and used AS 2 to create the files. If I test
the movie, it doesn't launch the files. If I publish it as a
projector file, I can launch the other files. After I burn the
files onto a cd, insert it into another computer and open the
projector file, it will not launch the files. Any thoughts on what
I am doing wrong? Any help would be greatly appreciated.
Thank you.You need to check your paths.
See this demo
http://www.flashjester.com/?section=faq&cPath=28_41#202
Regards
FlashJester Support Team
e. - [email protected]
w. - www.flashjester.com
"This has been one of the most impressive and thoroughly
pleasant
experiences of customer support I have ever come across -
astounding!"
Director - hedgeapple
Maybe you are looking for
-
Print only a specific control or indicator on a front panel to HTML document
Is there any way to print a specific control or indicator (not the whole front panel) to HTML document? I am trying to print a report that has a graph and some indicator value on it.
-
Problems with Ken Burns effect
Having a very frustrating time trying to get a decent slideshow. Like the KB effect but when I play it back the images jerk and jump. Smoothness totally gone. Strange thing is sometimes it is worse than others. Have tried closing all other unnecessar
-
XSD Namespace and WSDL Namespaces
Hi, I have a wsdl in which I'm defining a xsd schema in the <wsdl:types> element. Can we have same targetnamespace for both (wsdl) and (xsd that is defined in wsdl <types> element) ?? Please clarify. Thanks Edited by: bpeltechie on Jul 5, 2012 2:17 P
-
MY phones time did not update with daylights savings. How can I update?
The time didn't change on my phone with daylight savings. I tried *228 and that didn't fix it. Any other ideas?
-
HT4623 On my ipad lastest model w/ios6, should I update to ios7.0,2?
On my ipad lastest model w/ios6.1.3 should I update to ios7.0,2?