ActionScript 3.0 :: Replace Decedents In XML?
Jan 14, 2011I'm learning how to work with XML in Flash(CS5) and I'm having trouble replacing certain nodes in the XML. Here is the XML I am working with[code]...
View 0 RepliesI'm learning how to work with XML in Flash(CS5) and I'm having trouble replacing certain nodes in the XML. Here is the XML I am working with[code]...
View 0 RepliesI'm having some real trouble getting .replace to actually replace something. Here's my code...
[Code]...
I can trace both newFiles[i] and keywords[i][whatever], but the replace doesn't replace anything. The regex is valid as well. I'm using regexr to test it, and it works perfectly there... but will not for me and I don't know why.
I've got a strange situation where I'm replacing the text in a string that I've taken from an XML, but the .replace function for the string keeps failing. I've tried running the example given on the Adobe site, so I know the value I'm trying to replace ("%20") isn't at fault - it's something about the string I have! I've included the code below, but it seems correct. Is there a particular tip I should know when taking XML values into AS3? I'm putting them in strings for this project.
[Code]...
I am making a simple platformer game with weapons and so far everything is good but i need to find a way to make it so when the player touches an object it replaces the movieclip with something else? [code]...
View 4 RepliesI'm having trouble figuring out how to call an XML tag itself (not the value of the tag). I have a program that reads data from specifically named tags. I.E the program understands the tag <image> and the xml file i'm loading has a similar reference but calls the tag <picture>.
How do I replace the <picture> tag with <image> so it understands it?
I'm making a game, and I want to have a "team color" sort of effect. What I want to do is be able to replace a color in a bitmap with another color, but I'm not sure if this is possible. I don't want to tint the entier clip, just a certain color on it...can this actually be done? For those who have played games like Starcraft and Warcraft, to identify which team you're on each unit has your color (like red, blue, ect) on it. This is accomplished by painting those parts of the unit a light grey, and then tinting the grey the proper color.
View 3 RepliesWhat I'm working on is the following: Make a 3D image carousel that loads images from a certain XML file. When I click one of the images I want it to remove the rotating objects, and load new/different images from a new XML which is specified depending on what image you clicked.
I'm not sure if I have to make a new frame for this, or if it's able to load in the same frame etc. (I'm kind of having a bad headache and feeling really sick aside the lack of sleep) Current health status makes me kind of unsure of a lot of things, so I'll give you the full code, the problem is way at the bottom, but I kept in the rest in case I have to refer to other functions again later.
Code:
//We use 70x70 sized images (change this if different for your images)
const IMAGE_WIDTH:uint = 70;
const IMAGE_HEIGHT:uint = 70;
[Code].....
I have a flash movie on my web page and I have made some of the text inside the movie into buttons. The movie only takes up a portion of the page. I would like to replace the movie with another movie when somebody clicks the button.
View 8 RepliesHow would you replace the mouse cursor in ActionScript 3? I mean with like a movie clip or a graphic within Flash.
View 1 Repliesi have an xml like this one, How can i change the values of the nodes <adposx> and <adposy> of the node array "YAYA" .I did that :
this.Pages.page.adverts[1].adposx= newvalue;
this.Pages.page.adverts[1].adposY= newvalue;
but it dont work
[Code].....
i have a link to a local file and befor flash sends it out it converts it to the web path.
var link:string = c:\somewherfile.jpg
to
www.somesite.com/somewhere/file.jpg
how to replace the with / in the link?
I have this funktion i vant to change a bit.[code]And if der is typed a url in @APP i want it to show insted of the thumb image,
View 13 RepliesI am using Flexbuilder with sdk 3.5. I convert an int to a binary string. Now I want to replace binary value at certain index. How can I do this?
I tried following but it did not work;
binaryStr[0] = "0";
and
binaryStr[0] = '0';
First my AS2 code:
txt.html=true;
txt.htmlText="This is an example: www.sample.com is not www.othersample.com";[code]....
First question is why my flash function always replace only first url? What I'm trying to do is send string from flash input textfield by PHP to mySQL table. Then, when flash will load it again all urls in my flash textfield will be clickable.Of course I can use preg_replace in PHP:
$comments = $_POST['comments'];
$comments = preg_replace("/([^w/])(www.[a-z0-9-]+.[a-z0-9-]+)/i", "$1http://$2", $comments);[code]....
I can also use some PHP function which will check whether sended data from flash already contains clickable url's, but if I need add another link in edited string, preg_replace not fire then...
my website which involves private messages.The page in question has 4 tabs on it, one of the tabs called inbox displays a table of all the messages received, the subject of each message has a link which can go to another page displaying the message in greater detail. However what i want is for the content in the inbox tab to be replaced by the code for displaying the message in more detail.Here is the code for the inbox table
<div id="inbox" class="tab_content">
<table id="mail_header">
<tr class="mailHeader">
[code].....
My datagrid consist of 3 columns. If the user edit the 1st cell in the "Qty" column (e.g from 1 to 2), then the 1st cell of "Price" column will double as value (e.g from 5 to 10). How do i do that?
Qty | Description | Price
1 | apple | 5
1 | cherry | 2
1 | orange | 4
[Code].....
I am converting a class into AS3 (was AS2). What would be the best way to replace the loadVars ? This is how the code looked like in AS2
ActionScript Code:
public function load(csvPath:String): void {
// Use the LoadVars class to load in the CSV file as a String
var csvLoad:LoadVars = new LoadVars();
[code]...
I've been asked to replace the clickTAG on the submit button of a form (see AS below) with the following URL but I can't get any of my AS it to work
URL Supplied by client (to replace clickTAG): [URL]
AS on SUBMIT button:
on( release ) {
// VALIDATION ONLY
var errors:Array = new Array( );
[Code].....
I've been asked to replace the clickTAG on the submit button of a form (see AS below) with a supplied URL but I can't get any of my my attempts to work
I'm using the following AS on the submit button to send form data and I need to replace the ad server clickTAG with a url:
if (_root.clickTAG.substr(0,5) == "http:") {
var clickURL:String = _root.clickTAG;
clickURL = clickURL.split("SubCampaignValue").join("googflash 300x250");
[Code]....
I have a main.swf with 13 nav buttons. Each calls up a different swf via this code:
var req:URLRequest = new URLRequest("scene1.swf");
var loader:Loader = new Loader();
loader.load(req);
[code]......
I'd like a variable or a textfield to be displayed by a custom "font" I drew in Flash, so I heard I have to replace the characters and numbers by movieclips.
View 2 RepliesIs there any code like replacemc? Instead of removeChild() and then placing the new one at the addChildAt(same depth).
View 1 RepliesMy datagrid consist on 4 columns(will focus our attention on 1st and the last column). If the user edit the 1st cell in the "Qty" column (e.g from 1 to 2), as showed in the following images, then the 1st cell of "Pret" column will double as value (e.g from 24.50 to 49).
How do I do that? Here is my code so far
ActionScript Code:
var dp:DataProvider = new DataProvider();
var tempValue:Number;
[code]........
In the first frame I have 60 buttons with each having a actionscript in it using the instance name "A1". What I need to know is how can I REPLACE the instance name from A1 to B1 in 60 buttons in my NEXT FREAME?
Is there an easy way to do it rather than typing one by one?? I used the "FIND AND REPLACE" option but it replaces A1 to B1 in both the frames. I need to alter the instance name only in the second frame. How can I do it?
I'm using swfaddress which creates a page title in the browser based on what page your on in the flash site. The title comes from the name of a frame label. For example i have a frame label called "About Us" I've capitalised it and put a space between the words because this text is what's used in the page title on the browser and i want it to look good and to be able to be read properly.When the page is refreshed it comes up as: "about%20us" as the page title on the browser.The %20 is replacing the space in the word.Is it possible to replace the %20 with a space?
View 4 Repliesi have an image in flash and i want to know if its possible with actionscript to replace some colors? say if i had an image with three colors: red, blue, and yellow i want flash to replace all the blue within the image to a certain color like orange without effecting the other colors of the image.
View 6 Replieshow to replace cursor "cursor_mc" when rollover on "main_mc" ?? i guess thats easy but i cant make it workin
View 7 RepliesIt controls a collection of 6 "slides". Each slide has a corresponding button, and it also slides every x seconds when the mouse is still. I'd like the buttons (b1 through b6) to change once they are pressed (to a similar image, just with a black dot in the center, which shows it is selected) and then return once another one is selected. I have a very minimal knowledge of actionscript
[Code]...
I am working on making a photo flip animation between 5-7 photos but i have to duplicate this 70 different times. So what i have done is made a scene for each set of 5-7 photos, they are externally being pulled in through an AS3 script to prevent a large .swf file from happening with all those photos. The problem i am running into so that i cant seem to run a find and replace search to replace the instance name values.
View 1 Replieswhen I use the Edit/Find and Replace function, the results portion at the bottom doesn't reveal enough information under Location. I can see "Scene 'Scene 1' -> Layer ' " and that's all. I know if I click on that line the relevant window will open but when doing a "Find All" it's useful to know more information about the Location instead of clicking on every line. That Location column of the window will not widen with the drag icon. I can move the dividers from the other columns to the left but not to the right.
[Code]...