Importing and playing swf files in FlashDevelop - actionscript-3

Does anyone have any sample code on how to take an swf, import it into FlashDevelop and play it? I'm working solely with FlashDevelop and need to know this.
What programs can you create swfs with apart from Adobe Flash CS5/6. I need a free program to create them. If that isn't possible other free workarounds would be greatly appreciated. Thanks.

Read about "Embedding asset types" here: Embedding asset types , especially "Embedding SWF files" part.
What do you mean by "create swfs"? Creating of vector animations and graphics? If yes so check this out: Synfig Studio

Related

How to sharing classes code in different SWFs?

I am working on a Flash project. In the project there are lots of isolated FLA files which may share the same common classes code. To clarify the project limitation:
I could ONLY use Flash CS6 IDE. No modern tool such as Flash Builder or Flex, just pure Flash CS6 IDE.
I have to export the FLAs to SWFs one by one separately so each one of SWFs would contains a copy of the ABC of the common classes.
I have a loader.swf which was going to load all the other SWFs into a same ApplicationDomain. In other words all the duplicated ABC in the SWFs would be ignored because the loader.swf has also already involved that.
And my questions are:
Is there any way I could pre-compile all the common classes into a SWC or SWF and I could use it just like a DLL or SO?
If so how could I create such a SWC or SWF only by Flash CS6 IDE as I told before?
If I could create such a SWC or SWF how should I use it? Such as How could I change my configuration in the Flash CS6 IDE?
To be honest I don't know my idea is valid or not. Please, any advise would be great helpful.
Thanks.
I found the solution:
Create a FLA which would touch all the common classes
Exrpot the FLA I would get two files: SWF and SWC
Use the SWC as "External Library" in other FLAs
Use the SWF as Run-time Sharing Library to dynamic load it at run-time

Best way to make a downloadable version of a Flash game?

I already made a game with flash, and I want to provide an easy download for people that would rather play offline. Thing is, i use a folder whole structure to dynamically load content per level. Folder structure looks like this, not that it matters that much:
Game folder
animations
anim1.swf
anim2.swf
sounds
music1.mp3
soundeffect1.mp3
levels
level1.lev
level2.lev
myGame.swf
How should I go to distribute this? Should I just resort to make a zip file for the flash game and assume people know how to extract and open the swf? Is there any other way to port easily as an executable? Perhaps Adobe Air (not sure if this works though)?
Thanks, and please help!
Distributing a zip file is the only option if you really want that structure to prevail. Else,
Embed all the resources in the main (myGame) swf & distribute it.
Provide a html page for people who do not have standalone flash player installed.
Embedding as a single file allows the browser to cache the single swf & allow the player to keep playing offline until cache is cleared. So user might not even need an explicit download.
If you are using Flash Builder it is fairly straightforward to compile the application into a self-installing AIR executable (or DMG on a Mac). It is possible to include the AIR runtime which would avoid potential problems of the user not having the correct flash player for example.
An alternative to AIR would be to create a projector executable from inside the standalone Flash Player or from the Flash authoring environment.
Another option to using a zip file would be to use a free installer creator such as InnoSetup or Nullsoft on Windows, or Packager on Mac. Linux users are generally more tech savvy and so a tar would probably be well understood.
Adobe AIR works wonderfully! I use it for my own project, and your project should transition over to it with little to no modification (any issues should show up in the Compiler Errors and Output). The only downside is that, past AIR 2, there isn't any Linux support.
The other option is obviously to create a standalone .SWF projector inside a zip or installer, but in my opinion, that isn't the sleekest way to deploy for desktop. The advantage of AIR over this is that it gives you access to additional desktop functions that Flash Player doesn't.

edit actionscript from swf - compiled file

