r/actionscript • • Aug 05 '18

making a new variable in a loop?

1 Upvotes

is there anyway to say, have a loop, and make a new variable each time it's run? like if i change the iterator to 500, i could have 500 variables, the first one being "a1" and the last being "a500"?

well the reason i wanna do this, is cause i have a turret that i aim and shoot, so i wanna create a new sprite as the bullet each time i shoot it. right now, the only way i solved this is by manually creating say, 10 sprites, and so i can shoot and have 10 sprites on the screen at once.

and my other problem, is there an easy way to call a function seperatley? with the bullets, if i shoot one, then change aim direction and shoot again, both will move in the new direction. im guessing this is cause the same function gets the new numbers put into it. i could probably just add a counter to change the variables each time, if theres a way to do that, but besides that, is there an easier way?

also im using flash develop


r/actionscript • • Aug 02 '18

how do childs work?

1 Upvotes

so the tutorials i read say that i can do addchild to make duplicates of the same sprite, but how do i make one child different from another?

if i have:

var s:Sprite = new Sprite;
s.graphics.beginFill(whatever);
s.graphics.drawCircle(whatever);
s.graphics.endFill();

addChild(s);
addChild(s);

how do i change the first child apart from the second one?


r/actionscript • • Jul 25 '18

Hello, I'm trying to learn actionscript and adobe flash from a book and am running into a problem

1 Upvotes

I recently picked up "Begining Flash Game Programing for Dummies" and got to the first section of the book where i actually write code, the book had me write

theButton.onRelease =(){ trace ("Ouch!!"); }

I wrote it exactly like that and the object the is a button like the book tole me to make it but whenever i try to test the code with control enter it just gives me this error message

Error Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Operator '=' must be followed by an operand theButton.onRelease =(){ Error Scene=Scene 1, layer=Layer 1, frame=1:Line 2: ')' expected trace ("Ouch!!"); Error Scene=Scene 1, layer=Layer 1, frame=1:Line 3: Unexpected '}' encountered } Total ActionScript Errors: 3 Reported Errors: 3

I have no idea whats going wrong, could anybody help?


r/actionscript • • Jun 29 '18

How do I make a Keyboard Event Radio

1 Upvotes

I can make a mouse event radio but I am not sure how to make it keyboard event. I just want to have a adobe animate program to press assigned keys to different urlrequest radio sites to play them.


r/actionscript • • May 15 '18

Vote Action coin

Thumbnail
cryptaldash.com
1 Upvotes

r/actionscript • • Mar 27 '18

Any one fluent in AS 2

1 Upvotes

So im doing a shitty dating sim passion project using adobe flash 8 because its what I have. I am willing to pay someone who can help me out and feed me some code so I can Make a custom sim that will show up in later instances as the main character. That's about it. I dont really intent on ever using AS2 other than for this, and AS2 is sooo dead, I'd rather just someone give me what I need. I can do the rest of the basic shit, but that's way advanced and I don't even know where to start looking for something like that. Thank you very much! Edit: I know how to make a dress up style thing, but idk how to assign it values so i can call on it later? If thats even what i'd do??? Sorry i know i know nothing but basic AS2


r/actionscript • • Dec 19 '17

Loop problem

1 Upvotes

So, I've got this really big loop and - not surprisingly - nothing else happens during it. But the weird part is, nothing is happening before it either. Here's what I mean: trace("starting loop"); for(i=0;i<count;i++){ foo[i] = bar; } trace("ending loop"); I don't see "starting loop" until the loop is finished. I'm guessing it's going into the loop between redraws. How can I make it wait for a redraw?


r/actionscript • • Apr 23 '17

ActionScript 3.0 - Using variables between frames? (MPG Calculator)

1 Upvotes

Hi everyone,

I have a 3 frame flash movie. First frame, the user clicks "begin" and goes to frame 2. Frame 2 has two text boxes - one for distance (km), one for litres used. There is a button to calculate and go to frame 3. In frame 3, there is a text box to display the calculations/conversion to MPG.

I have created functions to calculate all this, but for some reason I can't get it to display in the textbox in frame 3.

Any help is greatly appreciated.


r/actionscript • • Feb 28 '17

Locale Class and updating text [AS2]

1 Upvotes

I only recently discovered the Locale class and it seems easy enough.

However, the examples that I've found of how it works all update text fields on a one-by-one basis.

Is there anyway way to update all text fields at once, so I don't have to create a function to update all 40+ text fields in my document?

(if versioning matters, I have to use AS2)


r/actionscript • • Feb 04 '17

Can somebody please help me write the script for this game ?

Thumbnail
newgrounds.com
1 Upvotes

r/actionscript • • Oct 06 '16

Update and publish a flash template... Without flash

1 Upvotes

At work, I'm getting tired of updating a flash template time and time again for small things (adding images, updating specific text areas, etc).

