Home News Features Games Authoring Community Forums About Contact
   

May 20, 2013, 12:18:06 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1] 2 3
  Print  
Author Topic: Playing around with Adobe Flex  (Read 4192 times)
Kickaha
Longtime Member
*****
Offline Offline

Posts: 1023



WWW
« on: May 23, 2010, 07:18:29 AM »

I've been experimenting with Adobe Flex recently.  The aim is for a 1st person game framework where the scenes are defined as XML files, the XML files defining object structures where the object classes are implemented in ActionScript 3.  Part of the fun for me in doing this is to play around with Flex itself.

Have not got very far yet, don't know how much further I will get, but see http://www.alofmethbin.com/h10/blog.php if interested. 
Logged

ad7venture
Longtime Member
*****
Offline Offline

Gender: Male
Posts: 3129



WWW
« Reply #1 on: May 23, 2010, 07:44:53 AM »

Nice start Kickaha.  I'll enjoy seeing your updates.  Will you be able to load all the images at once or will they stream?  Flash is such a nice way to share games I think.  You know, skipping all the download stuff.
Logged
Kickaha
Longtime Member
*****
Offline Offline

Posts: 1023



WWW
« Reply #2 on: May 23, 2010, 10:48:40 AM »

I'm ready to learn from others here - what I'm doing is fairly naive and first-cut.  The main gain may be learning about Flex and ActionScript.

The images at the moment are loaded on demand, they're not embedded in the SWF file.  Don't know if one can cache them in any way on the client side, so if they're downloaded they have to be downloaded again.

Having spent too much effort on builds and installers I like the idea of Flash (and similar browser ware) for its immediacy.
Logged

Imari
Sr. Member
****
Offline Offline

Posts: 452



WWW
« Reply #3 on: May 23, 2010, 11:23:29 AM »

Hi Kickaha,

Your link "something to show" netted me just a blank page.   I'm on a brand new computer with not much added thus far.  Do I need to download Flash? or Flex?  or some other net add-on to view?

Thanks and good luck with this.
Cleo
Logged
Kickaha
Longtime Member
*****
Offline Offline

Posts: 1023



WWW
« Reply #4 on: May 23, 2010, 12:09:38 PM »

Hello Imari,

You'll need Flash to view the SWF embedded on the page.  I'll need to see why it's not prompting you to install the Flash plugin, sorry about that.  Your brand new computer is running what OS?  Can you see other Flash pages?

Thanks for telling me about the problem!

Kickaha.
Logged

Imari
Sr. Member
****
Offline Offline

Posts: 452



WWW
« Reply #5 on: May 23, 2010, 01:05:31 PM »

Kickaha, I do have Flash and I just installed version 10 of the player to be sure.  I think that I mistook a very slow loading of the page for a blank page.  It's been loading now for a few minutes and is about 1/3 done.   Sorry for the false alarm.
Logged
Kickaha
Longtime Member
*****
Offline Offline

Posts: 1023



WWW
« Reply #6 on: May 23, 2010, 04:37:46 PM »

Thanks Imari - looking at Ad7venture's Castle page I need to do something different in the HTML.  The image and SWF are both about 100K in size, perhaps I need to host them somewhere faster.  Sorry for the slowness.
Logged

NigeC
Guest
« Reply #7 on: May 23, 2010, 05:53:38 PM »

its not loading for me either mate

edit..
Ok in FireFox I get an image of a front door, wont load at all in IE8
even with FF it says on the status bar its tranfering data

usual with html the flash code is:
Code:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>splash</title>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("This page requires AC_RunActiveContent.js.");
} else {
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width','400','height','400','align','middle','src','splash','quality','high','bgcolor','#ffffff','allowscriptaccess','sameDomain','allowfullscreen','false','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','splash' ); //end AC code
}
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="400" height="400" align="middle">
  <param name="allowScriptAccess" value="sameDomain" />
  <param name="allowFullScreen" value="false" />
  <param name="movie" value="splash.swf" />
  <param name="quality" value="high" />
  <param name="bgcolor" value="#ffffff" />
  <embed src="splash.swf" quality="high" bgcolor="#ffffff" width="400" height="400" align="middle" allowscriptaccess="sameDomain" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</noscript>
