Profile

Member Since
November 03, 2011

Search Members

  

aholla

31
@aholla

Badges

This user hasn't earned any badges yet.

Posts

Viewing 1 to 20 (30 Total)

Re: drawTiles and animated sprites

ok thanks Hugh, so I have to create a tile rect for each animation cell and use a frame index to target the correct cell. Thanks for the reply.

Posted on January 18, 2012 at 6:21 AM

drawTiles and animated sprites

Hi, is there a work flow for using drawTiles (cpp target) and animted sprites.

In flash I am managing my own spritesheet, when the sprite in animating I changing the draw rect of the spritesheet. Is there a way to do this with drawTiles? I could use the "tileID" to alter the tileRects that have been saved if it was available?

at the moment I have to use a predefined rectangle and draw it in different positions:

var tilesheet = new Tilesheet(bitmapdata)
tilesheet.addTileRect(predefindedRect);
tilesheet.draw(x, y, predefindedRect_ID);

can I do the following or is there and alternative:

var tilesheet = new Tilesheet(bitmapdata)
tilesheet.addTileRect(predefindedRect);

tilesheet.tiles[predefindedRect_ID].x = new_spritesheet_location_X;
tilesheet.tiles[predefindedRect_ID].y = new_spritesheet_location_Y;
tilesheet.draw(x, y, predefindedRect_ID);

Now it would draw a new frame.

Does any of that make sense?

Posted on January 17, 2012 at 7:10 AM

Re: Sounds on html5

Hey niel, I've submitted a bug and uploaded my source (Flash Develop Project). If it is not a bug but in fact the way I am doing things, I would very much appreciate knowing what I am doing wrong.

Thanks,

Adam

Posted on January 16, 2012 at 4:19 AM

Re: Sounds on html5

So I finally got everything working in a range of browsers and computer... Now I have an issue with "SoundChannel". I have trying to adjust the volume with the following code (from the sound tutorial):

if(bgSound != null)
{
var soundChannel = bgSound.play(0, 999999);
trace("soundChannel: " + soundChannel);

var newTransform = soundChannel.soundTransform;
//newTransform.pan = 0;
newTransform.volume = 0.1;
soundChannel.soundTransform = newTransform;
}

Whw the code runs I get an error and the trace returns: "soundChannel: [ undefined ]".

I was wondering is this is something to do the sounds loading etc...

Thanks,

Adam

Posted on January 13, 2012 at 7:15 AM

Re: Sounds on html5

Hi Niel, thanks for the help and info. Lots to be learn!

Posted on January 12, 2012 at 3:52 PM

Re: Sounds on html5

Hi, I am also having trouble with html5 and sounds and Chrome.

I am not sure if it is jeash or Chrome itself.

Here is the error:
XMLHttpRequest cannot load file:///D:/_WORK/hxProto/bin/html5/bin/assets/sounds/button.wav. Cross origin requests are only supported for HTTP.
HxProto.js:11579
XMLHttpRequestProgressEvent
HxProto.js:12912Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101



Is it having a problem loading the local files or is it a file type thing? I have tried every filetype and get the same error. I am also testing for the file type before trying to load the file but as this happend for each file type I am not sure it is a jeash problem.


So using the following code (updated api):