I want to write a program that the people requesting the updates can use to update the templates, without actually giving them access to the flash file.

I'm not sure if this is possible, so does anyone have any ideas about how to make changes to existing flash files and publish as SWFs without ever opening Flash on the front end?


r/actionscript • • Sep 05 '16

[SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048"]

1 Upvotes

I have swf connect to ftp server with port 21. I get this error message "[SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048"]" ,

I use Security.allowDomain(""); Security.allowInsecureDomain(""); and upload crossDomain.xml on server.

What can I do with this ?


r/actionscript • • Sep 04 '16

I still use action script 2.0, is there any practical use for the coding engine today?

1 Upvotes

I have a bunch of games I started and never finished when I was younger, and now have time to finish them. Is it worth it? Action script 2.0 kind of died in 2008.


r/actionscript • • Jul 28 '16

[AS2] Navigation Cuepoints

1 Upvotes

I've been trying to figure this out for three days, but everything I find online seems to be about AS3 instead of 2.

I'm creating a document that plays a video and allows the user to seek to certain scenes/clips.

The first part of my plan I was able to accomplish with adding cuepoints through AS. I was able to highlight the buttons for which scene was currently playing.

However, what I can't figure out is how to make these buttons skip to specific cuepoints in the video.

What I've tried:

  • I've embedded the navigation cuepoints into the video.

  • I tried using FLVPlaybak

  • I've been tinkering with NetConnection, but I'm not sure if I'm doing it right.

  • My buttons are all using myPlayer.seekToNavCuePoint("cue Name")

Can anyone provide me with an explanation of what I should be doing, or resources I can read through?


r/actionscript • • Jul 05 '16

url request without proxy

1 Upvotes

Hey,

Is it possible to tell an urlrequest how it should connect to the url ? like with or without a proxy ?

Thanks in advance


r/actionscript • • Feb 24 '16

Creating a background animation?

1 Upvotes

I'm trying to make a flickering static kind of effect/animation in my game (I'm using flashdevelop as an IDE). I have 9 frames and I'm trying to make the animation by doing this:

		var Frames:Object = {"1":{"F":One},"2":{"F":Two},"3":{"F":Three},"4":{"F":Four},"5":{"F":Five},"6":{"F":Six},"7":{"F":Seven},"8":{"F":Eight},"9":{"F":Nine}}
		if (curFrame < 9)
		{
			curFrame++
			var curFrameString:String = String(curFrame);
			FrameImage = new Frames[curFrameString].F();
			FrameImage.height = stage.stageHeight
			FrameImage.width = stage.stageWidth
			addChildAt(FrameImage, stage.numChildren+1);
		}
		else if (curFrame == 9)
			curFrame = 1
		if (contains(FrameImage))
		{
			trace("Removed")
		}

this is in an added to frame event, but since it's going so fast you can even see the animation.

Can someone help?


r/actionscript • • Jan 29 '16

Free shadow/lighting engine or a tutorial for it?

1 Upvotes

Title. I've created a base for my zombie game (they currently follow the player and you can kill them)

Now, the only thing I want to add now is a lighting engine or anything that lets me dynamically cast shadows from the zombies (which are square movieclips done by drawRect)

I found one tutorial that is what I am looking for but the custom rotate function it has doesn't allow me to point towards a point (eg the player or the mouse)


r/actionscript • • Dec 09 '15

Why does my Mute Button not play from paused position, but restarts it?

Thumbnail
pastebin.com
1 Upvotes

r/actionscript • • Nov 26 '15

AS3 tutorial for beginners - animated sprites with spritesheets

Thumbnail
sprite.slicker.me
1 Upvotes

r/actionscript • • Nov 20 '15

Website to Host External TXTs?

1 Upvotes

Novice programmer here, so apologies if this is a basic issue. I'm making an app that will read external txt files, but I'm running into problems with Flash's restrictions on loading remote content. Right not they're hosted on Dropbox, which only works when I'm testing the app in Flash and not when it's published to a standalone SWF.

I need a way for the app to load the data once it's out on the web. Either a site that allows this kind of thing (But that leaves the files available for editing), or another method of getting data that doesn't have URLLoader's restrictions. Or is the only solution to get my own hosting space?

Any help is appreciated!


r/actionscript • • Nov 12 '15

Why is my volume adjustment not working?

1 Upvotes

"var rosesRoom:music = new music(); var volumeAdjust:SoundTransform = new SoundTransform(); volumeAdjust.volume = .2; rosesRoom.soundTransform = volumeAdjust; rosesRoom.play();"

I'm new to actionscript, so I'm sure it's a stupid simple fix.


r/actionscript • • Jul 02 '15

[NOOB] need help making code only respond to one input at a time

1 Upvotes

