ActionScript 3.0 :: Creating Infinite Amount Of Sprites (shouldn't)
Nov 6, 2010
In my project, there is a Movie Clip with the title 'box' For some reason, this is creating an infinite amout of children(b), instead of just one. This is my code:
[Code]...
View 1 Replies
Similar Posts:
Aug 15, 2010
I would like to create multiple sprites with a checkbox to remove all items from that sprite without removing the sprite itself. I would rather not create a script for each individual sprite. I would prefer creating one function that creates all the sprites ... If you see below, I would like the function (CreateSprite(10,20)) to include one on the sprites I created in the first line i.e.: CreateSprite(10,20,s1); rather than create 3 CreateSprite functions. I would also like to avoid creating multiple boxClick functions for each sprite.
var obj:Sprite;
var s1:Sprite, s2:Sprite, s3:Sprite
function CreateSprite(xx:int,yy:int):void{
obj = rectSprite();
obj.x = xx;obj.y = yy;
[Code] .....
View 0 Replies
Nov 19, 2009
i'm "experimenting" a bit with code at the moment and now i have written a class that creates a circle that bounces at the bottom of the stage. Wich has a random size and a random starting point.But now i wan't to expand the code so that i can have a random amount of balls bouncing down, so instead of only one there are f.e. 3 balls.Also i have noticed that the stage.stageHeight does not get updated when i resize my screen when i run iton how to make that happen ?
package {
import flash.display.Stage;
import flash.events.*;
[code]....
View 12 Replies
Nov 12, 2002
onClipEvent (load)
{
xcenter=377;
speed=1/10;[code].....
i did the tutorial but something is wrong cuz when i created my own little sliding thingy and i put my mouse so it slides left or right on the right side it cuts off a bit when going infinite.I think its something to do with the positioning of my menu because its not on x=0 its on x=120.8 and i was trying to work out how to fix it but i'm stuck...and when i move the menu to x=0 it works nicely.
View 15 Replies
Nov 17, 2009
I'm relatively new to AS3. There's one thing that I don't quite understand about Sprites. I'm making a tile based game, and all the tile graphics for a level are inside one movie clip in each frame. Would I be able to go about creating multiple sprites based on the frames in said movieclip's timeline I would I have to go through and make a separate library graphic for each.
View 2 Replies
Feb 11, 2012
I have been having a serious issue with custom video where flash is saying that the amount of the video so far played is MORE than the amount that it has downloaded, which is clearly impossible. This results in various problems, such as the playhead (scrubber) moving past the end of the loader bar. I posted a simple demo that displays the amount loaded and the amount played in text fields. You can see it at: [URL][Code]...
View 5 Replies
Feb 11, 2012
So I have been having a serious issue with custom video where flash is saying that the amount of the video so far played is MORE than the amount that it has downloaded, which is clearly impossible. This results in various problems, such as the playhead (scrubber) moving past the end of the loader bar.I posted a simple demo that displays the amount loaded and the amount played in text fields. You can see it at: URL...[code]I encoded the video at a high rate so that it would download slowly. It may not playback smoothly, which I am not concerned about. What I am concerned about is the numbers below the video what are derived from ns.bytesLoaded and ns.time. If you watch it for a bit, the amount played should exceed the amount loaded.
I double checked the video duration and the bytestotal that flash is reporting and they are correct. I don't know of any way to check the accuracy of bytesloaded.If your internet connection is super fast, you may not see the issue - it only occurs when it is playing back faster than it is downloading - if this is the case, you may need to throttle your speed down, or start downloading a large file while you are watching this demo in order to see the issue.But this is a serious issue and means that building custom video interfaces with loadbars and playheads is impossible!
View 1 Replies
Oct 20, 2011
I am preparing a presentation DVD... DVD will contain wmv video, user manual and another flash exe file... So DVD interface will contain three elements; user manual, a flash exe file and video.. Flash video window will be short-time video, playing like 5-10 seconds then repeats itself... My question is, how could I accomplish to put video window playing certain amount of time then repeats itself, in main window? I need as3 fla example, which could be so useful for me..
View 1 Replies
Dec 4, 2010
I have a game of you controlling a rocket and avoiding walls.When you hit the walls the rocket goes to frame 50 and plays an explosion sound and an animation then the playhead stops at frame 70.But for some mystical reason when the rocket is still moving (as in not blown up yet) the sound keeps repeating over and over. I placed a trace in the rocket's enterframe event to check its currentFrame but it stays at frame 1 like it should. And yet the sounds still keeps playing. This is just infuriating.
View 1 Replies
Dec 15, 2010
I am considering using class extension as a way to connect my model with my controller. I tried looking on the internet but could not find any information on this topic. This led me to the question of when a class should be extended and for what reasons.
[Code]...
View 2 Replies
Oct 4, 2010
Having to do some as2 with an ancient system, and am far from fresh on it. I've managed to bungle my way through most of it, but I've hit a strange logic problem.
Code:
trace(this.firstChild.firstChild.firstChild);
trace(this.firstChild.firstChild.firstChild.nodeName);
trace(this.firstChild.firstChild.firstChild.nodeValue);
produces:
[Code]...
View 3 Replies
Nov 28, 2009
Using AS3 in flash CS4Hi i have some imported text from a tab delimited/seperated text file (.txt).I have split the values into an array using .split('') .split(' ')I have stored the imported data into an array where each column has a new index and the properties of each row can be gained from array[n].property. For example array[4].name would give the 'name' of the 4th entity in the original text file.This all works fine however some of the separated strings are formatted incorrectly as they take up 2 lines instead of one.The first string in each line in the original text file is imported into flash with a new line above it. I.e: "Property1" in the original tab delimited/seperated text file is stored in flash as "Property1" with a new line above it. I need to get rid of this new line in order to appropriately display the text in text fields.
View 5 Replies
Jan 12, 2009
I've got a clip on the stage at (100, 100) and I execute the following code:
[Code]....
Given that circle1 is on the stage, shouldn't localToGlobal leave the co-ordinates unchanged? I think the result of its call is wrong!
View 2 Replies
Aug 28, 2009
If I add the button component to my movieclip it makes it bigger, as if there's some sort of invisible padding or margin around it. Making a new fla, dragging the button component, and setting the below code as the document class produces a trace of w: 320, h:250 when run.Removing the mc.addChild(btn) line gives me a trace of w: 320 h: 240.The button isn't even close to the edge of the movieclip, so why is it expanding the movieclip's height by 10 pixels? I've been reading the documentation for the last few hours, but I can't find some hidden margin style or anything of the like I've been missing. The FLA & .as file are available here http[url].....
ActionScript Code:
package
{
import flash.display.*;[code].....
View 1 Replies
May 16, 2004
I'm making a game, and it has an onEnterFrame which checks each players status (hp and turn), and decides what to do based on that. Looks like this:
Code:
_root.onEnterFrame = function(){
if(enemy.HP>0){
if(hero.HP>0){
if(hero.turn==0) {
[code]....
So this works fine when it's the players turn. But when it's the enemy's turn, the enemy simply attacks a bunch till hero.HP<0 and enemy wins. I am certain this is because it's checking each frame to see if it's the enemies turn and then it executes the hitting code before the turn is changed (which must mean this is freakin fast, so cool, but not good for me here!).I tried simply making a function to call at the end of the attack, with a function that happens only on first turn to let the player initiate, but when then the hero makes no attack, enemy attacks and there is a recursion error and it shuts down.
View 5 Replies
May 16, 2004
I'm making a game, and it has an onEnterFrame which checks each players status (hp and turn), and decides what to do based on that.[code]So this works fine when it's the players turn. But when it's the enemy's turn, the enemy simply attacks a bunch till hero.HP<0 and enemy wins. I am certain this is because it's checking each frame to see if it's the enemies turn and then it executes the hitting code before the turn is changed (which must mean this is freakin fast, so cool, but not good for me here!).I tried simply making a function to call at the end of the attack, with a function that happens only on first turn to let the player initiate, but when then the hero makes no attack, enemy attacks and there is a recursion error and it shuts down.
View 5 Replies
Jul 15, 2010
In flash actionscript3.0 Now we have one problem with speech and thought bubbles.
we want to transform the movieclip inside the textfield. if transform, textfield text shouldn't resize.
View 1 Replies
Sep 16, 2010
In my flash program I have everything on one frame. In the actionscript on that frame, I made a variable called currentButton and set it to the first button, to keep track of which button is currently pressed. In the click function this variable is changed to whatever button was clicked.Now, I didn't think this would work, because seeing that the one frame is being played over and over, (there's no stop() command in there) I thought currentButton would keep being reset every frame. To my surprise, it worked just fine. Not that I'm complaining, but I'd like to know why it's doing that. Shouldn't all the code on the frame be done every time the frame is played, including the part that sets currentButton to button1?
View 4 Replies
May 18, 2010
I'm absolutely new to AS and wondering why this doesn't move the way I'd like it to...Logically, shouldn't the x increment display each time it happens, showing a constant animation? Instead, the x increments 50 at a time, so the rect is at 0, then it's a 50
Code:
var container:Sprite = new Sprite();
var item:Sprite = new Sprite();
[code]......
View 1 Replies
Aug 26, 2010
So I have a Movieclip with a Listener listening for MOUSE_OVER, and on mouse over it triggers a function ToolTip.
[Code]...
which triggers the tooltip function but the problem is that... when the mouse is clicked on MC2 showToolTip works fine.. but when I mouse_out of MC2 it runs exitToolTip function from MC shouldnt it run exitToolTip only when you mouse out of MC? how do I make exitToolTip run only when we mouse out of MC rather than MC2 ...
View 1 Replies
Mar 29, 2009
Shouldn't flash detect these before running the script and crashing and having to force quit and restart (and flash startup takes a while)? Like just give an error: infinite for loop or something? And this happened to me a bunch when working with for loops within for loops, when I accidentally used the same variable for both loops, so of course it never ended and crashed flash.
View 2 Replies
May 16, 2010
Basically, I have a XML file similar to:
<Main><Event><Name>Blah</Name>
<Event><Name>Blah2</Name><Event>
<Name>Blah3</Name>
...
</Event></Event></Event></Main>
Yeah, to some extent it's poor design. But the idea I'm going for is that any Event has the potential to compromise of other Events and this idea kinda loops. How to do this?
View 2 Replies
Jun 18, 2010
I want to access a webservice:getMonitorData() , on creationcomplete and returns an array, in an infinite loop so that the getIndex0.text is updated each time.Flex is not able to handle an infinite loop and gives a timeout error 1502. If I run the for loop until i<2000 or so it works fine.How can replace the loop so that my webservice is accessed continiously and the result is shown in getIndex0.text.This is how my application looks like:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
[code]....
View 4 Replies
Jan 27, 2010
I posted on Kirupa Yesterday trying to get help with a project. I've had no response because the help I need is admittedly a pain in the behind. I'm at the end of my thether here so I thought I try posting here also. I'm in the process of trying to make an "infinite scrolling tsunami accordian". Sounds sweet right.
Its supposed to grow as items are moused over along with accordion functionality. also it is supposed to wrap around the items. Ive gotten very close but I have some problems that I've hit a wall on. I've never seen a 3 in one menu like this and it'd be really cool to get it going.
So far I have the tsunami effect and the wrapping around. The only problem is that when you click on an item, instead of the items below it animating to the bottom bound of the menu and then appearing at the top when they go too far theres a big *** pause and then they just jump to wrap around position.
The accordion aspect is there too but I can't figure out how to handle the spacing when an item is expanded. I've attached a zip file containing the project in the hope that somebody might have the time to try and me flesh this out . The class in question is named infiniteTsunamiAccord.
View 0 Replies
Mar 3, 2011
I need to determine if a ray from a point (point and angle or vector) which goes to infinity intersects a line segment (two points), and if so, what direction it crosses (left or right.)I've been searching around on google but haven't had any success implementing the math solutions.I'm trying to do is implement the winding fill rule described here to determine if a path is clockwise or counterclockwise.
View 2 Replies
Oct 9, 2004
Im using the infinite menu code from the tut.
The AS in the tut works fine in a stand-alone swf, but if you load it into another swf it wont work properly cuz it uses values like _ymouse<18
Those absolute values are not correct once the swf is loaded into a different sized movie.
What would you guys say is the best way to convert the code so that it would work when loaded?
If thought of changing every value to a target such as _root.MCinMAINmovie.CONTAINERmcFORinfiniteMENU._xm ouse>218 but this seems rather tedious... and it makes it hard to build code for something that needs to be a loaded swf and test it say before you have you main swf built.
Heres the code for the infinite menu
Code:
onClipEvent (load) {
xcenter = _root._width/2;
speed = 1/10;
[Code]....
View 3 Replies
Nov 10, 2004
i've created av "infinite menu" a menu that moves in a direction depending on the position of the mouse. I need a little help to make it stop whenever the mouse aint over the menu.[code]This is just a beta version so the grapics aren't correct.
View 4 Replies
Jul 2, 2005
Code:
//this is one of the code pieces I've been trying
scroll_menu.onEnterFrame = function() {
var speed=.5/100;
var xcenter=400;
[code]....
View 1 Replies
Sep 20, 2006
I've got a infinite scroller (adjusted one of scotty's) and it's not wrapping around i.e there's a gap in the images, the last image kinda blinks at a certain point.I've attached the files, it's probably something quite simple but i cant see it.Here's the script:
Code:
spacing = 0;
containerMC._alpha = 100;
[code]......
View 14 Replies
Feb 7, 2007
I've got the very old infinite menu posted on Kirupa's site. I haven't done anything but switch it to a vertical menu, but the problem is that I put a button in the menu, the 2nd grey box, with a getURL that just goes to google. Problem is, it won't load the url. I had wanted to put buttons in this menu to get new URLs or do things it flash, but it won't respond.
View 2 Replies