actionscript-3

Lined Pattern in Flash Background

So i have a flash site i am doing in as2, even if the solution can only be done in as3, I still want it. I am trying to accomplish lines through the background image like on this site http://larc-paris.com/#/fr/club I tried just putting the patten on the image itself, but when i scale my site, its all distorted and the lines does not l...

Toggle display of HBoxes dynamically by ID in action script flex 3

Hi, Looping thru the XML, adding childs to VBox. Onclick of the label child, need to display some other information of the person. So how do we need to toggle the display of the particular label in action script. Setting the ID of the HBox dynamically, but how to toggle the display of the HBox dynamically on click of the label? ...

How to eat HTML tags?

Is there any function that converts <a href="test.php"/> to &lt; href=&quot;test.php&quot;/&gt; It would be helpful if all html characters were converted in the similar manner. Is there a function or library to do this? ...

Loading external Swf - sandbox violation

Hello Mates , 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...

Dragging not working on Custom class inherited from Moviclip

EDIT: If I have a class called Items and it has a movieclip instance which is loaded from a url. The startDrag on item fails. If Items contains a movieclip which we initiate from a SWC (not load it) on Drag works fine. Now how to solve the issue where I have a class which has a movieClip loaded from outside. I have the following code:...

php/as3 regex to split multiple json in one

For example I have this string of 2 json objects: {"glossary": {"title": "example glossary"}, "aaa": "1212"}{"adada": "faka"} I want to split it in the array for PHP and Actionscript 3 Array ( [0] => '{"glossary": {"title": "example glossary"}', [1] => '{"adada": "faka"}' ) What is the best method to do it. Edit: I don't ne...

AS3 - check if flv has video in it

Hey. I'm a n00b @ AS but I have managed to put together a video player using NetStream that suits my needs perfectly. The thing I'd like to add is that it would display a certain image if the streamed .flv clip only has audio track in it (mp3 converted flv). Q: is there a way to check if the .flv I'm streaming has video in it? ...

FLEX, Actionscript: how can I invoke a CustomEvent ?

hi, I've created a custom MouseEvent in Flex: package { import flash.events.MouseEvent; public class CustomMouseEvent extends MouseEvent { public var tags:Array = new Array(); public function CustomMouseEvent(type:String, tags:Array) { super(type, true); this.tags = tags; }...

ActionScript 3 class over several files - how?

So, how do we write a class over several files in action script 3? In C# there's the "partial" keyword. In C++ it's natural (you just "#include ..." all files). In Flex 3, in a component, you add this tag: <mx:Script source="myfile.as"/>. How do I split the following class into several files; package package_path { public class ...

Must I loop to search results for a specific value?

I have a table in the database: name Opinion Tim Tim has an opinion John other random text Dan Dan's random text Al Al says something else I call this data and get it back in getRecords.lastResult To access John's opinion, I could use: getRecords.lastResult[1].opinion But that's only ...

Flex AS3 - Creating a dynamic property, and then binding a control to it

I am trying to: 1) create a dynamic property 2) bind that property to a label This works great for "sealed properties", but for dynamic properties there doesn't appear to be any event triggered. Are dynamic properties implicityly not bindable? var myObj:MyType = new MyType(); // MyType is dynamic myObj["myDynamicPropertyName"] = "in...

Parsing XML with nodes containing underscores.

How do I parse an XML document that contains nodes where underscores exist? <some_xml> <child_node> <child width_info="" height_info="" /> </childnode> </some_xml> I tried this: for each (var item:XML in Environment._XMLData.some_xml.child_node.child){ trace(child.@width_info); } But that does'nt seem to work. I...

Flex 3 (Action Script): How to access a function from a loaded swf-file ?

Hi, i load in ActionScript a swf file. So far no Problem, but I didn't found a way to access one of it's functions, the best thing would be if I could access the main function in the mxml part of the swf. Here is the code of the main-mxml file that belongs to the swf that should load and access another swf: <?xml version="1.0" encodin...

Access "currentState" from other classes?

I'm making a little application in Actionscript 3. In my initApp.as I have created another class which needs to edit the currentState, which is only accessible from the main .as (initApp.as). I found a solution such that I can reach the currentState property from my other class: Application.application.currentState. This is however no...

How to extract text using regex in Actionscript?

In the HTML below: <a href="link1.php">1</a><a href="link2.php">2</a><a href="link3.php">3</a> How do I extract link1.php,link2.php,link3.php and push them into an array using regex? (There could be N number of <a> tags in the text) [Edit] I'm aware the regex for this is something like href="([^"])*". But I'd like to know how to go a...

Securing SWFs, written in Actionscript 2 and 3.

Hi there, I have around 3000 SWF files, some are interactive which has lots of actionscripts and some are just animated lessons for mathematics. Currently, users have access to these files through a web interface (PHP). Even though access to these files are restricted for unregistered users, the registered users can still download the f...

Problem resizing loader after loading swf

I'm using the following code to load an swf in a pure actionscript project (Flex Builder 3) _loader = new Loader(); _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, Loader_Complete); _loader.contentLoaderInfo.addEventListener(Event.INIT, Loader_Init); var request:URLRequest = new URLRequest("Skins/TestSkin.swf"); _loader.loa...

flex datagrid itemRenderer with different states

Hi, I have a datagrid with allowMultipleSelection="true" & itemRenderer as my custom component. The custom component have 2 states "NORMAL" & "EXPANDED". Now on row selection the renderer should change its state from NORMAL to EXPANDED state. And if I am selecting multiple rows then all the selected rows should be in EXPANDED state. ...

how can i change texts in the dynamic textFields in SimpleButton instance (button symbol)?

hi every one, this may be a basic thing, but i couldn't find an answer by serching internet. I have created a simple button - Istance name = "btnsample" and there are two layers layer 0- button design with rollovers - layer 1- dynamic text field - instance name = "txtbtnlabel" btnsample.txtbtnlabel.text = "new button label; but i...

Zoom , pan inside a rectangle bound

I am building a site with some features of google map. I want to pan, zoom in out a map with tweening effect. But when I zoom the map(Movie clip) it zooms out of the rectangular boundary. I also want to wrap the map(when scrolled). How can I do all these? ...