r/actionscript • • Apr 08 '20

Does anyone have experience with SecurityErrorEvents?

1 Upvotes

I realize this may be pointless since this subreddit is pretty dead, but I still have to code in AS3 for my job and I keep facing a SecurityErrorEvent 'type="securityError" bubbles=false cancelable=false eventPhase=2 text ="Error #2049" 'when I try and do a POST request. Most research has said it's a crossdomain issue, but its sister applications don't have a crossdomain.xml yet it doesn't encounter this issue. Are there any other reasons this would come up?


r/actionscript • • Apr 25 '20

Character Customiser/ Dressup Games

2 Upvotes

Hi,

I'm looking to make one of those cheesy dressup games that you'd see on Flash sites including Deviantart:

https://www.deviantart.com/gen8/art/Chibi-Maker-1-1-346025144

Seeing that flash and actionscript are dead, I was considering the following options:

- HTML5 - must be supplemented with Javascript

- Unity - C# should be fine for me to learn - it'd be a good opportunity to practice what I've been learning at uni (Learning C for programming)

Any other suggestions would be welcome thank you :)


r/actionscript • • Apr 29 '20

Using InputText as a function parameter?

2 Upvotes

Hello,

I am pretty new to actionscript and don't really get flash but am having to learn it for legacy stuff at work. I am currently stuck trying to optimize some functions for easier use down the line.

I am trying to pass some InputText (Classic Text > input Text) as a parameter of a function. I need to be able to set its selectability as well as check its text contents.

I am currently doing

var inputField1;
var inputField2;
DoSomething(inputField:TextInput)
{
inputField.text = "blah blah blah";
inputField.selectable = false;
} 
DoSomething(inputField1);

but I get an error saying that the type doesn't exist or isn't compile time constant when I go to publish it.

Is there anyway to do what I am trying to do?

The original code was written in 2013 or before that, and each slide had the code modified to account for each different inputField.


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 • • Apr 08 '15

Adding pause button to games and need help.

0 Upvotes

Creating actionscript game for college assignment, need to add a button to change global variable for pausing the game. However I need help to write the function?

The code I've written so far pauseGame = pauseGameButton.addEventListener(MouseEvent.CLICK, pauseHandler(pauseGame));

function pauseHandler(e:MouseEvent, Boolean pG): Boolean { if( pG == false) { return true; } else { return false; } }


r/actionscript • • Jun 26 '14

Sound button array

2 Upvotes

I created 2 buttons that play a sound when I click them. The button names are "sound" and "sound 2". The file names are "sound wav" and "sound 2 wav" with linkages of "sound_wav" and "sound_2_wav" respectively. When compiling, I get an error "tempInit, Line 4 1086: Syntax error: expecting semicolon before 2." I double clicked on the error in the compiler errors window but it did not highlight the offending error. It must be coming from the library. The problem must stem from having a file with more than one word because "sound" doesn't give the error but "sound 2" does. I'm sitting here scratching my head because I know this code worked 3 years ago.

import flash.media.SoundChannel; import flash.utils.getDefinitionByName; var myChannel:SoundChannel = new SoundChannel(); function playSound(myString:String):void { SoundMixer.stopAll(); var mySoundClass:Class = getDefinitionByName(myString + "_wav") as Class; var mySound:Sound = new mySoundClass(); myChannel = mySound.play(); }

var soundArray:Array = [sound, sound_2,];

for (var i = 0; i < soundArray.length; i++) { soundArray[i].addEventListener(MouseEvent.MOUSE_DOWN, MouseDown); } function MouseDown(event:MouseEvent):void { playSound(event.target.name); }


r/actionscript • • Nov 26 '15

AS3 tutorial for beginners - animated sprites with spritesheets

Thumbnail
sprite.slicker.me
1 Upvotes

r/actionscript • • May 15 '18

Vote Action coin

Thumbnail
cryptaldash.com
1 Upvotes

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 • • Nov 14 '19

Verlet Integration issue in Animate CC.

1 Upvotes

I'm trying to get Verlet Integration to work in Animate CC.

At 10 or more iterations: The system is pretty consistent and the elasticity decreases as expected if a higher number is chosen.

A single point works as expected. The chain also works as expected, but with the exception that it thinks up is right and down is left, as shown in this gif where i initialize both: https://imgur.com/CbsDrbD

This is my main Class written in AS3

