actionscript-3

Do you know how to force a Sprite to position children in reference to 0,0?

Hi everybody ::- ). I'm trying to add some scroll bars to a Sprite using ScrollRect. The Sprite starts empty and when I add something at 500, 500, it should scroll, as it is outside the viewport. Unfortunately, adding a 10x10 Sprite at 500, 500, doesn't make my Sprite change its size to 510, 510, but to 10, 10 ::- (. We all know that...

Use regular expressions to remove HTML tags in Flex/AS3

Hi, I'm writing a HTML parser in Flex (AS3) and I need to remove some HTML tags that are not needed. For example, I want to remove the divs from this code: <div> <div> <div> <div> <div> <div> <div> ...

Compression support in AS3 / AIR?

Is there a way to open RAR / zip / 7z in AS3? Thanks. Is it easy to use compression library in C with Alchemy? ...

How to create an .swf file that will simply load a webpage in an iFrame once opened?

Hello, I am very new to flash and actionscript. I simply would like to know is it possible and then what is the code needed to create a simple .swf file that once double-clicked on opens and all it has inside it's window is an iframed website (scrolling and resizing are optional), basically a simple flash mini-browser if you will, with n...

When does a SoundChannel actually starts playing sound?

I want to control the start of a sound very precisely, but it seems to wait for something before starting the sound. It is like there is an internal clock in the player that runs at approx 43 fps and that the sound can only start on that clock's beat. It does not matter what the framerate of the project or which computer it runts on, it ...

ActionScript 3 Loader - swf disappears as soon as loader.width is set

Hi, I'm using a Loader object to load an external swf: var swfLoader:Loader = new Loader(); stage.addChild(swfLoader); var bgURL:URLRequest = new URLRequest("sometestfile.swf"); swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadProdComplete); swfLoader.x = 240; swfLoader.y = 210; // Resize here? swfLoader.load(bgURL);...

how to Visual studio 2010 integrated shell with sapphiresteel amethyst

Hi I read in one of the reviews that you could use SapphireSteel Amethyst plugin with the VS express editions using the VS Integrated Shell.I have never personally used the the VS Shell integration so does snyone know how to go about doing this? ...

Why to use Singleton patern?

Hey, So.. I can't understand why should I even use the Singleton pattern in ActionScript 3. Can anyone explain me this? Maybe I just don't understand the purpose of it. I mean how it differs from other patterns? How it works? I checked the PureMVC source and it's full of Singletons. Why are they using them in the View, Module, Controlle...

How to constrain loaded swf?

I load swf files continuosly, but if one of the swfs has some defective code such as Mouse.hide() the mouse disappears when the swf is loaded. I want to constrain such malicious code in loaded swfs. There is also another problem related to contraining loaded or loading swfs. When I load a swf which loads another swf to operate, It does...

How to pass arguments to stage instances in ActionScript 3?

I have an instance on my stage that I dragged from my library at design time. This instance links to a custom class who's constructor takes an argument. package { import flash.display.MovieClip; import flash.media.Sound; public class PianoKey extends MovieClip { var note:Sound; public function PianoKey...

Error calling method on NPObject

It seems not to be working: <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="600" height="300" id="externalInterface" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" va...

Is there a way to monitor/log all internet requests from Flash/AC3 application?

Hello everybody, I have a flash-based (AC3) application which does some network activity. Is there any way to see what requests it generates? Something like network console. Sources are not available and there is no way to modify the application. Im on linux platform (Ubuntu), so dont have any flash developer tools. The only solutio...

Shifting Flex 3.5 project to flex 4.0 - styles warnings

I am shifting my project from Flex 3.5 platform to Flex 4.0. I am able to remove all compile time errors. All I am left with is approx. 1000 warnings and all are on styles. I have used all mx components as earlier my project was in Flex 3.5. and i cannot change the controls to because it will hamper their look and field. All the style...

actionscript: add image loading animation for each image control

I have a list of image controls which loads the image from the website by setting the .source atrribute. The image is some sort of large so I want to display an animation in the image place before the image is displayed. How that can be done? Does image control support the this intrinsically? ...

Pass a callback in ExternalInterface

I want to call a Javascript function from Flash, which I can do with ExternalInterface, but the Javascript function takes a callback. Is there a way to give it a Flash callback? I've thought of something like this: ExternalInterface.addCallback("foo", function(){...}); ExternalInterface.call("theFunction", "foo"); But that wouldn't w...

Wny Linux sends unicode keyboard events while Windows sends ANSI

Unde linux, the foreign keys such as ü Ü do not seem to work with this code: String.fromCharCode(e.charCode).toLowerCase(); The output is wrong under Linux, but Windows is Ok. Here is sample page to debug this: the output of foreign keys such as ü with Linux looks same here, totally broken, two chars appear: http://www.bgxcomponents.c...

How listener will be executed for objects hidden by another objects in as3??

I have two movie-clips, one is small-box and another is big-box .Both are rectangular shape. Small- box has an index 0, and big-box has an index 1. Their x,y are same and big-box being big in size gets hide small-box. Now the problem is the listener attached to small-box does not fire as big-box is on the top of small-box. what would be...

Flash.text.textfield.ScrollV no more works with newest flash player 10.1

Scrolling textfield is no more working with player 10.1.82 My code is: SCROLLV = SCROLLV +2 text is scrolling down nicely with older players, but now with newest player it never scrolls. scrolling WORKS OK with player: 10,0,12,36 scrolling FAILS with player: 10,1,82,76 ...

[SOLVED][AS3] Draw shadow without filter on Graphics object.

I have a complex graphics data on a sprite or a shape (no matter which is exactly). But I want to draw shadow (inner too) for one Rect ( [10, 10, 240, 25] for example) or another path. /// code before grObj.graphics.drawRect( 10, 10, 240, 25); /// -> draw inner shadow on this objcect somehow /// code after Is it possible t...

Flash AS3 - Internal namespace modifier

Hi, I am working on a library that I wish to hide the internals of to the outside world. I figured I can use 'internal class' where ever I wanted to hide the class, How ever to my understanding, declaring a class in namespace test.NS1 means it can only access classes defines in test.NS1 and nothing else. For example, (both in the sa...