actionscript-3

Changing the direction of a ball on collision base on speed

给你一囗甜甜゛ 提交于 2019-12-25 06:19:20
问题 I am creating a ping pong game. And I want to create the ability to control the direction of the ball based on the impact on the paddle. If the ball is coming down at vy = 4; vx = 4; and the paddle is moving to the left at vx = -5; I want the ball to slightly change its course depending on how fast the paddle is moving. It would probably reduce the balls vx speed on collision, therefore making the ball move more straight (close to the Y axis) when it is moving back up. But before I go on a

flvplayback component doesn't stop playing upon exitframe

时光总嘲笑我的痴心妄想 提交于 2019-12-25 06:13:38
问题 I have an instance of an flvplayback component on a frame (not the first frame) on a timeline in a flash AS3 flash app file. I would like to stop the movie when i exit that frame, either via gotoAndStop() or whatever else. Is there a listener for this? Or any solution that people know of? Thanks, jml 回答1: You could always add an ENTER_FRAME listener to the parent MovieClip, check if currentFrame yields the correct frame number, and stop the FLV if it doesn't. But if I understand correctly,

flvplayback component doesn't stop playing upon exitframe

半腔热情 提交于 2019-12-25 06:12:22
问题 I have an instance of an flvplayback component on a frame (not the first frame) on a timeline in a flash AS3 flash app file. I would like to stop the movie when i exit that frame, either via gotoAndStop() or whatever else. Is there a listener for this? Or any solution that people know of? Thanks, jml 回答1: You could always add an ENTER_FRAME listener to the parent MovieClip, check if currentFrame yields the correct frame number, and stop the FLV if it doesn't. But if I understand correctly,

Action script 3 drawing app undo and redo function

若如初见. 提交于 2019-12-25 05:56:55
问题 Can anyone show me how can I make undo and redo function? so this is my current action script. I cant figure how to do it and i see some example in some web site, the action script is to long to under stand. Pls show a simple way that i can make this work.. sorry for bad grammar... import flash.display.MovieClip; import flash.events.MouseEvent; var pen_mc:MovieClip; var drawing:Boolean = false; var penSize:uint = 1; var penColor:Number = 0x000000; var shapes:Vector.<Shape>=new Vector.<Shape>(

AS3 browse and load video

戏子无情 提交于 2019-12-25 05:44:23
问题 I'm currently working on a AS3 AIR project which involves allowing the user to browse a video file and load that same video onto the stage. I've managed to allow the user to browse for a video file type and according to my traces it completes loading the video but this is as far as I've got. There is plenty of tutorials which involve how to load video files from local sources or external links but nothing to show me what to do with a browsed file to display it on the stage. Here is the code

AS3 browse and load video

北战南征 提交于 2019-12-25 05:44:01
问题 I'm currently working on a AS3 AIR project which involves allowing the user to browse a video file and load that same video onto the stage. I've managed to allow the user to browse for a video file type and according to my traces it completes loading the video but this is as far as I've got. There is plenty of tutorials which involve how to load video files from local sources or external links but nothing to show me what to do with a browsed file to display it on the stage. Here is the code

Getting Actual Facebook and Twitter Profile Image URLS for Flex Security Policy

拥有回忆 提交于 2019-12-25 05:35:14
问题 I'm trying to display the profile images from both facebook and twitter. For facebook, the URLs I'm receiving are something like this (not actual urls): http://graph.facebook.com/965412145/picture Which is then redirected to the 'actual' url like this: http://profile.ak.fbcdn.net/hprofile-ak-snc4/370471_9631690_1796253478_r.jpg I'm also doing this with twitter, with the same issue (redirected url). So, when I load the image, it loads fine. But when I close the container that the image is in,

Unable to call access session variable

你离开我真会死。 提交于 2019-12-25 05:32:30
问题 I have a flash app which captures image thorugh webcam and stores it in a file throught save.php (below). Now the problem I have is that I am unable to access my session variables when save.php is loaded. Is there a different method I need to use when calling session variables? <?php include 'session.php'; sec_session_start(); $userid=$_SESSION['user_id']; $w = 300; $h = 400; $img = imagecreatetruecolor($w, $h); imagefill($img, 0, 0, 0xFFFFFF); $rows = 0; $cols = 0; for($rows = 0; $rows < $h;

AS3 - Memory management

依然范特西╮ 提交于 2019-12-25 05:32:29
问题 I have a question regarding AS3 memory management I wonder if anyone could help me with. Supposing I created an instance variable for a Class, in this case or type Sound: public class SoundStore extends Sprite{ var s:Sound; Then within various class functions I referenced this variable multiple times, each time I wanted to load in a new sound: s = new Sound(); Am I correct in thinking that each time I created a new Sound I would be overwriting the previous allocated memory? Thanks 回答1: No.

Unable to call access session variable

本秂侑毒 提交于 2019-12-25 05:31:02
问题 I have a flash app which captures image thorugh webcam and stores it in a file throught save.php (below). Now the problem I have is that I am unable to access my session variables when save.php is loaded. Is there a different method I need to use when calling session variables? <?php include 'session.php'; sec_session_start(); $userid=$_SESSION['user_id']; $w = 300; $h = 400; $img = imagecreatetruecolor($w, $h); imagefill($img, 0, 0, 0xFFFFFF); $rows = 0; $cols = 0; for($rows = 0; $rows < $h;