ActionScript 3.0 :: Calculate Total Child In XMLdata?
Mar 17, 2010HOW TO calculate total child in XMLdata? out to find total child in flash
View 2 RepliesHOW TO calculate total child in XMLdata? out to find total child in flash
View 2 Replies[code]...Calculate total child of screen?
View 3 Replies<?xml version='1.0' encoding='UTF8'?>
<data>
<screen id="" title="">
<row>110011101</row>
<row>110011101</row>
[Code]...
i'm getting the xmldata from the httpservice (using cgi) and i have not set resultformat(it is coming as an object only),the xml data in this format
[Code]...
when i was tried to count the employee tag,i getting the problem, my code will like this:
[Code]...
I have lot of child inside my xml data.I want to calculate total my child list
View 2 RepliesI have problems with calculating values of a childnode.
My XML structure
<FILE>
<NUMBER TYPE="test"> 1 </NUMBER>
<NUMBER TYPE="test"> 2 </NUMBER>
</FILE>
[Code].....
the trace outputs: 2 (last row)
and not 3 as i expected. De Element++ is not working.
Ball overlaps ground. Check 360 points around the circumference of the ball. 180 points are returned hit, so its 1/2 way in the ground. Balls radius of 20 pixels, how do you calculate how many total pixels are overlapping, assuming a straight surface.
View 3 RepliesHow to you calculate the total rotation of an object in either direction?
I need to end up with a number of total radinas(or degrees) that is posotive or negative depending which way the object was rotated.
how to build a timeline scrubber that can scrub more than one scene.
1. Scene 1 had 20 frames
2. Scene 2 had 20 frames
3. On scene 1 I put the slider that scrub the timeline. The totalFrames; sum all the frame from all the scene.
4. When i scrub the slider to frame 21 error occurred saying that the slider couldn't be found. So i paste the slider in scene 2.
So how to continue scrub on scene 2? How to make a slider that can scrub all scene and move along showing the current frames?
I am using FLEX version 3.0I want to calculate the total working hours. I am giving you the details and what i have done in it.
var a:Number = 2.00;
var b:Number = 2.00;
var c:Number = 1.45;
[code].....
I would like to know if it is possible in flex to do the following actions. I have made an HTTPService to a MySQL database, table: orders_open and it has columns
Id | product | price | units | total_price | customer | waiter | printed | paid_cash | paid_card | date
The datagrid is filtered by the customer column. Default value of | printed | paid_cash | paid_card is 0
1)How can I make flex take the price and units and calculate automatically the total_price? In the datagrid and update the database lines when I save.
2) Sum up all filtered total_price �s and give the bill_total in a text field
3) When paid, print the ticket | product | price | units | total_price | and the bill_total in a printer
My code has been created by Flex (create application from database)
I have the following code but i can't get the value of xmlData on both the function
<mx:Script>
<![CDATA[
import mx.controls.Alert;
public var xmlLoader:URLLoader = new URLLoader();
[Code].....
I have an XML document that is a response pulling person records from a data base query. The XML format is <root><row> .....data fields with tags </row><row> data fields with tags </row> ........ for the number of records returned. </root>. I want to split up the answer into an array of records, with each record being split up into an array of fieldsI can get to the first record with this:
var people = new Array();
var person = new Array();
var i = 0;
[code]......
I as this working in AS2 and need to update to AS3...shows that AS3 doesn't like sloppy coding. Here's what I need: I pull data from an XML and that works when I put the data into a dynamic text box. However, I can't seem to get the date of birth into a variable. I have some code that calcs age in years but uses a string literal that I thought I could just replace with a variable from my XML...ain't a workin'. Here's the code I have:
ActionScript Code:
import flash.display.*;
import flash.text.*;
import flash.events.*;
[Code]......
In my main timeline, I have an image fade in and stop on frame 61. On Frame 61, the code below executes;
Code:
stop();
var placesXML:XML =
<places>
<place name= "Bengkulu">
<frame>63</frame>
[Code] ....
There are no output errors, or compiler errors, yet when I click on one of the buttons, the movie does nothing - it certainly does not gotoAndStop on frame 62, 63, or 64 as I am asking it too. Before this code, there are no other actions at all in the movie - just a simple fade in image.. I have now tried tracing (the objects below), within the click handler curly braces (showData);
'xmlData' produces nothing in the Output
'xmlFrame' produces '0' on each click in the Output window.
Tracing both the above outside of the showData function curly braces produces;
1120: Access of undefined property of xmlFrame, or xmlData.
Tracing the nameBtn[i] produces '[object SimpleButton]' in the Output Window.
So here is how i load my xml:
[Code]...
And it works. My question is what code to put to replace trace(xmlData); with code that will allow me the XML components be arranged in textfields. Here is how my XML is constructed:
[Code]...
What code to put in AS so when i start naming my textfields tf1,tf2,tf3,tf4 each line from the XML to go to its text field (like first line from the XML goes to tf1, second line to tf2 etc.)
I have a picture on the stage that has multiple items that have hotspots/links over them that should open a child swf on top of the background and show details about the items. then have a button in the child swf itself that removes the child from over the background so the user can click on another item etc.I found this code in someone's post and I am trying to modify it so that works for multiple swf files...it currently works for a single swf.I wan to pass the name of the button in front of the .swf in the URLRequest to have the same name as the instance name of the referring button. But I can't figure it out. Here is the code I am using on the stage
View 2 RepliesI am in need of this code..I have n number of flash files(swf). Each file contains n number of frames. I need to get the totalframes of that flash files in Actionscript 3.0.
View 1 Replieswhen a user clicks cardbtn button i want it to add 1 to there score.here is the code. i have a textfield called card_txt on the stage.[code]
View 1 RepliesI am loading a flv video in AS2:
var conexion:NetConnection = new NetConnection();
conexion.connect(null);var stream:NetStream = new NetStream(conexion);
mi_video.attachVideo(stream);
stream.play("motto.flv");
this.onEnterFrame = function() {
[Code] .....
It works very good, In this line, I get de current time of the flv:
timer_txt.text = ((integer.length<2) ? "0"+integer : integer)+":"+((decimal.length<2) ? "0"+decimal : decimal)
And I need to display the total time too. By the way, I am not using the any flv component, I need to play the video in a custom player....
My script does not show total bytes, I do not know where did i mistake[code]...
View 1 RepliesI'm trying to make a very simple flash game for my college project. The players will get 1 point each time they click on certain object. I've created 3 scenes and each of the scene has score value. I want to total up the score at Scene3. FYI, I use:
1st Action Script add this to the variables frame:
_root.total = 00;
2nd Action Script add this to each of the hit sections in the Action Script frame:
_root.total = Number (total) +1;
how to add up the scores from Scene 1,2 & 3?
control the framerate of my app by a external event, like a timer or a network socket. I have one solution wich works, but not very elegantly:
stage.frameRate = 0;
addEventListener(Event.ENTER_FRAME, handleEnterFrame);
var timer : Timer = new Timer(1000);
[code].....
I have one Datagrid in Flex. In datagrid there are 4 columns like mark1,mark2,mark3,Total.When i enter mark1,mark2,mark3 that time i want to update total.
View 2 RepliesCurrently I have to create a website where some videos should be played automatically.
When a User opens the URL and lands on the page, a random video of a total of 5 should be played. When the video is finished, it should chose another video of the total of 5 videos.
So an example: It should chose one video of 5 videos. Play it, then it should chose 1 video of 4 videos, then it should chose 1 video of 3 videos..and so on. And after all 5 are played, it should repeat the process.[code]...
I've got some code that calculates a score from a Quiz. However all it does at the moment is display a movie clip symbol for each time a user gets a question right.
How can I display the score as a value in the text box no matter how many questions the user has got right? E.G. 6 Questions right... score_txt displays the number 6.
ActionScript Code:
score_txt.text = "";
questionOne_txt.text = "";
[Code]....
so I've been working on this project that uses about 10-15 frames of AS3. On each frame the 'total' variable is updated (added to). By the end, the user is supposed to be taken to another frame (1 of 2) based on the value of 'total'. I have used the trace() method and up to that point the 'total' variable appears to be updating properly, but then when I get to this page it ALWAYS directs them to frame 18 no matter what their total is. Is there an error in my code? (I assume so lol..)
Code:
stop();
fwdBtn.addEventListener(MouseEvent.CLICK, onClick15);
[code].....
i want it to add $5 to the total amount of money, but the problem is, is that my code doesnt work, in the frame actions i have:
[Code]...
Is there a method to get the total bytes of an external movie without having to download it?
View 4 RepliesI have a video object attached to my flash and I want to display a time readout of how far into the video has been played. I know I need a dynamic text field, but I cannot find any methods of the NetStream that gets the total duration.
View 5 Replies