ActionScript 3.0 :: Filter E4x By Using Dynamic Vars?
Jun 29, 2010I need to get a diff node off XML based on a variable
ActionScript Code:
var lang:String = "es";
// could be other language
[Code]....
I need to get a diff node off XML based on a variable
ActionScript Code:
var lang:String = "es";
// could be other language
[Code]....
I have created a movieclip. This movieclip will have 5 child Sprite's, which will contain an image pulled from xml. I want to create a for loop to create those 5 Sprite's, add the appropriate image into each one (i.e., img[0] into sprite[0]) and then add each sprite to the movieclip.
[Code]...
Although I have a long experience with AS2, I am just stepping in AS3 now. As should be expected, I have bumped a few issues here and there, that really puzzles me.
One of them is the way to correctly name a variable dynamically. In AS2, as far as I know the only way to do that is with _root, like that:
Code:
for (var z=0;z<=5;z++)
_root["myvar"+z] = z;
I have used quite the same way to do that in AS3, like that:
Code:
for (var z=0;z<=5;z++)
root["myvar"+z] = z;
However, it doesnt seem to be too good, because it just allows me to create global variables. What if I want to create local vars into the function? I tried to remove the "root" and use "var" statement but ActionScript doesnt like that (it tells me that there is an identifier missing before the left bracket):
Code:
for (var z=0;z<=5;z++)
var ["myvar"+z]:Number = z; // Flash yelds when I try that!
What is the trick to do that... or simply THERE IS NOT a way to do that, but always declare dynamic vars as public??
I have defined two variables,
Example
x = 2;
y = 3;
I then want to load both of these variables so that they will look like this
(2/3)
/ is just a separator not a divide operator!
I want to load these two vars into a dynamic text field called loadText:
_root.loadText = "WHAT DO I PUT HERE";
I am trying to apply the glow filter to a dynamic text box when the text is clicked on. However this seems to be canceling the rest of my animations. The text glows for a moment or two when clicked upon, but then it disappears and the url address it is linked to does not appear. Below is the code I'm currently trying to use.
Code:
text1.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
var color:Number = 0x003366;
var alphas:Number = .8;
var blurX:Number = 5;
var blurY:Number = 2.5;
[Code] .....
I am a bit puzzled why this does not work when placed in my document class, but works when directly added a key frame in the Flash IDE.
ActionScript Code:
this['myVar1'] = new Object();
When within the document class I get this error when compiled,
ReferenceError: Error #1056: Cannot create property myVar1
I have tried the following but I still get an error.
ActionScript Code:
public static var root_Ref:Object;
root_Ref = root;
root_Ref['myVar1'] = new Object();
trying to set up some vars for outputting to dynamic text fields, can't work out what Flash is bitchin about now, getting this error...
1151: A conflict exists with definition redTextOutput in namespace internal.
1151: A conflict exists with definition blueTextOutput in namespace internal.
ActionScript Code:
private var redTextOutput:TextField = new TextField();
private var blueTextOutput:TextField = new TextField();
i have an swf called movie1, on the main stage of movie1 i have a mc that is named xpos,inside xpos i have a dynamic text box and it's value is asigned to the Var=clipX.to get the value of clipX i used this code in the actions of xpos like this:
Code:
onClipEvent(enterFrame) {
clipX = (_root.object._x);
[code].....
i have an swf called movie1, on the main stage of movie1 i have a mc that is named xpos, inside xpos i have a dynamic text box and it's value is asigned to the Var=clipX. to get the value of clipX i used this code in the actions of xpos like this:
Code:
onClipEvent(enterFrame) {
clipX = (_root.object._x);
}
everything is fine and it works when i play movie1
[Code]...
I have an xml content loaded in AS and to that content I made a movieClip to show that content.I'm duplicating that movieClip according to the quantity exposed in xml.My problem is that when I duplicate de movie clip, I don't find a way to contact the dynamic texts variables.Her's the dynamic texts vars:- client_number;- client;- ...Her's the code:
Code:
var my_xml = new XML();
my_xml.ignoreWhite = true;
[code].....
I have a script that's creating 2 empty movie clips and then adding thumb nails into the second one. then finaly drawing a shape and adding a dynamic mask on top
i.e. _level0.emptyClip1.emptyClip2 -->thumb1thumb2thumb3etc..the problem is, I want to add blur when im scrolling to emptyClip1 or even emptyClip2, but alas not luck. The weird things is, as Im trying to figure this out, I found that I could add blur to the thumbs themselves but not to their parent clip. I've been trying to figure this on my own for a week, with no avail.
I looked at the following example in the AS3 Reference: [URL] It is unclear to me looking at the package example how to apply this in standard ActionScript 3 without packages to a Movie Clip resident in my Library that gets called at RunTime. how I would push the DropShadow filter onto my Movie Clip at RunTime?
View 6 RepliesTo achieve a zoom effect in our 2D flash game, we make the background of the game much bigger than the visible stage. This becomes a problem when the background is complex or when we apply a grayscale filter to the background. Is there a better way to do zoom? Or, is there a way to apply the filter to only a specific area of a movieclip?
View 2 RepliesI have a function that creates a group of dynamically created MC'sWithin each MC, there is a group of dynamically created buttons.I got that bit to work fine.Now what I need is to send a handful of var strings and numbers along with each of those buttons, and am not having very good luck doing thatHere's what I got so far...
Code:
function storePageBuilder(a):void{
var storeMC:MovieClip = new store_MC();
[code].......
When i've created a vars in my fla file and load it from the html file to dynamic text field, using this action
[code]...
Ok ... it is working, but it only for 1 text field. So .. how i can load a vars from one html file with other dynamic text fields.
I have a function that creates a group of dynamically created MC's Within each MC, there is a group of dynamically created buttons. I got that bit to work fine. Now what I need is to send a handful of var strings and numbers along with each of those buttons, and am not having very good luck doing that.
Here's what I got so far...
Code:
function storePageBuilder(a):void{
var storeMC:MovieClip = new store_MC();
storeMC.name = "storeMC_"+a;
[Code]....
I want to know how to write "Intercepting Filter Pattern" like Java's servlet filter in Flex.
And I want to insert it into the classes which have a role of server communicating.
Im supposed to make a marquee that has curved dynamic text scrolling through it. I used the displacement map filter for this and it almost works. the only problem is that when the dynamic text field gets to a certain x position, the filter stalls, but the text continues to scroll. Im really at a loss. heres what I got so far: [URL]
[Code]...
MovieClip(parent).tiles.["cell"+MovieClip(parent).current_cell].text=="Quiz" where : MovieClip(parent).tiles - Movie Clip in parent directory. ["cell"+MovieClip(parent).current_cell] - cell + variable which is a number Checking for condition than the Dynamic textfield area text is equalto "Quiz".
Gives an error : 1084: Syntax error: expecting identifier before leftbracket. 1084: Syntax error: expecting rightparen before leftbrace.
i am trying to load vars from a text file into a load vars object.
var kitchentext = new LoadVars();
kitchentext.load('moccastext.txt');
Once in the object, i thought i could reference them like so
kitchentext.name
kitchentext.style
but i am having trouble doing this.
i have a textbox called displytext.
_root.displaytext.text = kitchentext.name;
doesnt work
I have a filter applied programmatically to a screen-size movie clip (a displacement map filter). However, I can't seem to place anything above it unaffected. Even textfields defined in the .fla are affected...
View 1 RepliesHow can I filter arrays so items are only contained once in the array?
ex if the array looks something like this before the filtering[code]...
I have imported a JPG in to my library, converted it to a button, and then I animate the button in from frames 1-30. I then stop() the animation.If I hover over the button in the preview, the cursor changes to the hand as you might expect.Now, if I double click on the instance of the button, I get to the "edit in place" screen, with the 4 frames - Up, Over, Down Hit.I'm unable to apply any filters to this button. It says the "button" is a "bitmap" in the properties.How can it be both? And what is the recommended way of doing this.It seems I can create a new instance of the button on the "up" frame and the "over" frame etc, but this seems wrong plus they all need different names so that makes no sense.
View 3 RepliesI'm building a little application in AS3 but I need to get variables from PHP. I searched on the internet on how I should do that. It makes the connection, but it doesn't get the variables. It just prints whole my php script.
[Code]...
I think this should not be a big deal, but I do not get it to work. I got a "MainFlash" witch loades an XML with about 60 variables (Settings), in base of a paramater then this "MainFlash" loades another "FlashMovie" and this one needs, all, the same Variables too.
How do I properly pass all the Vars in the new/other "FlashMovie"?
U need to know I use LoadMovieNum to Level 0 I do replace the "MainFlash", cause the new loaded "FlashMovie" can have a completly different height and width ( ...I don't think it's possible to change the Document-Setting in a compiled swf, or is it? If this is possible I would not need to load a separate swf to Level 0. the main SWF usually ist about 320x180, the following can be 2x, 3x bigger...
var navChildXml:XML = <subpoint>
<text>XML(_nodes[prop].childNodes[inc].title)</text>
<link>XML(_nodes[prop].childNodes[inc].title)</link>
</subpoint>;
how to in this instance
the vars are not being declared
When I rotate an external loaded image it gets a different filter than the other embedded images. Like this:
What can I do to change the filter from "squares"/gitter to bi-linear?
I needed to convert a simple graphic symbol into a movie because I wanted to give it depth using the (gradient bevel) filter effect. The movie has to appear at different sizes in my animation but the filter effect does not scale with the symbol. Is there a way to make this filter effect (gradient bevel) scale when I scale the symbol it is applied to?
View 2 RepliesThe attached piece of code produces strange results. When first run we get this result -- why does the first trace output include the XML elements, and the second only the text?
[Code]...
I've created an interactive map with filters for the map points using if/else visible statements.
The problem is that some of the points belong to more than one filter (i.e., health, education related, etc.). So the filters act properly when selected and deselected one at a time but don't show the proper map points if more than one filter is selected.