Difference between fla , swf and as files - actionscript-3

I am new in Flex 4 and ActionScript 3 So while reading, I found these file extensions many times. As I know that Application developers use MXML in combination with ActionScript to develop rich Internet applications, with products such as Adobe Flex. But I am unable to understand that what are these files and actionscript file is .as file.But when somewhere I found these extensions swf and fla then it make me confuse.Are .as , .fla , .swf are same files? if no , then what are the difference among these?As I mentioned that I am very much new to Flex and ActionScript then I hope experts will tolerate if this quesion is bogus or not good

It's easy: .as is a textual file , contains ActionScript 3 code , you can write it even in NotePad. .fla is format of Adobe Flash IDE , it contains graphics and animations and some code too. You can compile both .as and .fla into .swf file - Adobe Flash Player can open and play/show it. Every browser has Flash Player plugin inside it , so you can see all the flash games and banners . Clear?

Related

How to convert an ActionScript 2 SWF file to an ActionScript 3 SWF file

I created a ُSWF file with the Swish max 4. Then I loaded it in Captivate Software. But I got a message saying that "The Adobe Flash file "Test.swf" contains ActionScript 2 while the current project setting is ActionScript 3. This might cause the Adobe Captivate project to work incorrectly or stop working". After that animations are not fully loaded. How should I fix it?
Action-script 2 and Action-script 3 are written differently, there isn't a converter as far as I know. You would have to rewrite the code. Or you can change the project settings to Action-script 2 if you do not need Action-script 3 capabilities.
All I know is that by now, flash is dead. There is still ruffle though. And to work properly, ruffle at the moment currently can only support ActionScript 3.

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

Load as3 into as2 work only on _root

i made a simple test example in as2. This contains two buttons with the following handlers.
_root:
on (release)
{
this.loadMovie("AS3.swf");
}
_root.test.testmc:
on (release)
{
test.testmc.loadMovie("AS3.swf");
}
The AS3.swf is a video player(using youtube as3 api). If i load it into _root it works, but if i want to load it into any other place it doesn't. I searched and found this from adobe:
"SWF files written in ActionScript 1.0 or 2.0 cannot load SWF files written in ActionScript 3.0. This means that SWF files authored in Flash 8 or Flex Builder 1.5 or earlier versions cannot load ActionScript 3.0 SWF files.
The only exception to this rule is that an ActionScript 2.0 SWF file can replace itself with an ActionScript 3.0 SWF file, as long as the ActionScript 2.0 SWF file hasn't previously loaded anything into any of its levels. An ActionScript 2.0 SWF file can do this through a call to loadMovieNum(), passing a value of 0 to the level parameter."
Is the "_root part" of my code working because of the above "exception rule"? I am new to flash(yeah you could ask why i started with as2, unfortunately not my choice...) and i wonder if my thinking is right. Also if there is any sort of workaround(other than rewrite everything in AS3), let me know(maybe use of localconnection?).
Try this:
on root of as2:
test.testmc.loadMovie("AS3.swf");
or in the mc u want the as3 player:
this.loadMovie("AS3.swf");
Your second code is calling test.testmc.test.testmc because it is already placed in the "testmc" so you dont need to reference it with the full path. It's recommended that you use relative paths for things like this.
So, inside the mc testmc you just need to do this.loadmovie instead of searching for test.testmc INSIDE testmc.
Hope that was what you're looking for.

Preload sound AS3

I have AS3 project, made with FlashBuilder. I'm using MovieClips from an external .SWC-file.
In a MovieClip from the .SWF-file, I want to use an audio-file.
Is it possible to preload a sound-file (e.g. .MP3) in my FlashBuilder project, and access it in a MovieClip inside the .SWC?
Thanks a lot!
Yes, I don't know hoe you create your swc's but I'll tell you my setup which always works.
I create an asset FLA which would have the mp3 among other things.
I compile using FlashDevelop, and use the preloader template. Never had problems with that.
What you can't do is use SWCs run-time.

Create Windows/Macintosh Projector from Flash Builder 4

Am I able to publish a Windows/Macintosh projector from Flash Builder 4? I would like a solution that stays within the IDE, rather than having to open FlashPlayer.exe and export the EXE/App.
You can display your swf in the standalone flash player, and then create the projector from there (file -> create projector).
http://download.macromedia.com/pub/flashplayer/updaters/10/flashplayer_10_sa.exe
Closing this question...doesn't seem possible. I'm sticking with Flash CS5 to publish projectors.
I've had to do this with FB As3 projects. You have to convert your project type to Flash Professional Project: right-click project in the Package Explorer / Add/Change Project Type / Add Flash Professional Project Type. You'll have to create a fla to use as the source. Set the fla Class in the Properties panel to the main class of your project, and add all your resource libs & SWCs to Flash Professional Project: File/ActionScript Settings/Library path tab. This is important or you'll get compile errors. Seems like FB should do this for you, but it doesn't. Now in Flash professional: Commands/Export as Projector.
Many Years too late, but for future reference.