ActionScript 3.0 :: Equal Space Between Mc's?
Jan 31, 2010
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]....
View 2 Replies
Similar Posts:
Aug 27, 2010
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.
View 2 Replies
Feb 9, 2009
what 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 Replies
Dec 10, 2010
is 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
View 6 Replies
Feb 21, 2005
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.
}
View 14 Replies
Sep 4, 2010
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 Replies
May 30, 2011
What'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?
View 4 Replies
Dec 28, 2011
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.
View 3 Replies
Jan 22, 2008
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 Replies
Dec 4, 2007
I 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].....
View 6 Replies
Aug 1, 2008
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)
View 1 Replies
Mar 2, 2010
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.
View 1 Replies
Apr 21, 2009
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?
View 5 Replies
Feb 6, 2001
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 Replies
Nov 12, 2009
If you trace(50000) & trace(050000) it will give you different values. how to get similar values for both numbers?
View 3 Replies
Apr 1, 2010
how 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?
View 3 Replies
Aug 30, 2010
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 Replies
Mar 7, 2012
basically 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]...
View 6 Replies
Dec 17, 2010
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);
View 1 Replies
Jan 21, 2012
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]........
View 2 Replies
Feb 10, 2012
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 Replies
Feb 3, 2010
How 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].....
View 3 Replies
Feb 3, 2004
[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.
View 6 Replies
Oct 12, 2006
Is there a way to make a new array like an old one but have it not be a reference?
View 2 Replies
May 29, 2007
I 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].....
View 4 Replies
Sep 2, 2004
Can I make a variable equal two movieclips? Like:
nav1 = _root.nav.nav1 & _root.map.map1;
And then run a function that would control both? Like:
function closeout() {
nav1.gotoAndStop(3);
}
View 6 Replies
Jun 11, 2010
Is there a way to check if an event object is == to a sprite. For example
Actionscript Code:
if(evt.target == [object Sprite])
View 3 Replies
May 23, 2011
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 Replies
Oct 18, 2009
is array.splice equal to displaycontainer.removechild?
View 1 Replies
Jul 26, 2004
I have a preloader. On one frame of the preloader is the code:
i++
loadtext = i;
emptyMC = "holder"+i
allimages._visible = false;
allimages.createEmptyMovieClip("holder"+i, i);
allimages[emptyMC].loadMovie("weddingsintro"+i+".jpg");
Everything works fine, but the dynamic textfield with the var name loadtext is blank. If i set loadtext = i+"loaded" then it just displays "loaded". I know the variable "i" has a value since the rest of the preloader works.
View 4 Replies