actionscript-2

Play FLV in ActionScript 2

痴心易碎 提交于 2019-12-11 10:54:12
问题 I am very new to Flash and Actionscript. I am trying to simply play an FLV file. I have the following: import flash.MovieClip; import flash.Video; import flash.NetConnection; import flash.NetStream; class Program { private var container_mc : MovieClip; private var video_mc : Video; public function new() { var mc : flash.MovieClip = flash.Lib.current; container_mc = flash.Lib._root.attachMovie("VideoContainer", "container_mc", 0); container_mc.attachMovie("VideoClip", "video_mc", 1); var my_nc

Unable to invoke javascript from flash AS2

≯℡__Kan透↙ 提交于 2019-12-11 08:42:44
问题 First of all, I'm a complete noob in Flash and don't really know what I'm doing :/ (it's a favour for a friend). I'm working with CS6 and using action script 2. So I've seen many people suggesting using getURL("javascript:myFunction();"); or import flash.external.ExternalInterface; ExternalInterface.call("myFunction()"); for calling the method myFunction that I have in my html file (in the head). However, for some reason the method is not invoked. Apart of that I have in my frame code that

AS2: Are functions declared in a class stored as separate instances taking up more memory on each object instantiated?

只愿长相守 提交于 2019-12-11 06:17:53
问题 My question is about memory use and objects in actionscript 2. If I have a class definition: class test1{ public function one(){trace("Hello");} public function two(){trace("World");} } And a second class definition: class test2{ static public function one(){trace("Hello");} static public function two(){trace("World");} } And then I do the following: var object1a = new test1(); var object1b = new test1(); var object2a = new test2(); var object2b = new test2(); Is the size of object1a +

Calling a JavaScript function from flash movie controls

半世苍凉 提交于 2019-12-11 05:08:59
问题 I have a swf streaming an flv with the default controls from Flash. Is there a way to call a javascript function when the pause button is clicked? And then another when the play button is clicked? Thanks for any ideas. 回答1: An easy way is on the button controls simply call getURL("javascript:yourFunction();"); 回答2: The best way to do this is using ExternalInterface. Here's an example: AS: ExternalInterface.call("pauseFunction"); JS: function pauseFunction() { alert("Called from ActionScript")

Loading external pngs into an AS2 swf that is loaded into an AS3 swf wrapper

好久不见. 提交于 2019-12-11 02:04:56
问题 I have a Wrapper SWF that loads a series of AS2 movies. Each AS2 movie loads a series of .png files. AS3_wrapper.swf |-> AS2_1.swf |-> image_1.png |-> image_2.png |-> AS2_2.swf |-> image_1.png |-> image_2.png Inside of the AS2 I listen for the load of the pngs using onLoadInit and update my UI. This works fine for the first AS2 swf. But when I load the second AS2 swf the onLoadInit isn't triggered for the pngs. My guess is that the images are in a cache or something like that. I put a random

How can I get the width/height of a loaded swf's stage in AS2?

一曲冷凌霜 提交于 2019-12-11 01:41:08
问题 I'm using MovieClipLoader to load an external as2 swf file into my as2 flash project, and I'm having trouble getting the original stage size of the loaded swf. When I run the following code: var popup:MovieClip = _root.createEmptyMovieClip("popup", 1); var loader:MovieClipLoader = new MovieClipLoader(); var loadHandler:Object = new Object(); loader.addListener(loadHandler); loader.loadClip(url, popup); loadHandler.onLoadInit = function(mc:MovieClip) { trace(mc._width + ", " + mc._height); } I

External interface and Internet Explorer 9 issue

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 18:51:50
问题 Boy-oh-boy do I hate external interface. I have a video player that utilizes external interface to control the flash object and to allow the flash object to pass messages to the same javascript. For a time it worked well in all browsers. Then a few days ago i went to go test it in all browsers before i moved the project out of development, and found that the application broke in internet explorer 9. The following error appeared in the console: SCRIPT16389: Could not complete the operation due

How can I call an Actionscript function when the .swf is referenced by jQuery?

六月ゝ 毕业季﹏ 提交于 2019-12-10 10:35:17
问题 I have an .swf that I am embedding into HTML using the jQuery SWF Object plugin (http://jquery.thewikies.com/swfobject). I have a number of functions within the .swf that I need to call from within javascript functions. I've made these actionscript functions accessible to javascript by calling flash.external.ExternalInterface.addCallback(). Yet nothing happens when I make the call. I've had this happen before and it seems to be that when you reference the .swf from jQuery, you can't call

flash and actionscript dead? [closed]

自古美人都是妖i 提交于 2019-12-08 14:20:19
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . Hey I want to ask something more philosophical. I learned to code as2 when I was 13 later on I learned as3. Yes I wanted to do games. Today I'm way older and I have a question. Is actionscript development dead? Wasn't actionscript the API king of games as Kongregate and other

Flash AS2: How to POST CDATA to a server?

天涯浪子 提交于 2019-12-08 06:40:27
问题 I have an XML object that I want to send to my player via HTTP POST. This is all good when using XML.sendAndLoad. The problem is that when the XML object I generate contains CDATA, the CDATA is stripped out before the POST occurs. so if I have: var xml:XML = new XML("<root><tag><![CDATA[hello]]></tag></root>") when I do a sendAndLoad this is what gets POSTed: <root><tag>hello</tag></root> the same occurs when I try to create the XML using XMLDOM methods like createElement, createTextNode, and