if (Sound.jeashCanPlayType("wav"))
{
trace("I can play wav sounds"
btnSound = Assets.getSound("assets/sounds/button.wav");

}

In Chrome which supposedly doesnt play wav files, this ".jeashCanPlayType" method returns true. Then Jeash throws an error abount not being able to load the "button.wav" sound. It throw the error regardless of the file type.

Am I doing something wrong? ANd I am using the release build of jeash via the haxelib 0.8.7.

Thanks,

Posted on January 12, 2012 at 11:50 AM

Re: KeyboardEvent.keyCode shows wrong values on cpp (windows)

HI, I have also just run into this. I really think NME should standardise this. Flash and JS targets are the same but CPP is different. I think NME should handle the conversion of the FLASH keycodes to the CPP keycodes unless there is something I am missing.

Posted on January 12, 2012 at 5:25 AM

Re: Disable Jeash...

Thanks for the replies Hugh and Joshua, I think jeash does a great job but I don't think I need all of it's complexity and can achieve faster rendering using the Haxe JS. I think wth a few compiler conditionals I will be fine but I may look into the remap feature if my own code gets large enough. Thanks!!

Posted on January 11, 2012 at 4:22 AM

Disable Jeash...

Hi, I was wondering if there was a way to build to an HTML5 target without using Jeash. I would like to use compiler conditionals to write my own JavaScript specific code but also use some of the NME packages like "geom" for things like Point, Rectangle etc... Also this means I could use the same workflow for each target rather than having to break out into a Haxe specific project.

I was wondering if I were to continue to use the packages but include "js" into the (cpp || neko) condition, then it would use the custom class rather than using the typeDef that points to the flash package.

I know this probably defeats the point of NME, but I really like the work flow and it does make it very easy to target multi-platform but I need a little more contol over some of it.

Posted on January 10, 2012 at 12:01 PM

Jeash error on run

Script error.

Called from jeash.net._URLLoader.Http::requestUrl
Called from jeash.net._URLLoader::load
Called from ApplicationMain:main


I get this error with no code, it just wont work. I hace other jeash javascript project that do compile however. Is this something anyone has come across before?



Edit: I rebuilt the project and copied the old code line by line looking for the error but it did not re-occur, so probably nothing to worry about.

Posted on January 10, 2012 at 10:52 AM

Re: Stoppping an Android build in Flash Develop

Ah cool, thanks Philippe!

Posted on December 24, 2011 at 11:21 AM

Re: Does NME (or haxe?) support importing resources from an SWC file?

@singmajesty Thanks for the info, you've actually just solved another of my problems! Also I have implemented your version of Box2D, thanks for the port, I am currently testing a few different engines, so far I prefer Box2D over Physaxe (documentation is better and the speed is quite similar) and I am currently testing Nape, so far it's faster in my tests but I can't get it to do anything in javascript.

I have only just realised about "<compilerflag>". Is there any way, to wire Flash Develope's "Additional Compiler Options" into this?

Thanks


@postite I did see that post, will have to wait and see I guess.

Posted on December 22, 2011 at 11:00 AM

Re: Input wanted -- drawTiles for Flash

drawTiles for HTML5 please!!

Currently the workflow for copyPixels and drawTiles are able to use very the same data (entity x/y positions). Using the display list in HTML5 (jeash) means adding another slightly different workflow.

Posted on December 22, 2011 at 9:38 AM

Stoppping an Android build in Flash Develop

Hi, this is not an NME specific bug/thing but when I build an android release in Flash Develop, how do I stop it?

I close the app on the phone but flash develop thinks a process is still running. I have to close Flash develop and restart it each time. When I do restart it i get the following error:

"
Only one usage of each socket address (protocol/network address/port) is normally permitted

at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Bind(EndPoint localEP)
at FlashConnect.XmlSocket..ctor(String address, Int32 port)
"


Thanks.

Posted on December 22, 2011 at 9:19 AM

Re: Does NME (or haxe?) support importing resources from an SWC file?

Can you use "-swf-lib" with NME, if so how? In FlashDevelop would it be in "Pre-Build Command Line or though Additional Compiler Options?

The reason I ask is because I wanted to use Nape Physics engine but the lib comes as a swf or swc. If you can use "-swf-lib", would the code work with hxcpp?

Posted on December 22, 2011 at 4:14 AM

MyApplication naming of Flash and Javascript

Setting the "app title" in the nmml only seems to work for CPP, Android and I guess iOS. Should it work for Flash and HTML5 also? If not it would be cool if it did. Thanks.

Posted on December 22, 2011 at 4:08 AM

Re: -swf-lib in Flash Develop with NME

Hey thanks for the reply. I will have to check if performance has been improved before I carry on. Thanks for the link.

Posted on December 06, 2011 at 4:41 PM

-swf-lib in Flash Develop with NME

Hi,

I am trying to include a swf library (Nape) and wondered how I do this with NME and flash develop. Is there a tag for it in the NMML file? Thanks, Adam

Posted on December 06, 2011 at 4:04 PM

Re: debugger

Hey sorry to dig up an old subject but I would like to know how to get trace output in Flash Develop and getting the Debugger to run too would be great. Im using FD4 RC2 and NME 3.1.


I have tried adding "<haxedef name="fdb" if="target_flash" />" to the nmml file (allow I don't belive its needed any more) and still nothing.

Thanks.

Posted on November 29, 2011 at 11:30 AM

Re: Add a directory

Thanks, yeah very simple in the end Thanks!

Posted on November 24, 2011 at 10:44 AM
« Previous12Next »