actionscript-3

AS3 - Error #2025: The supplied DisplayObject must be a child of the caller

你离开我真会死。 提交于 2020-01-24 01:35:07
问题 After 2 days of trying and searching for an answer I still didn't found it. I keep getting Error #2025: The supplied DisplayObject must be a child of the caller. I'm making a game where if the user hits an enemy, the enemy get destroyed. The code: My main class package classes { import flash.display.MovieClip; import flash.events.Event; import flash.utils.Timer; public class Main extends MovieClip { var enemyTimer:Timer; public function Main() { var user:ship = new ship(); addChild(user);

Autosize text to fit the width of a button

风格不统一 提交于 2020-01-24 01:18:09
问题 I've had a good look around but couldn't find anything that directly solves my problem. There are several posts which are along the right lines, but I can't get my head around it in order to fix the issue. I need to automatically resize the text so that it doesn't exceed the width of the button. The maximum length for my sized text appears to be 13 characters before it will become too large. -- The program starts by dynamically creating several buttons, filling them with the title and

AS3 - Friction(?) causing Movie Clip to jump, temporarily alter path (playable SWF included)

心不动则不痛 提交于 2020-01-24 00:56:05
问题 Im making a game in FlashBuilder where the player controls a movieclip (_character) around the stage with the arrows or WASD. On the stage there are squares/boxes with collision detection and a 50 pixel border around. While testing Ive noticed that if I hold a direction key, then switch to another AND the MovieClip is travelling past a gap in the boxes, the movieclip will jump a few pixels in the previous pressed direction, then back down again quickly. It’s a split second flicker but creates

Loading external Swf - sandbox violation

丶灬走出姿态 提交于 2020-01-23 19:55:11
问题 I need a help ... an urgent one !!! I tried so hard to figured it out .. but I couldn't .. so I appreciate your help so much .. I'm developing an Air App using flash ... the app loads an external SWF file dynamically through an xml ... the SWF file has a movieclip that has a listener (ON click ) function mouseDownHandler(event:MouseEvent):void { navigateToURL(new URLRequest(clickURL)); } Everything is working fine until I click on this movieclip ... it displays the below message SecurityError

Loading external Swf - sandbox violation

折月煮酒 提交于 2020-01-23 19:55:08
问题 I need a help ... an urgent one !!! I tried so hard to figured it out .. but I couldn't .. so I appreciate your help so much .. I'm developing an Air App using flash ... the app loads an external SWF file dynamically through an xml ... the SWF file has a movieclip that has a listener (ON click ) function mouseDownHandler(event:MouseEvent):void { navigateToURL(new URLRequest(clickURL)); } Everything is working fine until I click on this movieclip ... it displays the below message SecurityError

Post-processing captured video in AS3, creating slow motion

假如想象 提交于 2020-01-23 18:55:49
问题 I have an interesting project wherein I need to allow users to capture video of themselves with a webcam at a kiosk, after which I email them a link to their video. The trick is the resulting video needs to be a 'slow motion' version of the captured video. So for example, if someone creates a 2 minute movie, the resulting movie will be 4 minutes. I'd like to build this in Flex / AS3 if possible. I don't have issues capturing the video and storing it / generating and emailing a link, but

Height and width of a SWF file in html

白昼怎懂夜的黑 提交于 2020-01-23 09:20:27
问题 In the following code Only the button image has been embeded into the flex code.But in the html object or embed tag why the height and width has to be specified.Even though for this is a normal button if we do not specify the height and width there seems to be some error html <div align="center"> <br /> <div style="display:block;width:100px;height:100px;" id="audio" class="testsound" align="center"/> <p class="clickable"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400

Height and width of a SWF file in html

ε祈祈猫儿з 提交于 2020-01-23 09:20:21
问题 In the following code Only the button image has been embeded into the flex code.But in the html object or embed tag why the height and width has to be specified.Even though for this is a normal button if we do not specify the height and width there seems to be some error html <div align="center"> <br /> <div style="display:block;width:100px;height:100px;" id="audio" class="testsound" align="center"/> <p class="clickable"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400

communication between two flex apps

久未见 提交于 2020-01-23 06:38:45
问题 I have 2 flex apps on the same page. I want them to be able to call each other's public functions. I am thinking of using either externalInterface calls or FaBridge to do so. Is there a better way to do it? 回答1: The best way to go is to use LocalConnection. It allows you to call methods from a separate SWF without having to go through Javascript or a server. Tip: if you're going to be sending arguments that are greater than about 20KB in size, you will want to split them up in two or more

What is the best approach to moving a preexisting project from Flash 7/AS2 to Flex/AS3?

徘徊边缘 提交于 2020-01-23 06:23:48
问题 I have a large codebase that targetted Flash 7, with a lot of AS2 classes. I'm hoping that I'll be able to use Flex for any new projects, but a lot of new stuff in our roadmap is additions to the old code. The syntax for AS2 and AS3 is generally the same, so I'm starting to wonder how hard it would be to port the current codebase to Flex/AS3. I know all the UI-related stuff would be iffy (currently the UI is generated at runtime with a lot of createEmptyMovieClip() and attachMovie() stuff),