Jump to content
Search Community

test84

Members
  • Posts

    9
  • Joined

  • Last visited

test84's Achievements

0

Reputation

  1. Thanks, I solved it finally. For future people who may get here via google, you can find a tutorial on how to do so here:http://iokat.com/posts/3/loading-external-images-for-use-with-flixel-sprites. Thanks for this fantastic library, even though I just used a small part of it, I know I can rely on it for future problems.
  2. Thanks, problem solved but I have no idea why. I tried for several hours and suddenly it works. I think it's because of a restart I did. Now I have another problem: http://forums.greensock.com/viewtopic.php?f=6&t=6906
  3. Let me rephrase myself: I basically want to create a Class data type and wrap bitmapData around it so I can pass it to flixel's loadGraphic because it just accepts Class.
  4. Hi, How I can convert what ImageLoader loads into flash's Class type? -tnx
  5. Hi, First of all thanks for such great library. How I should address the image file in my code? Should it be relative to the SWF file or as we normally do with Embed syntax? I'm asking this because LoaderMax.getLoader is giving null pointer errors and I suspect it being not able to find the image files. It's driving me nuts, I tried every possible path I can come up with like static or relative paths, with \ or /, single or double quote, no luck. Address works in EMBED syntax but same thing doesn't in loader: override public function create():void { var loader: LoaderMax = new LoaderMax({ name: "imageLoader", onProgress: progressHandler, onComplete: completeHandler, onError: errorHandler}); // The image is not in the source folder, but in the output of the SWF! // loader.append(new ImageLoader('src/data/sprites/player.png', { name: "photo1" } )); loader.append(new ImageLoader('H:/Flash/WIP/trunk/src/data/sprites/player.png', {name: "photo1"})); loader.load(); } private function progressHandler(event:LoaderEvent):void { trace("progress: " + event.target.progress); } private function completeHandler(event:LoaderEvent):void { var asd:* = LoaderMax.getLoader("photo1"); AssetsRegistry.playerSprite.pixels = LoaderMax.getLoader("photo1").rawContent.bitmapData; FlxG.switchState(new PlayState); } private function errorHandler(event:LoaderEvent):void { trace("error occured with " + event.target + ": " + event.text); } compiler halts at: AssetsRegistry.playerSprite.pixels = LoaderMax.getLoader("photo1").rawContent.bitmapData; saying that it's a null pointer. I tried looking inside the lodaer after the load call and it's _rawContent is null. So I think it cannot find the image file. Thanks in advance.
  6. I just found it somewhere but because it limits my movements, as I mentioned I can add variations to it, I wanted to find a way to do it with Tweenmax because I know somewhere inside it has this functionality but I can't just find it via preview demos on the site.
  7. Thanks for your interest in this topic, I currently use a precalculated array of cosine and use it as: TweenMax.to(this, 2, { bezier:[ { x:Registry.player.x + xIterator} ] } ); TweenMax.to(this, 2, { bezier:[ { y:Registry.player.y - 40 + sineWavePreCalculated[sineWaveIterator] } ] } ); But the results are fixed and I can't have randomness in it. Since this is movement for my enemies, they will move just like each other so if I add a little random number anywhere, it will break apart. That's why I wanted to use TweenMax's own sine methods. If only you could help me to replace second line's precalculated cosine values with help of TweenMax, that would be great.
  8. Thanks, I tried your code but it moves very very linearly .
  9. Hi, I'm making a flying enemy, like how you see in most platformers, from NES's Ninja Gaiden to God of War, and I can make it go and stay on top of player's head but after that I need to make it move to left and right in shape of a sine wave while maintaining it's position on top of the player. (I mean it should go up and down and left and right. to be more precise: it's x should be varying from like player.x - 40 to player.x + 40 and it's y should be from player'sTop.y - 40 to player'sTop.y + 40 but keep form of a sine wave, hope I made myself clear enough) I'm using Tweenmax for the first part, so you can give me examples on using that, I saw a Sine ease in but I want to move in both directions so I couldn't use it. tnx!
×
×
  • Create New...