Welcome, Guest
  • Author Topic: Don't forget  (Read 2464 times)

    GMic

    • Server what's that
    • *
    • Posts: 2
      • View Profile
    Don't forget
    « on: 12/31/07, 03:21 »
    Hi every one,

    I've been reading some of the posts about "Remoting with AS3 (Flash-Flex examples) SimplePerson class" needing help cause it doesn't work for X,Y,Z reason.

    I've been experiencing just about the same BadConnection error when testing the samples extracted from the ZIP as is!

    OK...  The answer is quite simple in fact.  If your AMFPHP installation work fine with the HelloWord sample and the DiscoveryService installed with your copy of AMFPHP check code for a couple of thing.  They are missing in the sample files from the tutorials.

    First :  Never assume that the <? opening tag in the file IS ok with YOUR setup of PHP...  As I remember Default distribution of PHP 5 come with the short starting tag option disabled so use <?php instead.  Some other distributions may come with other configuration.

    I don't want to blast but good tutorials should ALWAYS use STANDARD coding so they are usable by every one!

    Secondo:  AMFPHP NEED A "METHODS TABLE" in the constructor of the class OR that you use include_once(AMFPHP_BASE . "shared/util/MethodTable.php"); before the class definition so AMFPHP take the time to create is own methods table for export to flash.

    Finaly, you should edit sample files from any tutorials and save it back with proper encoding.  So if by default your PHP is using UTF-8 save your files in UTF-8.  By the way UTF-8 is the prefered encoding of Flash when doing remoting (Was with my old Flash CS i'didn't had the time to check in CS3)

    After correcting those little things the sample files work fine in AMFPHP Services Browser and I was able to test their methods outputs.

    Ohhh,  By the way, Nice tutorials...  Once corrected I've been able to work on another project of mine that I'm upgraging to CS3.  The PHP side was OK since it already use AMFPHP but I needed the Flash CS3 side.

    Have fun coding!

    GMic

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: Don't forget
    « Reply #1 on: 12/31/07, 05:31 »
    I totaly agree with you about the coding of tags.
    Tutorials and hints should never use special settings, unless it is stated extra.

    Your second statement is only right, if you use an older AMFPHP-Version. If you use 1.9 up, it does not require the Methods table anymore.

    Plus it has some other benifits you might like - see amfphp homepage.

    Happy new year
    happy flashing
    8)
    Ronald

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Don't forget
    « Reply #2 on: 12/31/07, 06:02 »
    Hi

    I have added the php opening tags and updated the tutorials files
    Requirements on Tutorial specify amfphp 1.9 beta 2 and gives the link to download it, no methodTable needed on this version
    No text files to save as UTF8, anyway amfphp use UTF8 as the default encode to pass data, if you want to change encoding to some other, you should change on gateway.php

    Jorge

    GMic

    • Server what's that
    • *
    • Posts: 2
      • View Profile
    Re: Don't forget
    « Reply #3 on: 12/31/07, 12:32 »
    Hummmm OK,

    Seem that I did something wrong wen changing my version of AMFPHP.  Now everything seem to work without the need of MethodTable.

    But now I'm stuck...  I need to control access with credentials, 5 ½ Blog tell about creating a beforeFilter($methodName) and _autenticate is gone for now...

    Where is the REAL documentation about version 1.9?  Stuff in the Docs section of amfphp.org is obsolete.




    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: Don't forget
    « Reply #4 on: 12/31/07, 12:57 »
    Weird - I have some projects running under 1.9 (even though it is beta) and never had the authentication problem.

    My hope is the 2.0 Version soon :D
    happy flashing
    8)
    Ronald