ActionScript 3.0 :: How To Calculate Total Child Of Screen
Apr 28, 2010<?xml version='1.0' encoding='UTF8'?>
<data>
<screen id="" title="">
<row>110011101</row>
<row>110011101</row>
[Code]...
<?xml version='1.0' encoding='UTF8'?>
<data>
<screen id="" title="">
<row>110011101</row>
<row>110011101</row>
[Code]...
[code]...Calculate total child of screen?
View 3 RepliesHOW TO calculate total child in XMLdata? out to find total child in flash
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 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]......
I am attempting to add a child to the stage with the following code:
Actionscript Code:
//Buttons: Adds movie clip to stage.readtomeShortA1.addEventListener(MouseEvent.CLICK, playShortAReadMe1);function playShortAReadMe1(e:TimerEvent):void{ var playShortA1:ShortAReadMe1 = new ShortAReadMe1 addChild(playShortA1); playShortA1.x = 307; playShortA1.y = 603;}
When I test the movie the following message appears,
"TypeError: Error #1034: Type Coercion failed:cannot convert flash.events::MouseEvent@212a161 to flash.events.TimerEvent," when I click the button ("readtomeShortA1"). Note the instance I am referring to is a button. When the swf is created there are compile errors that appear. The "TypeError....." only happens when I click on the button ("readtomeShortA1").
FYI, there is other code on the page which is below the code in question:
Actionscript Code:
//Button CodebackTo.addEventListener(MouseEvent.CLICK, backToShortA);function backToShortA(event:MouseEvent):void{ gotoAndPlay(1); SoundMixer.stopAll();}ForwardTo2.addEventListener(MouseEvent.CLICK, toPage2);function toPage2(event:MouseEvent):void{ gotoAndPlay("page_2"); SoundMixer.stopAll();}
I am a Flash MX user, I have three files named PARENT.SWF, CHILD.SWF, and CHILD2.SWF. The PARENT.swf loads the CHILD.SWF, The CHILD.SWF loads, then the file CHILD.SWF loads another swf file: CHILD2.SWF
Now my question is: How can the file CHILD.SWF unloads itself to avoid overlapping with CHILD2.SWF on the screen. I try the command: removeChild(CHILD); from CHILD.SWF but it doesn't. work.
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 RepliesSay I have 4 values (level_reached1, level_reached2, level_reached3, level_reached4) I want to add up to a total, and another 4 values (goal1, goal2, goal3, goal4) I want to add up to a total. How do I add these up and compare them to each other, and if the "level_reached" is equal to OR greater than "goal" I want a movie to gotoAndStop(2);
Here is what I have, which does not work, I probably have things really mixed up:
Code:
leveltotal = level1 + level2 + level3 + level4;
goaltotal = goal1 + goal2 + goal3 + goal4;
if (leveltotal >= goaltotal) {
[Code]....
I have a swf called "main.swf". Here I am using movieClipLoader to load another swf called "news.swf". In "news.swf" I'm loading several images using movieClipLoader.
On the "main.swf" I want the loading progress for the ENTIRE "news.swf", including the loading progress for the images.
If I use onLoadProgress for "main.swf" while loading "news.swf", it will reach 100% before the images has started loading. I want the image loading to be included in the progress.
I am having trouble converting my total price in the cart text field to decimal. I have on the main timeline I have a several numeric steppers and add to cart button.
In my .as file I have the following code that takes the price * quantity and displays the total but not in the decimal $10.00 format. I have tried everything from Math.ceil, round, etc. It either will round up or just display the number with no decimal.
.AS File Code
Code:
public function GetCartValue(decimals:Number) {
var dataforAlternate = _level.BodyOilsMc.my_nstep.value;
moneysign= "$";
//trace("AS File"+""+dataforAlternate+" Products");
[Code].....
i have an xml file, that has lets say n nodes. in the .fla file, i have a list, that is bound to the xml schema, taking the name from each of the node. i have some AS scripted to this list, which includes the total number of fields. how do i get that number, as a general (like n, or totalIndex [dunno if exists], not a number)
View 1 Replies