Post by Phil / October 23rd, 2009

Super simple Flash example of the Indexhibit frontend

Finally we finished the “super simple” Flash example of our frontend for Indexhibit.
You can read more about the whole Flash / Indexhibit story here, here and here or just grab the new files and try for yourself …

simple indexhibit example

The previous sources/example was ActionScript-only and had to be compiled using the Flex compiler – this one comes as a FLA-file with a few classes to back it up. But only two of those classes are really of any interest to you if you want to customize the whole thing visually.

SimpleExample.as (document-class set via properties panel in flash)
Exhibit.as (this one is linked to the exhibit movieclip in the library)

We tried to keep the example as basic as possible so there is no real “animation-mania” or something going on – some timeline tweenings, that’s all.

If you’re interested in building your own flash frontend for Indexhibit, just open the FLA-file and start from there … if you then still have any questions, don’t hesitate and leave us a comment.

Grab the sources here: http://apdevblog.com/examples/indexhibit_simple/src/apdev_ndxz_simple.zip
Or take another look at the example: http://apdevblog.com/examples/indexhibit_simple/

If you want to use your own Indexhibit installation and build a flash-frontend on top of that, you have to download the amf-package and put it in the root-directory of your webserver. change the dbaccess.php in the amf/includes folder to your database-name and -login … et voilà the remoting gateway should be running smoothly. The next thing you have to change is the SERVER_URL in the SimpleExample-class in Flash – it should be your server’s name not ours ;)

That’s it for now … cheers

1 Trackback