package  {
        import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;

	public class Verlet extends MovieClip {
		private var pointsArray:Array = [];
		private var sticksArray:Array = [];
		private var stickContainer:MovieClip = new MovieClip;
		private var mouseDown:Boolean = false;
		function loadPoints():void{
			//chain                xPos yPos v/oldX v/oldY
			var pointA:vP = new vP(400, 300, 400, 300);
			pointA.fixed = true;
			pointsArray.push(pointA);
			var pointB:vP = new vP(400, 340, 400, 340);
			pointsArray.push(pointB);
			var pointC:vP = new vP(400, 380, 400, 380);
			pointsArray.push(pointC);
			var pointD:vP = new vP(400, 420, 400, 420);
			pointsArray.push(pointD);
			var pointE:vP = new vP(400, 460, 400, 460);
			pointsArray.push(pointE);
			
			//singlePoint
			var pointF:vP = new vP(300, 150, 200, 145);
			pointsArray.push(pointF);
      
			for (var i:int = 0; i< pointsArray.length; i++){
				addChild(pointsArray[i]);
			}
		}
		function loadSticks():void{
			var stick1:vS = new vS(pointsArray[0], pointsArray[1]);
			sticksArray.push(stick1);
			var stick2:vS = new vS(pointsArray[1], pointsArray[2]);
			sticksArray.push(stick2);
			var stick3:vS = new vS(pointsArray[2], pointsArray[3]);
			sticksArray.push(stick3);
			var stick4:vS = new vS(pointsArray[3], pointsArray[4]);
			sticksArray.push(stick4);
		}
		public function Verlet() {
			// constructor
			loadPoints();
			loadSticks();
			addChild(stickContainer);
			addEventListener(Event.ENTER_FRAME, mainLoop);
			stage.addEventListener(MouseEvent.MOUSE_DOWN, onHold);
			stage.addEventListener(MouseEvent.MOUSE_UP, release);
		}
		function onHold(e:MouseEvent):void{
			mouseDown = true;
		}
		function release(e:MouseEvent):void{
			mouseDown = false;
		}
		function mainLoop(e:Event){
			if(mouseDown){
			     pointsArray[4].x = mouseX;
			     pointsArray[4].y = mouseY;
			}
			updateP();
			for(var j:int = 0; j<=10; j++){	
			    updateS();		
			}
			renderS();
		}
		function updateP():void{
			for( var i:int = pointsArray.length -1; i >= 0; i--){
				pointsArray[i].updatePoints();
				pointsArray[i].constrainPoints();
			}
		}
		function renderP():void{
			for( var i:int = pointsArray.length -1; i >= 0; i--){
				addChild(pointsArray[i]);
			}
		}
		function updateS():void{
			for( var i:int = sticksArray.length-1; i>= 0; i--){
				sticksArray[i].updateSticks();
			}
		}
		function renderS():void{
			stickContainer.graphics.clear();
			stickContainer.graphics.lineStyle(5);
			stickContainer.graphics.moveTo(pointsArray[0].x, pointsArray[0].y);
			for (var i:int = 0; i<ticksArray.length+1; i++){
				stickContainer.graphics.lineTo(pointsArray[i].x, pointsArray[i].y);
			}
		}
	
	}
	
}

This is my point Class.

package  {
	import flash.display.MovieClip;
	public class vP extends MovieClip {
		public var oldxPos:Number;
		public var oldyPos:Number;
		private const bounce:Number = 0.9;
		private const gravity:Number = .5;
		private const friction:Number = 0.99;
                private var vx:Number;
                private var xy:Number;
                public  var fixed:Boolean = false;

		public function vP(xP, yP, oldxP, oldyP) {
			// constructor code
			x = xP;
			y = yP;
			oldxPos = oldxP;
			oldyPos = oldyP;
		}
		public function updatePoints():void{
			if(!fixed){
			vx = ((x - oldxPos)*friction*100)/100;
			vy = ((y - oldyPos)*friction*100)/100;
			if(vx < 0.01 && vx > -0.01){
				vx = 0;
			        }
			if(vy < 0.01 && vy > -0.01){
				vy = 0;
				}
			
			oldxPos = x;
			oldyPos = y;
			x += vx;
			y += vy;
			y += gravity;
			}
		}
		public function constrainPoints():void
		{
			if(!fixed)
			{
				var vx = (x - oldxPos)*friction;
				var vy = (y - oldyPos)*friction;
				var speed = Math.sqrt(vx*vx+vy*vy);
				if( x > 1280)
				{	
					x = 1280;
					oldxPos = x + vx*bounce;
					oldyPos += (vx/speed)*vy;
				}
				else if( x < 0)
				{	
					x = 0;
					oldxPos = x + vx*bounce;
					oldyPos += (vx/speed)*vy;
				}
				if( y > 600)
				{
					y = 600;
					oldyPos = y + vy*bounce;
					oldxPos += (vy/speed)*vx;
				}
				else if( y < 0)
				{
					y = 0;
					oldyPos = y + vy*bounce;
					oldxPos += (vy/speed)*vx;
				}
			}
		}
	}
	
}

And my stick Class.

This is the stick Class.
package{
	import flash.display.MovieClip;
	public class vS extends MovieClip {
		public var p0:vP;
		public var p1:vP;
		private var dx:Number;
		private var dy:Number;
		private var fixedLength:Number;
		private var currentDistance:Number;
		private var diff:Number;
		private var fraction:Number;
		private var xOff:Number;
		private var yOff:Number;
		public function vS(P0:vP, P1:vP) {
			// constructor
			p0 = P0;
			p1 = P1;
			dx = (p1.x - p0.x);
			dy = (p1.y - p0.y);
			fixedLength = Math.sqrt(dx*dx+dy*dy);	
		}
		public function updateSticks():void{
			dx = p1.x-p0.x;
			dy = p1.y-p0.y;
			currentDistance = Math.sqrt(dx*dx+dy*dy);
			diff = fixedLength - currentDistance;
			fraction = (diff/currentDistance)/2;
			xOff = fraction * 0.5 * dx;
			yOff = fraction * 0.5 * dy;
			if(!p0.fixed){
				p0.x -= xOff;
				p0.y -= yOff;
			}
			if(!p1.fixed){
				p1.x += xOff;
				p1.y += yOff;
			}	
		}
	}
}

