Getting to know Flash IDEs - actionscript-3

I am trying to learn AS3 by downloading Flash Projects(open source), but can't seem to really grasp the right way to get the projects to run (through compiling) with IDEs (I am using FlashDevelop as an IDE). Here's an example:
http://www.flashkit.com/movies/Games/Shooting-manish_c-12372/index.php
Here's what I try to do:
I open a new Project on FlashDevelop
I copy all the folders to src, and make the main file(In this project it's called "rhymingRockets.as") as the Document Class.
I delete main.as (generated by default), and try to run it, but get the errors: Error: Definition fl.transitions.easing could not be found.
Click here to see the problem
Sorry for bothering you with such a simple question, but any help will be greatly appreciated, as I am new to Flash.

Error: Definition fl.transitions.easing
That error indicates that you are not linking to the fl.transitions.easing library/package correctly. There is a related question here (as3 fl.transitions.Tween could not be found). If someone is sharing the source of a project, they may not have shared the source code or compiled .swc for any libraries the project may use since that is not project specific.
You might find this link of use: Linking .swc files in your ActionScript Editor. Since you say you are new to Actionscript, I'd suggest that you don't waste too much time on getting 3rd party projects to run – I realize it's tempting but not much learning from that and lots of frustration. Better to work with your own small learning projects to try out different ideas or libraries.

Related

Game fla file missing from Starling build - possible recovery or decompile?

I've been working with a programmer on an app and we've since gone our separate ways. I was passed on a copy of what was supposed to be the source code of everything at the end. However, I believe I'm missing a crucial file from the app build.
It's a pretty cool, but fairly basic 2D game. Built with Starling (gamua.com/starling) in ActionScript 3.
My question is, with all the files and assets mentioned below, is it possible to recover, reverse engineer, perhaps decompile, what I need to complete the app. Or will this project's code need to be re-written from scratch?
In my game 'build' I have following folders:
assets, bin-debug, extensions, libs, src, and system.
I am a bit of a noob in coding (as you've probably gathered), but it looks like I'm missing the .fla file from the 'src' folder. The contents of that src folder is:
com, utils (folders), Constants.as, Game.as, Main-app.xml, Main.as, Menu.as, Root.as
I was hoping that there is enough information in the .as files intact, that the restoring of the .fla to compile the build is not a big ask?
If other questions stand out to you, please ask.
Thanks!
Normally, Starling game is not built in the same way as a regular Flash game in the old days. You files look to me a lot like FlashDevelop project (there also should be .as3proj file somewhere in the root folder of the sources), which does not use FLA and compile the game from .as classes directly.
P.S. Or, maybe, Flash/Flex Builder project. Regardless, the possibility there were no FLAs to begin with is high.

Compiling structure of .as back in swf

I am having a problem related to flash/as3 files.,
I decompiled an .swf file (shop in a open source game) wich, its in chinese. i want to translate some chinese pushstrings in "text" to english text.
I can decompile it simply, as wells after decompiling, editing it.
My main problem is (after spending 3 days in the Internet searching a method 2 do it), i can't just publish a new version of the .swf , with the .as translates back. It just gives an 1kb swf with no .as on it.
Btw: the .swf files consists of no animations, since its a sub part of a main one.
The structure of .swf after decompiling looks like this:
tinypic.com(safe) - .swf structure
I'm using Flash builder + Flash CS6 to edit. -- in case link broken -- http://tinypic.com/view.php?pic=2ldzy4o&s=8#.U6UVI_ldWSo
Any help would be apreciated. Thank you community ;)
De-compiling a Flash (SWF) file in order to recompile it will very, very rarely work.
It could be as simple as you having one error, but you'll find that all variable names are using standard names and without knowing the structure of the application, it wouldn't be easy to work out where the problems are.
You should begin by making sure that CS6 has the correct document class set up. Once you've got that, you'll start seeing the errors. With that amount of classes, though, I would expect there to be a lot of errors.
I've searched the Internet for about 5 days or something to make a method work, like u said barely worked. My main interest was to convert .as3 with Traditional Chinese Lang, to English. I found a program with a little slow method: JPEXS Free Flash Decompiler.
I can open a .swf file and edit it without decompiling, and edit the text(hard work with /Google translator) but, hey, it works (don't know how but somehow he compiles the traits of the text in the .as3). And I had to be cautious editing it, one little error or a " missing bugged the whole file.
Thanks anyway for your response :)

Can't get MVVMCross core project to reference System.Xml.Linq

I'm quite new to MVVMCross but I've been actively using it for two weeks, at work and in a school project, and I am really enjoying it! Unfortunately, I've been stuck on the school project for 2 days now : we're asked to do a mobile Jabber client. This is not a big deal since I started it using Matrix XMPP library, which does most of the job and is easy to use. I decided to restart my project using MVVMCross, in order to have cleaner separated code and add a Windows Phone project, but Matrix absolutely needs System.Xml.Linq, and I can't get the core PCL to compile :
The type 'System.Xml.Linq.XElement' is defined in an assembly that is not referenced.
You must add a reference to assembly 'System.Xml.Linq, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
As shown in Stuart Lodge's tutorial videos, I'm using profile 104, the the faulting dll is really present in the folder, I can't add it manually to project's references since VS prevents me from doing it (gently explaining that it's automatically loaded since .Net portable subset is included in references), I've updated and repaired my VS install "just in case"... and have no more idea left.
So, here are the questions :
is it really possible to use System.Xml.Linq with MVVMCross? or did I miss the big title explaining that what I'm trying to do is stupid?
if yes (that'd be great!) did/does someone experience the same problem? Even more interesting : did someone find a solution?
Thanks in advance!
Additional info : Windows8(x64), VS2012 Ultimate, trial license (school project...) for Xamarin.Android
UPDATE : following Stuart's answer, I compiled and ran the BestSellers sample, which uses System.Xml.Linq... without any problem. As it comes with an explicit reference to System.Xml.Linq (see first link in answer), I tried :
to delete it (and a few others) : VS holds it's promises, and really includes needed references as long as .Net Portable Subset is referenced, so everything rolls smooth.
to manually add this reference via Notepad to my .csproj : it doesn't change anything.
One thing tickles me in Stuart's answer : "perhaps it is something to do with the way the matrix uses XML.linq". Since the Matrix type I'm trying to use is just a descendant of System.Xml.Linq.XElement, which is widely used in BookViewModel.cs from sample, what could possibly be wrong with that?
"Solution" : The problem seems to be due to Matrix requiring a special version of System.Xml.Linq, which is not the one included when profile 104 for building PCL. I used file linking method as a workaround to share the core, and that works, though this is less elegant, readable, and harder to maintain...
Yes it is possible to use at least some of System.Xml.Linq
For example, see the BestSellers sample
csproj file - https://github.com/slodge/MvvmCross-Tutorials/blob/master/Sample%20-%20BestSellers/BestSellers/BestSellers/BestSellers.csproj#L49
example XML linq use - https://github.com/slodge/MvvmCross-Tutorials/blob/master/Sample%20-%20BestSellers/BestSellers/BestSellers/ViewModels/BookViewModel.cs#L44
For the problem you are seeing, I'm really not sure what the error is - perhaps it is something to do with the way the matrix uses XML.linq? You might have more luck of you open up this question to other tags like portable-class-library, XML-linq and windows-phone.

Can I make a swc file with alchemy that will work for AS3 programmers that do not use alchemy?

I am very new to Alchemy and not an expert in using swc to store code(Although I am well aware that it worked for me so far). I want to make sure I understand if Alchemy is the right tool for me in this situation.
I want to make a simple script in Alchemy to help make certain 'heavy lifting' in the code lighter and less time consuming and ooze out more performance. The trick is that my colleagues will likely be daunted by the installation process(even though there is a guide). So my question is, if I do take the time to work with Alchemey, can I make my code available to other people that do not use it, for our project?
Hope that makes sense, my instincts (gut feeling) says yes. I simply want to make sure.
Yes, this is exactly what SWCs are for, you can compile your C++ code with FlasCC and expose a simple AS3 API that other people can use by linking your SWC into their project. Download the FlasCC beta and check out the tutorials it comes with that explain this in more detail: http://gaming.adobe.com/technologies/flascc/
Shortly, the answer is yes.
The point is you can't recompile the SWC into an SWF if you don't use alchemy. What you can do, is download at runtime (using Loader.load with ApplicationDomain.currentDomain) the SWF contained into the SWF (SWC is a simple zip, extract it).
Then, you can freely use the class that's inside, using ApplicationDomain.getDefinition("OneOfYourClass).
More about application domain
Since it's at runtime, you won't have to compile Alchemy, thus it should work fine for anyone.

How to compile the generated AS

hope you can help me with this question.
So, I've been working for a while with Flex, and had the crazy idea to create pure AS project.
If I compile a Flex app with the -keep flag, the generated actionscript gets generated.
Do you guys know of a way to make it compile, without going trough the code and gluing it all together?
Thanks.
Generated ActionScript is really only provided for reference; it's not really intended to be repurposed in that sense. Indeed, if you even have any, you've most likely compiled your project already anyway (unless you got it from somewhere else), so one might ask why you'd want to compile the generated stuff rather than your own source -- but nonetheless, although I haven't actually tried it, you should be able to point the Flex compiler mxmlc at your generated source to compile it, provided you're able to get all your dependencies to line up (which may be what you mean by "gluing it all together").
Just a thought, although again, I haven't actually tried it, so your results may vary. What is it you're trying to do, though? Just curious. :)
Like Christian mentioned, the generated AS code is pretty much there to serve as a reference. Just for fun, I tried compiling it from the command line using mxmlc, but part of the problem with doing that is that the class files generated don't match the classes they represent. So, you'd need to start renaming a bunch of your class files so that compiling those could even work. Many of the other classes in Flex won't be compiled in either, for the same reason.
As an example, the project I tested this with, had only one mxml file of source code in it. The generated output was 45 files. I'm sure that if you really wanted to do this, and were willing to invest the time in cleaning things up you could. But I'm curious too - why would you want to do this?
Actually it was just mere curiosity. I wanted to understand how the framework works and see how it merges it all together to make the final application, as I thought that the generated actionscript files were just a step in between the final SWF file, so I tought there should be a way for it to grab those files and generate the final application.
Eventually I would have tried to create a pure actionscript project just for the heck of it to see how complicated it was and what errors could happen when developing other stuff.
I know it sounds crazy, but I had some spare time, ha ha ha.