A Flash Developer Resource Site

Results 1 to 20 of 20

Thread: [F9/AS3] Discoveries and discussions

  1. #1
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,182

    [F9/AS3] Discoveries and discussions

    Have I missed the other F9/AS3 threads, or aren't there as many as I'd think there are?

    Anywayz; I'm now installing the F9/AS3 alpha test version, and I was wondering who else did this?

    What's your people first opinion on F9 and AS3? What have you already tried to get familiair with them?

    I'll be back when I'm done playing

    ~Sph

  2. #2
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    I'm very fond of AS3/Flash 9. I really dread going back to F8 to finish some of my other projects

    Some cool things :

    - reparenting movieclips (which also means you can load them from an external swf's library and move them anywhere)
    - the Dictionary class
    - the URLLoader class (no longer limited to url-encoded style text documents)
    - the ByteArray class
    - zipping and unzipping!
    - ...

  3. #3
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,182
    Those features sound good alright I guess I'll get to learn them over time...

    Well, I just installed F9, and the interface is (almost) exactly the same as F8's. Not sure if that's a good thing though.

    Although, I'd have no idea where to start now. Haven't yet looked into AS3, so little spare time

    Edit: Figured it out...

    Just another thing I'm wondering about; when should you place code on the TimeLine? Or should you always use a 'Document Class'? And how do you contact variables placed on the TimeLine?
    Last edited by SaphuA; 08-01-2006 at 11:02 AM.

  4. #4
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    the interface is (almost) exactly the same as F8's. Not sure if that's a good thing though.
    That's because it's an alpha release. It's basically just Flash 8 with AS3 support. Other changes will be there in the final release.

    As for the speed increase, keep in mind that it's only AS that's faster - the rendering-engine didn't improve that much as far as I know. Well, using the new Sprite class would be a bit faster than movieclips, but I'm not sure how much.

  5. #5
    Senior Member ozmic66's Avatar
    Join Date
    Oct 2005
    Posts
    472
    if you're going to code a lot, use flex builder 2
    It makes oo coding so much easier and lets you avoid making a lot of stupid errors

  6. #6
    hmm Pugger's Avatar
    Join Date
    Sep 2003
    Location
    Perth, Australia
    Posts
    616
    Quote Originally Posted by SaphuA
    Just another thing I'm wondering about; when should you place code on the TimeLine? Or should you always use a 'Document Class'? And how do you contact variables placed on the TimeLine?
    Always use a document class. From now on you should keep your code separate from you fla file, so always in external AS files when coding in AS3.

    AS3 is way better than AS2 for a coder. But for a graphics person, maybe not.

    Either way I've been very pleased, and then some more, by AS3.

    EDIT: Probably already know, so for those who don't, heres a nice page for all AS3 needs: http://labs.adobe.com/wiki/index.php/ActionScript_3
    Last edited by Pugger; 08-02-2006 at 12:09 AM.

  7. #7
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,182
    Thanks for the info

    And now I'm wondering; why Flex 2? I've heard several rumours of it, but what makes it so great? Since Flash 9 is out, shouldn't we be using that instead of Flash 9?

    Or is Flex 2 more aimed at coders (as in, no real drawing interface etc.)?

    ~Sph

  8. #8
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    Indeed, Flex 2 is more aimed for coders, but more specifically RIA developers (rich internet applications), and it has a lot of components for this purpose. That doesn't mean you couldn't do games with it just as well, but I personally prefer sticking to F9 for now. The results should be the same.
    Note : I don't have any experience with Flex at all, so I could be wrong.

  9. #9
    Senior Member UnknownGuy's Avatar
    Join Date
    Jul 2003
    Location
    Canada
    Posts
    1,361
    This should help clear things up:

    http://www.gskinner.com/blog/archive..._from_a_f.html

    Quote Originally Posted by Grant Skinner
    You see, Flex is like ground beef, Flash is like the whole darn cow. While it's completely possible to make a hamburger (form app) with the cow, it's going to take a lot more work than if you just started with the ground beef. Try making a nice sirloin steak or some cheese with the ground beef though. Sure you could force the ground beef to look, and maybe even taste kinda like cheese, but it would be a messy hack. Flash gives you the power to do a lot more things, but you have to do them from scratch.

  10. #10
    Senior Member walnoot's Avatar
    Join Date
    Apr 2005
    Posts
    751
    the sound has improved tons. See andre-michelles mod-player in his experiments. Now you can make real driving sounds!

  11. #11
    self-portrait Kianis's Avatar
    Join Date
    Feb 2004
    Location
    Stockholm, Sweden
    Posts
    425
    Has anyone tried out if Duff's device works in AS3?
    // Mazapán, my portfolio

  12. #12
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    Quote Originally Posted by walnoot
    the sound has improved tons. See andre-michelles mod-player in his experiments. Now you can make real driving sounds!
    Well, it's not actually flash's sound-handling that has improved, it is the fact that you can actually make your own swf in-memory by using a bytearray. So if you make an swf with a sound in it, you can play it back. It's a very cool trick, but a bit of a work-around - although it seems to be pretty processor-friendly. It would be a lot cooler if we could do this directly instead of like this.
    It would be cool if someone made an open source mod-player like this though, which we could all use in our projects. I'd definately check it out. (would be even cooler if flash supported midi and mod files natively, off course).

  13. #13
    Senior Member walnoot's Avatar
    Join Date
    Apr 2005
    Posts
    751
    Ah, I see. Allthough too advanced for me, people should check this out:
    http://blog.davr.org/2006/04/21/dynamic-sound-in-85
    http://www.flashcodersbrighton.org/wordpress/?cat=3

  14. #14
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    Just a minor detail, but DisplayObject.alpha is now a value between 0 and 1, as opposed to the old MovieClip._alpha which had to be between 0 and 100. Just thought I'd mention it, as it could be confusing to some.

  15. #15
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    Some things I really wish they will add in the release version :

    - The ability to specify an "extends"-property for a library item when it's using an auto-generated class. That way, you could have a number of movieclips (or sprites or whatever) that all share the same code, without having to write a class for them.
    - The ability to load any kind of file in the library, for byteArray-manipulation (not sure if that would be supported by the player though). One application would be to add a MOD-file, and play that back (with André Michelle's technique). Otherwise, you have to either use external files, or convert it to an array or something (which takes a bit more space).


    Now, who do I have to sleep with to make this happen?

  16. #16
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Here is little experiment with ByteArray and loadbytes.

    Lets say you have declared function and you have declared variable:
    Code:
    function addNumbers(a:int, b:int){
    	return a+b;
    }
    var testing=100;
    Now anyone with swf decompiler can see those from your swf. However, you can use bytearray to hide all the code:

    var loadData:String="46575309180400007800055F00000FA00 0000C01004411080000004302FFFFFFBF150B0000000100536 3656E6520310000BF14A9030000000000000010002E0000000 0272954696D656C696E65305F3131356662363234316638666 33934643938333263323631313238643633650003696E74077 4657374696E670E6164644672616D655363726970740974656 D702E6173243221687474703A2F2F61646F62652E636F6D2F4 153332F323030362F6275696C74696E0B61646F62652E75746 96C7313666C6173682E6163636573736962696C6974790D666 C6173682E646973706C61790C666C6173682E6572726F72730 C666C6173682E6576656E74730E666C6173682E65787465726 E616C0D666C6173682E66696C746572730A666C6173682E676 56F6D0B666C6173682E6D6564696109666C6173682E6E65740 E666C6173682E7072696E74696E670C666C6173682E7379737 4656D0A666C6173682E7465787408666C6173682E75690B666 C6173682E7574696C7309666C6173682E786D6C17666C61736 82E646973706C61793A4D6F766965436C697014666C6173682 E646973706C61793A53707269746524666C6173682E6469737 06C61793A446973706C61794F626A656374436F6E7461696E6 5721F666C6173682E646973706C61793A496E7465726163746 976654F626A6563741B666C6173682E646973706C61793A446 973706C61794F626A6563741C666C6173682E6576656E74733 A4576656E7444697370617463686572064F626A65637406667 2616D65310A6164644E756D62657273094D6F766965436C697 00F4576656E74446973706174636865720D446973706C61794 F626A65637411496E7465726163746976654F626A656374164 46973706C61794F626A656374436F6E7461696E65720653707 26974651F0501160205061702080716081609160A160B160C1 60D160E160F1610161116121613161416151616161718011A0 11A181A191A1A1A1B1A1C1A1D1A1E021E01020304050607080 90A0B0C0D0E0F101112131415161718191A1B1C1D1E0F07020 3070204090501091F0107022007041F07020107082107021E0 70A22070823070824070825070826050000020002000101020 00000020000000200000002000001070808160003030200000 000050100010601000200000104010704010005000101090A0 3D0304700000102030A0B06D030D1D2A04800000202010A0B0 9D0305E02246468024700000303010A0B12D030D049005D032 4005D04660446030229470000040201010937D03065005D096 609305D0A660A305D0B660B305D0C660C305D0D660D305D0E6 60E305D086608305D08660858001D1D1D1D1D1D1D680747000 03F132E0000000100000054696D656C696E65305F313135666 23632343166386663393464393833326332363131323864363 3650040000000";
    var data1:Array=loadData.split("");
    var data2:Array=[];
    for (var i : int = 0; i < data1.length; i +=2)
    {
    data2.push("0x"+data1 [i]+data1[i+1]);
    }
    bytes = new ByteArray ();
    for (var j : int = 0; j < data2.length; j ++)
    {
    bytes [j] = data2[j];
    }
    ldr = new Loader ();
    ldr.contentLoaderInfo.addEventListener(Event.COMPL ETE, completeHandler);
    ldr.loadBytes (bytes);
    function completeHandler(e:Event):void {
    trace(ldr.content.addNumbers(4,5));
    trace(ldr.content.testing);
    }
    Note: there are no spaces in the string, forum creates those, when copying the code into Flash9 all spaces must be removed, sorry about that. If needed I will attach the code in as file.

    The huge string loadData contains full swf file in byte form. After its loaded the function and variable can be accessed:

    trace(ldr.content.addNumbers(4,5));
    trace(ldr.content.testing);

    This example should trace 9 and 100. Anyone decompiling the file can only see that string, not the function or variable.

    I am pretty sure the conversion from string into byte array could be done some faster and better way, but I didnt manage to figure out it yet so the string is first split into array by each character and then turned into "0xFF" form.

  17. #17
    crossconscious
    Join Date
    Sep 2005
    Location
    Belgium
    Posts
    1,188
    Now anyone with swf decompiler can see those from your swf.
    True, but at the time being, I don't think there are any as3/f9 decompilers...
    This example should trace 9 and 100. Anyone decompiling the file can only see that string, not the function or variable.
    Also true, but if they're a bit smart, they can turn the string into an swf and decompile that too. It's another layer of difficulty, and you could xor everything to hide it even more (which still isn't secure since the key would be in the swf as well).

    Edit : nice little experiment though

  18. #18
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Quote Originally Posted by Fall_X
    if they're a bit smart, they can turn the string into an swf and decompile that too. It's another layer of difficulty, and you could xor everything to hide it even more (which still isn't secure since the key would be in the swf as well).
    Absolutely, nothing is completely 100% secure. But most Flash games are not hacked by Flash experts, the hackers use compilers (mostly hacked versions) which allow changing the strings, bitmaps and code pieces without ever opening the Flash. The famous "arcade" hackers site had tutorials for novice users explaining how to get hacked decompiler, how to get swf from browser cache and how to change _url check code. Once the swf gets complicated enough so it requires knowledge of Flash, they wont bother anymore. I mean if they know how to break every swf they can also build similar game from scratch.

    You dont even have to include the bytecode inside swf, you can load it dynamically from server using binary socket.

    The example only has little piece of code as bytecode, but you can include bitmaps, sounds and everything else same way. That again would make businesses selling programs for "change bitmap graphics inside swf files with simple button click" slightly more difficult. Once the game-specific code is hidden as bytecode and game wont run without it, you would need to get all the code out first, then save whole file as fla, get the data from bytecode, recompilde bytecode into swf, decompile this swf, find the code which prevents stealing, change the data, create bytecode from changed swf, create new swf from old fla and new bytecode. It is surely more complicated then current way of hacking by "replace url string".

  19. #19
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Excellent work T

    Squize.

  20. #20
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    I think this fits better in AS3 forum now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center