ActionScript 1/2 :: 050000 & 50000 Not Equal In Flash?
Nov 12, 2009If you trace(50000) & trace(050000) it will give you different values. how to get similar values for both numbers?
View 3 RepliesIf you trace(50000) & trace(050000) it will give you different values. how to get similar values for both numbers?
View 3 RepliesI have been working on a map viewer based blitting technique. As part of the map I need to draw approximately 50000 lines and performance is currently really poor.
Code: Select allvar movie:Shape = new Shape();
for( ... )
{
movie.graphics.clear();[code].....
The dictionary use strict equals(===) for key comparison, how to change the comparison, so I can use my standard for comparison, for example, I have a class named Student:
class Student{
var id:int;
var name:String;[code]....
I want Dictionary use id to compare if the two keys are equal, not use strict equal(===) to compare if the key is the same.
I want to change the scene when my timer is equal to zero how can i do that
import flash.events.TimerEvent;
var count:Number = 100;
var myTimer:Timer = new Timer(300,count);
[code]........
I'm trying to set an array collection equal to a event.result that contains an array collection, but my array collection keeps coming up null. The event.result isn't empty because I can assign it as the dataprovider for a datagrid and that works (shows data correctly)[code]...
View 3 RepliesI am trying to make a Grid that is equal to the width and the height of the flash movie. I have a movieclip called box which is 30x30, and want it to repead along the x to form columns and along the y to form rows so that it makes a big rectangle of smaller squares. For some reason it looks like this:
[Code].....
I have some (Eg. 10) Movie Clips on bottom of the Stage (aligned horizontally) with different sizes (different width & height). I want them to align vertically on middle of the stage with same gap (irrespective of their sizes) in between 2 Movie Clips. Is it possible using AS3 code?
View 3 Replieswhat does 9.2 x 100 equal to? it equals to 920. in actionscript 2 ,it shows the right result while on the other hand, actionscript 3 shows 919.9999 .
View 6 RepliesIf I wanted to create a function called printMe, what's the proper syntax so that it prints what the function information prints?[code]...
View 1 Repliesis it possible to make a comma (,) to equal (.) in as3?
example:
now i write
2.31 + 4 = 6.31
so it's possible to write
2,31 + 4 = 6,31
i've started to make like a quiz in flash with 218 questions in it! i've made it so the computer will show X amount of random questions.i've already got the code on the buttons so it will jump to a random question, but i'm having trouble with limiting the number of questions asked.
i've got an inputbox so the user can chose how many questions they do and the buttons add 1 each time thier pressed to a different variable.
i've got this code, but it never seems to stop asking questions
on (release) {
score = score+0;
page = page+1
if( (page == pagemax) )
GotoAndStop(220)
if( (page != pagemax) )
myVariable = random(219); //creates a random number between 0 and 5
if (myVariable < 2){ //checks to see if it's value is zero
myVariable = 2; //set it to 1 if it is zero
}
gotoAndStop(myVariable); //goes to and plays the frame.
}
I have a couple of mc's that are added to the stage after one another.I want them to have equal space between them.Here i the code snippet with the problem, below is the full code.
Code:
for each (var link:XML in settingsXML.links.link) {
i++;
newsItem = new NewsItem();
newsItem.menuLabel.text = link.@name;
[code]....
i just want to ask how to make an integer variable equal to null.[code]well it kinda work but giving some warning..,
View 4 RepliesWhat's the best way to sort an array while making sure that elements of equal value stay in the same position?
When I do something like this:
var i:uint;
var myArray:Array = new Array();
myArray.push({num:1, type:0});
[Code].....
The objects that have equal num values swap places everytime I do a sort. So how do I get the sort to not swap the positions of objects that have the same value?
I am trying to do something like this[code]...
Then how do I make it so all the children added are equal distance apart? I know I can set the X coordinates for each one,but I want it so that the objects can be added in any sequence and then be set to equal distance apart.
If I want a a random number not to be equal to a number in an array so that the random number dose not repeat itself.Or if can't be done with an array how would you get a random number to randomly generate numbers but not repeating itself?
View 9 RepliesI have a movieclip called background_mc; this movieclip contains 20 different movieclips each loading content. This works so far. When the minus key is pressed the background movieclip scales to 25% [this works] while scaled down the movieClip can be dragged around[this works]. I should note that while the movieClip is at 25% if a nested movieclip is clicked(onRelease) it tweens to 100% at the correct cooridinate. The problem is that after the movieClip is scaled back to 100% it can still be dragged whereas I only want it be dragged when scaled down.
If you look at schematic's site I am trying to achieve something similar. [URL]
This is my code so far
Code: Select allvar minusKey:Object = new Object();
minusKey.onKeyDown = function()
{
if (Key.isDown(109)) {
[Code].....
trying to hide all submenu's when not equal to the current
Code:
function removeAllOtherMenus(mc) {
trace("remove movieclips not equals: "+mc);
for (var i = 1; i <=3; i++){
[Code]...
but it keeps tracing all subsubmenu_mc (that is subsubmenu_mc1, subsubmenu_mc2 and subsubmenu_mc3 when mc = subsubmenu_mc2)
i have a xml file and i want to compare data.I want to return the equal nodes within a new XMLList or Array;
<checkNode name="title" ids="2,3,4" />
atrribute (ids) checking in;
<nodes>
[code]....
and return equal nodes.
Is there a way to write an "ANY" conditional statement? For example, I want to write an IF statement that if the user presses ANY of 10 specified keys, I want to execute the same bit of code.However, the only ways I know to accomplish this is by
1) writing a switch statement, which seems unwieldy because I'll have 10 separate cases which all duplicate the same [code]...
Is there a better/faster/more efficient way to check if a variable is equal to ANY of a set of values?
The Problem I have is that I need to enlarge my Movie from the standard 550 x 400 to an equal proportioned 825 x 600.But when I do that it only enlarges the one Frame that I am on in that moment. How can I enlarge everything at once?
View 3 Replieshow to scale a SWF in the browser window, but not larger than the original stage size in the FLA file? For instance, I've designed a course in Flash with stage size of 1024x768 in Flash. In the published HTML document, I change the following values:
'width', '1024' changed to 'width', '100%'
'height', '768' changed to 'height', '100%'
'scale', 'noscale' changed to 'scale', '100%'
These changes in the HTML source code allow the SWF to size with the browser, but I don't want the SWF to grow larger than 1024x768 if the browser window is greater than these dimensions. I want the max size of the SWF to be 1024x768 regardless of the browser window.
how to achieve this in the HTML source code and/or AS2?
A slideshow containing advertisements, randomized in a way that each ad gets the same chance at being the first one to show when the page gets opened. Or rather, not randomizing, but alternating between about 25 different ads, perhaps even more
View 5 Repliesbasically i have this jigsaw code, and i need to modify it so that the only jigsaw piece that will be accepted is the answer to a question which is randomised as follows,
[Code]...
How can same be false in the following snippet?
var child1:ApplicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
var child2:ApplicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);
var same:Boolean = (child1.parentDomain === child2.parentDomain);
trace(same);
Is there an easy way to compare two TextFlow objects with each other? I have two text flow objects that are created with TextConverter.importToFlow() and want to check if they are equal or not. Only way I found so far is to use TextConverter.export() to export them to a string then compare which seems bit convoluted...
View 1 RepliesHow can I set a movie clip to be at a certain x/y coordinates pending on a var? cog is the name of the movie clip. example:
ActionScript Code:
//
onClipEvent(Enterframe){
if(var=1){
[Code].....
[Code]...
My dynamic text box is set to: _root.selectedcolor but instead of displaying "Rose" it displays"_root.fabric01_chip10_name" Basically I need to get the literal value to equal an expression- how do I do this????? I've done this before, but it's slipping my mind.
Is there a way to make a new array like an old one but have it not be a reference?
View 2 RepliesI am building a horizontal navigation and I am having trouble getting equal spacing between the mc's. Inside the mc's there is a text box that will contain different titles.
Code:
function buildNav():Void
{
[code].....