</body>
</html>

it also uses a java script in a folder called "Scripts"
file name:AC_RunActiveContent.js
Code:
//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?');
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs)
{
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret =
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret =
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();   

    switch (currArg){
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace":
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}
« Last Edit: May 23, 2010, 06:03:44 PM by NigeC » Logged
Lumlicious
Newbie
*
Offline Offline

Posts: 5


« Reply #8 on: May 23, 2010, 08:15:06 PM »

Hello Kickaha,

You should check out the PanoSalado engine for displaying panoramic images.  It is completely open source and is compiled in flex.  It uses external xml files to load images, hotspots, sounds, and other stuff directly from the classes defined in the main .fla.  You could use this as a reference for your project or implement the 3d engine so you could create a panoramic game engine.  I am currently creating a game using the krpano engine but lack the necessary programming skills to create a full blown engine.  If you could create a full engine geared to adventure games, I would definitely use it.  My project is on this thread:  http://www.adventuredevelopers.com/forum/index.php?topic=2401.0
Logged
Imari
Sr. Member
****
Offline Offline

Posts: 452



WWW
« Reply #9 on: May 23, 2010, 10:51:59 PM »

Hi Kickaha, I'm sorry to say that it wouldn't load for me IE.  It very slowly loads in about 5 minutes to a point about 2/5th of the way on the green bar, then just hangs.   No image, just the white page.  Just FYI.
Logged
Kickaha
Longtime Member
*****
Offline Offline

Posts: 1023



WWW
« Reply #10 on: May 24, 2010, 02:45:23 AM »

OK there's things I need to learn about Flash first . . .

Thanks for the post Lumlicious - don't think I have the bandwidth to create a proper engine, and I at the moment definitely don't have the Flash knowledge.  As reference the PanoSalado engine should be very useful so thanks for the tip.
Logged

ad7venture
Longtime Member
*****
Offline Offline

Gender: Male
Posts: 3129



WWW
« Reply #11 on: May 24, 2010, 07:45:14 AM »

I was going to mention html loading instructions, but I see Nige mentioned that already.  Luckily Flash generates the code for me.  Grin 

« Last Edit: May 24, 2010, 07:48:10 AM by ad7venture » Logged
Kickaha
Longtime Member
*****
Offline Offline

Posts: 1023



WWW
« Reply #12 on: May 24, 2010, 09:12:57 AM »

Flex has an Ant task I can use for the wrapper HTML - it's step by step on this learning curve for me.
Logged

NigeC
Guest
« Reply #13 on: May 24, 2010, 09:46:31 AM »

Can't you create a projector with Flex? or are you set on  web based?
I must admit bandwidth for games was always an issue with the Lassie games, even a couple of meg game can eat it up at a scary rate.
I've almost convinced myself to continue with Lassie/Shepherd but converted to AIR so I can use 3D renders
Logged
Imari
Sr. Member
****
Offline Offline

Posts: 452



WWW
« Reply #14 on: May 24, 2010, 10:39:13 AM »

I was wondering that as well.  It's been years since I worked with Flash, but if I remember correctly, saving to the exe file was the only way to avoid that ugly right click pop-up.   Pano Salado looks interesting as well and it uses Flex, though I'm not sure that you could make a projector file with it since it depends upon externally stored xml files (at least that's what I got from skimming the site).   It is open source though.   So many possibilities.
Logged
Pages: [1] 2 3
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
 
Unauthorised reproduction of anything on this website is not allowed without our written consent.
Materials on this site are the property of their respective owners. Copyright © Adventure Developers. All rights reserved.