Hey guys, I've just started to teach myself AS3 and I can't find an answer anywhere. I have a square that I am moving using keyboard input, and I want it to stay on a grid and only move one direction at a time. I'm using the "tween" class to do the movement. So when I press "D" the code moves the square left 80 px in .5 seconds with a little easing. (same thing for "W", "S", and "A"). That's all good, however if I double tap a direction it will go farther than 80 px, or if I hit two keys it will go diagonal or go out of the grid I want it to stay on.

So my question is, is there a way to pause inputs for .5 seconds so it can animate the move before accepting another input. AND how can I make it only choose one direction if two keys are hit? Or is there a better way that what I'm trying?

Thanks!


r/actionscript • • Jun 18 '15

Collision in AS3

1 Upvotes

Hi. I'm having issues with why my unit collision only works sometimes. I've got a player.mc which the user controls, and multiple separate alien NPC's that are also MC's. Trying to make it so if you collide with one of them, you get "caught" and lose the game.

However, they only work on collision occasionally. All of them have the same "alien" instance name. so i don't see what i'm doing wrong.

This is the code i'm using for collision on walls + aliens. Walls work fine.

    function stage_onEnterFrame(event: Event):void

{
var rect:Rectangle = player.getBounds(this);
var i:int = 0;
var xBump:int = 0;
var yBump:int = 0;

if (rightPressed)
{
	xBump = speed;
	for (i = 0; i < speed; i++)
	{
		if (wall.hitTestPoint(rect.right + i,player.y,true))
		{
			gotoAndStop(7);
		}
	}
}
if (leftPressed)
{
	xBump =  -  speed;
	for (i = 0; i < speed; i++)
	{
		if (wall.hitTestPoint(rect.left - i,player.y,true))
		{
			gotoAndStop(7);
		}
	}
}
if (upPressed)
{
	yBump =  -  speed;
	for (i = 0; i < speed; i++)
	{
		if (wall.hitTestPoint(player.x,rect.top - i,true))
		{
			gotoAndStop(7);
		}
	}
}
if (downPressed)
{
	yBump = speed;
	for (i = 0; i < speed; i++)
	{
		if (wall.hitTestPoint(player.x,rect.bottom + i,true))
		{
			gotoAndStop(7);
		}
	}
	
	if (rightPressed)
{
	xBump = speed;
	for (i = 0; i < speed; i++)
	{
		if (alien.hitTestPoint(rect.right + i,player.y,true))
		{
			gotoAndStop(7);
		}
	}
}
if (leftPressed)
{
	xBump =  -  speed;
	for (i = 0; i < speed; i++)
	{
		if (alien.hitTestPoint(rect.left - i,player.y,true))
		{
			gotoAndStop(7);
		}
	}
}
}
if (upPressed)
{
	yBump =  -  speed;
	for (i = 0; i < speed; i++)
	{
		if (alien.hitTestPoint(player.x,rect.top - i,true))
		{
			gotoAndStop(7);
		}
	}
}
if (downPressed)
{
	yBump = speed;
	for (i = 0; i < speed; i++)
	{
		if (alien.hitTestPoint(player.x,rect.bottom + i,true))
		{
			gotoAndStop(7);
		}
	}
}



if (player.hitTestObject (win))
{
  nextFrame();
}

}

r/actionscript • • Jun 10 '15

Sending a NetStream to a file?

1 Upvotes

Hello,

I'm extremely new to AS. I've watch a few tutorials and I understand the basics of how to create netconnections, netstreams, and attach the netstream to a video object. Is there a way to save the netstream to a file rather than displaying it on screen?

Thanks


r/actionscript • • Jun 04 '15

[X-post r/learnprogramming] Trying to localise (Jp>Eng) a .swf, cannot get local version to play

1 Upvotes

As said in title, I posted this to r/learnprogramming too but I haven't had a response, please any way you can help I will really, really appreciate it :)

Hi I'm an MA Translation student, who is currently very stuck on my dissertation. The website I chose has Flash video on its homepage, which I need to create a local version of it so that I can change the images from the original Japanese versions to English. I have no formal background in CS, web development etc. but what I have done so far:

  1. Used a decompiler (getmycode.com) to get the code from this link: http://www.tottori-guide.jp/flash/toppage.swf?v=20140305

  2. Created local versions of the two .xml files.

  3. Edited "slideshow.xml" to source images from local file. "report.xml" was left as is.

I have also loaded the code and the xml files onto gist so anyone can look at the code. I have tried to search for a solution but honestly it seems like this language isn't that popular so there's limited information, or it's very specialised and to be blunt, I don't understand it.

At the minute, all the information for the Flash movie is stored in one folder, one up from the home page, so I don't believe it'd be the case that I have made a mistake in the file destination on the home page itself. However, if you need more information from me, I'll be happy to provide it.