I have one swf file, it is JW Player plugin. It have one actionscript file in which is whole plugin code, and rest of files are jwplayer api files. So i need to open that file (where whole plugin code is) and edit few lines. But there is a problem, because when i try to decompile file with sothink swf decompiler (and few others) - to convert it to .FLA, decompiles simply crashes. It is because of some file from jwplayer api library. So, next thing i tried is to edit via HEX (because there is not much to be edited), but i couldn't find what i needed. So what i need is - is there any way or not? If yes, which program can be used for this?
I've had to do something similar in the past. In my scenario, the client had the SWF but no FLA. I needed to change a hardcoded url and sothink wasn't decompiling but I could view the AS in the sothink previewer. Luckily for me the flash wasn't very complex so I was able to copy the AS and graphics out and start a new project. I would imagine that JW Player is much more complex so this may not be an option for you, but thought I'd mention it anyway.
Depending on your needs, you may be able to get what you want by using the plugin API to extend the functionality or maybe even by customizing a skin.

box2d for flash how to compile its examples?

http://box2dflash.sourceforge.net/
i downloaded the code and in its folder there is a examples folder. How can i compile them ? what are the other software i need and how can i do it? Please help me because iam completely new to the actionscript programming side.
It is explained in the Examples/Readme.txt
As quoted from the Readme
//
To compile the demo:
//
Flash: extract Box2DFlashAS3 and open
PhysTest.fla in Flash CS3 (9) and hit
Ctrl+Enter.
Flex: Create a new
ActionScript project and add all the files from the archive to the project.
Set Main.as to the default application and hit Ctrl+F11.
MXMLC: From the
"Examples" directory, run: mxmlc
-source-path=../Source/ Main.as;
Thus you have three different ways to compile.
Use Flash CS3 (or higher)
Use Flex Builder (or higher )
Use the Flex SDK that contains mxmlc
Only posting this as an answer because I can't post a comment... this is an alternative box2D implementation that uses alchemy (so much faster) but the real up-side to it is that it has plugins for the flash UI to visually design/create physical objects, including building worlds etc. Video tutorial explains where to download:
http://gotoandlearn.com/play.php?id=135

Flash ActionScript 3.0 - Any free compiler, tools and tutorials?

I have got an assignment in which I have to implement a AS3 wrapper for any FLV player and I have to expose actionscript functions (External Interfaces?) so that other can be used in other different applications via CallFunction API. I have few questions regarding this -
Are the tools for this are freely available? I know Flex SDK is but I want standalone swf (I means Flash Player 10) that can be used anywhere without any dependency and should contain FLV player embedded or should be able to load it from a particular location by supplying the URL.
Is it possible only with an ActionScript compiler (or any free tools?). My problem is that I don't have flash or flex builder and I don't want to spend money on these because I don't work on it.
As I have almost zero knowledge about it. Can you guys please explain me (if possible with details) that what I need to do. Any resoures on how to create and compile?
If any of you have ever done this it would be really great if you guys can share samples. I've heard that many people have done the same thing for video players.
I can share a bit of my setup
I use Flash (CS5) for creating assets
I use FlexSDK as the compiler
And do all the code in FlashDevelop
Flashdevelop is for PC only for now, it's free and comes since the last few versions now with a debugger
I use FlexSDK to compile and Eclipse with AS IDE or something along those lines, and then preview things in a web browser using an html page with the swf file embedded.
check out projectsprouts. its a pretty nice Flash (as2/3/Flex/AIR) generation tool that can help you stub out your project, compile it, and even create unit tests if you want. pretty simple ruby install (i am a ruby newb, and got is running pretty easily). It was a pretty good support base, and an active mailing list where people will be happy to help you along.
It is important to note that the FlexSDK has very little to do with Flex unless you are linking against classes that are Flex specific. mxmlc does not have anything to do with MXML even though it will also compile MXML.
Here is an article that describes Flash development on Linux. It is pretty old, but the principles are the same. With an Actionscript 3 Compiler (contained in the FlexSDK) and a text editor, you are off to the races. It is a lot easier with Flash Builder 4, FDT 4, Intellij IDEA, Flash Develop, etc ;)