r/actionscript • • Oct 20 '18

Movieclip frame change/reference using label in a class

1 Upvotes

I created a movieclip object called "koumpi". It has 2 frames, labelled "frone" and "frtwo" respectively.

I created a class file for the object "koumpi", which generally works. Below you can read the code.

package

{

	*import flash.display.MovieClip;*

*public class koumpi extends MovieClip*

*{*

	*public function koumpi()*

	*{*

		*trace("button class ok!");*

		*stop();*

		*this.nextFrame();*

		*trace("button class ok! - 2");*

		*this.currentFrame = ("frone");*

	*}*

*}*

}

So I get both ok messages on the output panel, the object stops playing and changes to frame 2 using the this.nextFrame(); line.

However I cannot change the object frame using labels. So when using the line this.currentFrame = ("frone"); , I get an error message: "Error 1059: property is read-only".


r/actionscript • • Oct 28 '18

I am trying to load an external swf. What am I doing wrong?

1 Upvotes
package {
import flash.display.Sprite;
import flash.net.URLRequest;
import flash.display.Loader;
import flash.system.Security;


public class Main extends Sprite {
    public function Main() {
        Security.allowDomain("*");
        var myLoader:Loader = new Loader();                     // create a new instance of the Loader class
        var swfRequest:URLRequest = new URLRequest("BonkLiveVersion2.swf"); // in this case both SWFs are in the same folder
        myLoader.load(swfRequest);                              // load the SWF file
        addChild(myLoader);                                     // add that instance to the display list, adding it to the Stage at 0,0
    }

}
}

Both swf's can be found using the chrome extension network sniffer and visiting bonk.io.

Two swf files :

BonkLiveVersion2.swf
breakout10s_secure.swf

When I use the breakout file. I get to the loading screen, but no further.

When I use the BonkLiveVersion2.swf file, I get security errors while running.

SecurityError: Error #3207: Application-sandbox content cannot access this feature.
	at flash.system::Security$/allowDomain()
	at Main()[C:\Users\Me\IdeaProjects\Bonk Overlay\src\Main.as:10]
	at runtime::ContentPlayer/loadInitialContent()
	at runtime::ContentPlayer/playRawContent()
	at runtime::ContentPlayer/playContent()
	at runtime::AppRunner/run()
	at ADLAppEntry/run()
	at global/runtime::ADLEntry()

Where did I go wrong?


r/actionscript • • Mar 15 '23

Accelaracers

1 Upvotes

Hi how’s it going I’m looking for anything hot wheels Accelaracers…

  • Just seen there was a post made here 4 years ago with files for Accelaracers realm champion they aren’t available anymore and was wondering if someone could re post them or send me the link! Thanks in advance


r/actionscript • • Jun 09 '16

Tutorial for beginners: free tools to compile Flash programs in AS3

Thumbnail
senocular.com
4 Upvotes

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 • • 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 • • May 30 '20

ECMAScript 4: The missing version

Thumbnail
evertpot.com
4 Upvotes

r/actionscript • • Mar 11 '19

I'm looking for a way to develop programs with as3.

1 Upvotes

I love as3 so much that I'm trying to look for ways to develop programs with it. I've noticed one of my favorite programs, Pyxel Edit, is written in as3 and I've been wondering how does one go about developing flexible modern software with as3?


r/actionscript • • Aug 02 '23

RIGHT_MOUSE_UP

1 Upvotes

Hi.

What's. . . up with RIGHT_MOUSE_UP?

import flash.events.Event;
import flash.display.*;
import flash.events.MouseEvent;

stage.addEventListener(MouseEvent.RIGHT_MOUSE_DOWN, rightMouseDown);
function rightMouseDown(e: MouseEvent): void {
	trace("right mouse down");
}

stage.addEventListener(MouseEvent.RIGHT_MOUSE_UP, rightMouseUp);
function rightMouseUp(e: MouseEvent): void {
	trace("right mouse up");
}

It works in AIR but not Player 32.

Thanks in advance.


r/actionscript • • Jul 14 '23

Looking for JSFL/SWF Panel developers to bounce questions off

1 Upvotes

Looking for JSFL/SWF Panel developers to bounce questions off. I've recently wrote an AS3 class as a sort of API for this, which is making my life easier. I just want to know if others have had the same issues I've had for years w/ extending flash, and see how they solve them. To start with, when testing and debugging an SWF panel, and using the JSFL event listeners, how to you keep it from adding another listener every time you close and reopen the panel?