actionscript

swfloader: can I catch all the exceptions from the loaded swf?

老子叫甜甜 提交于 2019-12-23 06:01:53
问题 I am loading a swf into another swf using swfloader, I want to catch all the exceptions thrown by the inner swf, is it doable? 回答1: Here are some basics that may help. In short, you cannot use try/catch here. Errors in loading external content cannot be caught with try..catch..finally statements. Instead you have to create event handlers to handle and “catch” the error events. If you do not have an event listener assigned to an error event and that error occurs, the Flash player will inform

change color row in datagrid

会有一股神秘感。 提交于 2019-12-23 05:27:30
问题 I have a script that already meets me but would like to send warning signals to my client that something is wrong I was able to change the line color to red I'm working this can happen in diversar lines and not in sequence. How can I apply this setting? Below script: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ import mx.controls.Alert; import mx.controls.TextInput; import mx.events.DataGridEvent;

How do I make my hitTestObject() more precise?

随声附和 提交于 2019-12-23 05:22:26
问题 I'm doing some collision detection with a circle and a square and whenever the circle comes in contact with the square it bounces away changing its X coordinate by *-1. However, the Hit Area of the circle is a square, so even when it collides with the white area around the circle , the affect still occurs. My question is, is there a way to modify the hit area to closer resemble my circle? Thanks 回答1: Bitmap hit testing is pixel based (instead of boundary-based, like Sprite-based hit testing),

How to use a method of a class inside a callback function in actionscript?

纵然是瞬间 提交于 2019-12-23 05:12:17
问题 When you call a method of a class inside a callback function, you can not use this object. To call the method, in javascript, I declare that variable, assign this to that , and use that inside the callback to call the method of this . In actionscript, do I have to do the same way as I do in javascript? The following code is the example to use that to call a method inside callback. Are there more simple way in actionscript? class C { private var that:C; function C() { that = this } public

How to convert different line of a dynamic text box to Movie clip in AS3

梦想的初衷 提交于 2019-12-23 04:50:19
问题 I have a question regarding to my project which is How to convert different line of a dynamic text box to Movie clip in AS3? Actually, I have an text file named test.txt. For instance: It consists of: today is Sun; today is Mon; today is Tue; today is Wed; today is Thu; today is Fri; today is Sat; and then I want to put all of them into an array and then a string to show them in the dynamic text Box called text_txt. I have different objects in my library. If we see "sun" in the first line,

Flash ActionScript Grab Query String Value

谁说胖子不能爱 提交于 2019-12-23 03:32:04
问题 I need to grab values from the querystring and inject them into a getURL(""); snippet that's in the on (release) {} for a button. So if the URL that contains the embedded swf is http://domain.com/player.html?returndomain=otherdomain.com I'd like to get that otherdomain.com and inject it. Something like var returnUrl = ""; // do magic querystring getting getURL(returnUrl); *Edit: I need to snag the querystring because I don't have access to the embed code. It's being rendered by a third party

Flash ActionScript Grab Query String Value

六月ゝ 毕业季﹏ 提交于 2019-12-23 03:31:03
问题 I need to grab values from the querystring and inject them into a getURL(""); snippet that's in the on (release) {} for a button. So if the URL that contains the embedded swf is http://domain.com/player.html?returndomain=otherdomain.com I'd like to get that otherdomain.com and inject it. Something like var returnUrl = ""; // do magic querystring getting getURL(returnUrl); *Edit: I need to snag the querystring because I don't have access to the embed code. It's being rendered by a third party

Why can't I get Javascript to Talk to ActionScript

梦想与她 提交于 2019-12-23 03:23:12
问题 I have a very simple flash program that plays music. It consists of a play pause button and a timer that shows the current position of the song. I'm trying to make it possible to pause or play the song using a regular form button. <div class="musicplayer_playpause"> <script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','65','height','68','src','player','quality','high','pluginspage','http:/

Get ActionScript Classes that Implement an Interface

谁说我不能喝 提交于 2019-12-23 03:12:27
问题 In ActionScript (AS3) how do I find all the classes that implement a particular interface? 回答1: In OOP terms, you never want to be able to do this: the primary characteristic of interfaces is they are terms of a contract. Any class can choose to fulfill that contract and be able to say "I implement this interface". Any code that references an instance of the interface don't care what class actually implements it: they don't have to; that's the really cool part of interfaces. But if you want

Adding the replaceAll method to the ActionScript String class

北城余情 提交于 2019-12-23 01:53:02
问题 I need some help in adding the replace all functionality into my Flex project. I would prefer doing this in a way that is as natural as possible. What I want to achieve is to be able to run this code (with the Flex compiler) "aabbaaba".replaceAll("b","c") and get "aaccaaca" . Also I want to chain replaceAll calls. Note: I won't be actually replacing b s with c s, but various string that will not be known at coding time! What I don't want: 1. Use regular expressions with the global flag. The