How to do a simple drawing app in Flash? - actionscript-3

I am trying to do a simple drawing app in Flash Professional CC. By simple, I just mean something that allows the user to click down and draw and mouseup- stop drawing.
I've been following this tutorial: https://www.youtube.com/watch?v=OXdphAAH1mQ
However, on the line:
... _root._xmouse, _root._ymouse
I get an error which says that it's undefined... I tried mouseX as well, which also didn't work.
I assume it's because I'm using Professional CC so it may be a different version of AS. Does anyone have any tips on how I can get a drawing app working on Prof CC?

_root._xmouse, _root._ymouse It's an AS2. As you could see in Tutorial, he also creates AS2 project. I'm not sure, that you can create AS2 project in Flach CC. As far as I can see, there is no option to create ActionScript 2. Here is AS3 Drawing App tutorial;

Related

Can someone explain AIR Native Extensions FREGetContextActionScriptData() and FRESetContextActionScriptData() in more detail?

I have created an AIR Native Extension wherein, I have created a reusable Loader object on the AS3 side. I then pass this Loader object to the ANE to load whatever loadable file I want to load into the Loader. This works, as expected.
I would like to create the reusable Loader on the C side of the ANE. My understanding is that the FRESetContextActionScriptData() and FREGetContextActionScriptData() functions allows me to create and store AS3 FREObject variables on the C side.
I have been trying to implement these functions on the C side and and unable to wrap my head around how to do so. The Adobe help is insufficient and does not help in any way. I have tried to search for these two words with no success. Can someone throw some light on how these functions are used?
Thanks in advance.

updater function with air framework

this is for flash CS6 AS3 AIR
Seriously I've been searching for 3 days straight
found these among others.
http://gregsramblings.com/2008/08/16/adding-auto-update-features-to-your-air-application-in-3-easy-steps/
http://www.adobe.com/devnet/air/articles/air_update_framework.html
but they all output errors like Scene 1, Layer 'Layer 1', Frame 1, Line 2 1172: Definition air.update.events:UpdateEvent could not be found. not all have this specific error but they all have a definition error. Apart from that they are doing a lot of things in the tutorial that I simply don't need.
I already made a version detector and right now it's downloading the air file to the desktop but I need something more practical. is there something like updatenTo(http://address.com/myApp.air) - which just start the air updateframework to update from the .air file at the refered address.
or even a download command that tells me where the user downloaded the file to so I can execute the file and terminate the program. like file.addEventListener(Event.locationOfDownload,downloadFileContainFunction);
or link me to a tutorial that has working code.
Okay, so my problem here actually boiled down to finding "applicationupdater.swc" and how to import it.
It's found at "C:\Program Files (x86)\Adobe\Adobe Flash CS6\AIR3.2\frameworks\libs\air" on my machine
One can import it by going to "publish settings" and click the wrench key next to "script: ActionScript 3.0" and going to the library path clicking the little red f on white background.
That error is telling you that you haven't imported the class or embedded the library you are trying to use.

how to I make my flash AS3 game save progress

I have this flash game that I've been working on that works out of the browser, and I'm looking to get it to save it's progress.
I've seen multiple flash games that have accomplished this, and It appears as though they've done this client-side, and I'd like to do the same.
My game consists of 1 mxml file and a number of .as files and I compile it from the command line using flex sdk.
What do I have to do to be able to save save my game's data?
As others have mentioned, SharedObject is the tool you'll use for this.
The basics of this are to initialize a reference to a SharedObject using its static method .getLocal() first:
var mySaveData:SharedObject = SharedObject.getLocal("SomeSaveName");
The String given to this method should not contain spaces.
Once you've done this, you'll be able to use mySaveData.data, which is basically a simple object that you can attach properties to on the fly (it's dynamic):
mySaveData.data.levelsComplete = 2;
Once you've done this, you'll be able to reference that value later on using the same process:
trace( mySaveData.data.levelsComplete );
For simple stuff you can use SharedObject
One way is to use flash's SharedObject to save values in to a 'flash cookie' on the client. Example can be found here: Actionscript 3 saving currentframe location to local hard drive?

When building custom panels for Flash CS4 IDE, is there a way to attach callbacks to workspace events?

Is there a way for a custom panel for Flash CS4 to register for IDE events?
I've built a custom panel for the CS4 IDE, and now I'd like to get a callback anytime the current selection on the stage changes. Is this possible?
My backup plan is to have my panel poll the IDE for the selected object several times a second, but this is weak, and won't extend to other kinds of events like deleting objects from the stage or saving the file.
Thanks, Matt
In CS4, yes there are a few events.
There is no selectionChangedEvent unforunately,
buy maybe you can work out something using frameChanged or documentChanged.
DocumentChanged might be more often than you need. Try on frameChanged.
More events are listener in the fl.addEventListener() reference.
Also, here is a handy post on fl events and swfPanel.
Goodluck!

Problem With DAE parser augmented Reality

I tried everything but no success.I am having big problems in importing files.So many error.... spent 5 hours but nothing. I successfully able to create project using collada parser but all the problems are coming when i am using import org.papervision3d.objects.parsers.DAE; There were some files missing and when i tried to download the missing files then it is showing me errors in files that i downloaded. Please suggest me how to get solve it.I wonder w'd it be possible for anyone to upload the configuration of papervision+libspark+ascollada which you used for creating a demo(like Brian Hodge used). Thanks alot in advance.And i am extremely sorry for posting this question in a thread AS3 DAE Augmented Reality PaperVision 3D as an answere.I am new to this forum and havent noticed the question tag.Extremely sorry...
The following is a link to a rather large explanation on PV3D/Flar toolkit AR
AS3 DAE Augmented Reality PaperVision 3D
-Questions
What IDE are you developing in? Flex Builder 3, Flash Develop, and Flash CS4 are all capable of handling embeds utilizing the Flex 3 SDK, BUT, Adobe Flash CS3 does not allow you to used embed and will not recognize it.
-Flash CS3 produces the following
TypeError: Error #1007: Instantiation attempted on a non-constructor.
at Untitled_fla::MainTimeline/Untitled_fla::frame1()
-The Following works in all the others listed above
[Embed(source="foo.jpg")] //<--- NO SEMICOLON OR BREAKS
private var foo:Class;
var testFoo:Bitmap = new foo();
-Important
One thing that I would like to note, notice there is no semicolon on the embed line!
Hope this helps, apparently the original poster figured his/her problem out, but wanted to answer sid.