62 Comments

  1. mawksyApril 18th, 2010 / 22:04 / #1044

    Dang it, my message got cut off!

    Ok so OUT WINDOW:
    DEBUG: amf::RemoteGateway – call(com.apdevblog.examples.indexhibit.Indexhibit,getAllExhibits,null)
    INFO: amf::RemoteConnection – RemoteConnection()
    DEBUG: amf::RemoteGateway – _connection.call(com.apdevblog.examples.indexhibit.Indexhibit.getAllExhibits) [object RemoteConnection]
    DEBUG: amf::RemoteGateway – >>> callParams com.apdevblog.examples.indexhibit.Indexhibit.getAllExhibits,[object RemoteGateway]
    DEBUG: amf::RemoteGateway – onNetStatus() NetConnection.Call.BadVersion error

    *** ERROR *** com.apdevblog.amf::RemoteGateway ***
    Problems communicating with remote gateway!

  2. mawksyApril 18th, 2010 / 22:07 / #1045

    Charles says:
    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/mawksy0/public_html/amf/services/com/apdevblog/examples/indexhibit/Indexhibit.php on line 13

    I created a crossdomain.xml file, so we’re good there, AND (I think I made the dbaccess.php and simpleExample.as file with the correct settings)

    But as you can see the loading bar is infinite. :(

    Please help me!

  3. PhilApril 22nd, 2010 / 15:39 / #1063

    hi mawksy,
    did you change anything in the Indexhibit.php file?
    either you did and that’s why there’s a parse error or your server isn’t running php5 and doesn’t recognize the “public” in

    public function Indexhibit()

    if so, delete the two “public”s in the Indexhibit.php and everything should work properly.

    cheers
    phil

  4. mawksyApril 22nd, 2010 / 16:43 / #1068

    Hey Phil, I did not make any changes, but here is what my index.php file looks like:

    db->fetchRecord(“SELECT *
    FROM “.PX.”objects, “.PX.”objects_prefs
    WHERE url = ‘$uri’
    AND status = ’1′
    AND object = obj_ref_type”);

    if (!$rs)
    {
    // try again with site root
    $rs = $OBJ->db->fetchRecord(“SELECT *
    FROM “.PX.”objects, “.PX.”objects_prefs
    WHERE url = ‘/’
    AND status = ’1′
    AND object = obj_ref_type”);

    // we don’t search engines indexing this
    header(“HTTP/1.1 404 Not Found”);

    // we need a formal error page
    if (!$rs) echo ‘Page not found error here.’;
    }

    // autoload ‘plugins’ folder
    include DIRNAME.BASENAME.’/site/plugin/index.php’;

    // additional variables
    // perhaps we should port these differently?
    $rs['baseurl'] = BASEURL;
    $rs['basename'] = BASENAME;
    $rs['basefiles'] = BASEFILES;
    $rs['gimgs'] = GIMGS;

    // get the front end helper class
    $OBJ->lib_class(‘front’);

    // time for some action
    if ($rs['obj_theme'] == ‘eatock’)
    {
    $contents = $OBJ->front->front_eatock();
    }
    else
    {
    $filename = DIRNAME . BASENAME . ‘/site/’ . $rs['obj_theme'] . ‘/index.php’;
    $fp = @fopen($filename, ‘r’);
    $contents = fread($fp, filesize($filename));
    fclose($fp);
    }

    // makin’ stuff happen
    $PARSE =& load_class(‘parse’, TRUE, ‘lib’);
    $PARSE->vars = $rs;
    $PARSE->code = $contents;
    echo $PARSE->parsing();

    // do stats if they are wanted
    if ($default['statistics'] == TRUE) load_class(‘statistics’, TRUE, ‘lib’);
    exit;

    ?>

  5. mawksyApril 22nd, 2010 / 16:43 / #1069

    db->fetchRecord(“SELECT *
    FROM “.PX.”objects, “.PX.”objects_prefs
    WHERE url = ‘$uri’
    AND status = ’1′
    AND object = obj_ref_type”);

    if (!$rs)
    {
    // try again with site root
    $rs = $OBJ->db->fetchRecord(“SELECT *
    FROM “.PX.”objects, “.PX.”objects_prefs
    WHERE url = ‘/’
    AND status = ’1′
    AND object = obj_ref_type”);

    // we don’t search engines indexing this
    header(“HTTP/1.1 404 Not Found”);

    // we need a formal error page
    if (!$rs) echo ‘Page not found error here.’;
    }

    // autoload ‘plugins’ folder
    include DIRNAME.BASENAME.’/site/plugin/index.php’;

    // additional variables
    // perhaps we should port these differently?
    $rs['baseurl'] = BASEURL;
    $rs['basename'] = BASENAME;
    $rs['basefiles'] = BASEFILES;
    $rs['gimgs'] = GIMGS;

    // get the front end helper class
    $OBJ->lib_class(‘front’);

    // time for some action
    if ($rs['obj_theme'] == ‘eatock’)
    {
    $contents = $OBJ->front->front_eatock();
    }
    else
    {
    $filename = DIRNAME . BASENAME . ‘/site/’ . $rs['obj_theme'] . ‘/index.php’;
    $fp = @fopen($filename, ‘r’);
    $contents = fread($fp, filesize($filename));
    fclose($fp);
    }

    // makin’ stuff happen
    $PARSE =& load_class(‘parse’, TRUE, ‘lib’);
    $PARSE->vars = $rs;
    $PARSE->code = $contents;
    echo $PARSE->parsing();

    // do stats if they are wanted
    if ($default['statistics'] == TRUE) load_class(‘statistics’, TRUE, ‘lib’);
    exit;

    ?>

  6. mawksyApril 22nd, 2010 / 16:48 / #1070

    This is the index.php that is located in the root folder. As you can see the indexhibit installs itself in a folder called “ndxz-studio”. No where is there a Indexhibit.php or public function Indexhibit() that I can see (using find).

    Help me! :)

  7. mawksyApril 22nd, 2010 / 16:54 / #1071

    Oh and yes I am running PHP5.

  8. mawksyApril 28th, 2010 / 23:26 / #1085

    No love on this eh? Too bad…

  9. PhilApril 29th, 2010 / 08:35 / #1088

    hi. there should be a folder called “amf/services/com/apdevblog/indexhibit” or something similar – don’t know exactly ;)
    in there you find the indexhibit.php. but if you’re running php5 this should not be the problem. but try to remove the “public” anyway.

    if it’s still not working, you can send me the whole site zipped – and i will take a look.

  10. PiKEJune 13th, 2010 / 11:49 / #1178

    Hi guys, playing around with this great app. and learning a lot on the way, thank for that. I’m trying to get the captions of the pictures to show up but I have no idea where to start. I guess the amf services need to be adjusted…
    thx in advance.

  11. DenisJanuary 17th, 2011 / 16:47 / #1517

    Hi

    pureMVC is too complicated for me :) .. can these be done without it?
    simple flash with few classes and maybe a amfphp to do the remoting?

    thx in advance.

  12. PhilJanuary 20th, 2011 / 11:26 / #1519

    hi dennis,
    with the “simple example” you don’t need any puremvc – just take a look at the sources.
    there are some classes and a FLA file.

    best
    phil

Post a comment