ActionScript 3.0 :: Unexplained Code In "Classroom In A Book"?
Dec 6, 2008
I'm slowly going through the Adobe "Classroom in a Book" on ActionScript. Every now and then the sample code includes what appears to be a property "e" as in "function doThis (e:mouseEvent)" or "var rbg:RadioButtonGroup = e.target as RadioButtonGroup;"
I'm getting this error and I cannot figure out why:
Code: ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.display::DisplayObjectContainer/removeChild() at visualQuiz/removeThis() at Function/http://adobe.com/AS3/2006/builtin::apply() at com.greensock.core::TweenCore/complete()
Weird thing: I have a file that seems to be dropping by almost 50% in file size for no apparent reason. I've got a CS3 file (AS2) that I've been editing in CS4, and trading back and forth with a designer who works in CS3. I've been saving using "Save as..." and selecting "Save as Flash CS3 Document" every time, in order to preserve the CS3 format. Someone noticed last week that the file size of all my versions up till recently had been in the 11MB range. But the most recent version (which involved a very minor code tweak that locked in the stage dimensions) was 5.8MB.
So I experimented. Seems if I save an earlier version of the file as a different name -- no changes, just open the file, save as a new name, and close -- the file size drops from 11MB to 5.8MB. If I save the previous version with the same file name (using "Save as..."), it retains the 11MB file size.
I am using this book to help me learn Flash. In lession one the book instructs me to drag an item from the library onto the stage. I tried and tried but the object(s) are not moving. What to do?
i am new to flash and wanted to learn so i went and bought the classroom in a book for flash cs5 to self teach my self and well in chapter 6 it has you create a navagation menu. This menu has four boxes you can hover over and click ( i completed the whole lesson so its ready to go) and well when you go to test (command + enter) the flash movie plays but it plays on a custom loop over and over.
I went to the top and went under control and deselected loop and it still does it and or it stops but then nothing is clickable.. what gives?? the lesson had me design the menu so you are able to hover over and have a box appear and then when you click it makes a sound and then after you click a new window pops up with info about that particular button and well when you test it it loops through at the blink of an eye and none of the buttons work and it just plays like a movie.
I'm trying to learn AS3 and im looking for a classroom style book with examples and then programs that you need to do on your own at the end of the chapter.
This official training guide from Adobe will teach readers all they need to know to create rich interactive experiences with Flash Catalyst CS5, Adobe's exciting new interaction design tool. Flash Catalyst CS5 lets designers create real Adobe Flash and Adobe AIR applications without having to learn ActionScript.
Using step-by-step instructions in projects that progressively build skills, readers of this Classroom in a Book will learn how to prepare and import artwork from applications such as Adobe Photoshop and Fireworks into Catalyst, and then add interactive functionality in a familiar interface and with tools that are intuitive to use.
Readers will learn how libraries let them organize and reuse assets, how to use layers to view and control objects, how to work with pages and states to create interactive components, how to add transitions and action sequences, and how to work with video and sound. Readers will also learn to incorporate Flash files from other applications and use Flash Builder to extend their projects' functionality.
The companion CD provides users with all the sample files they need to complete all the projects.
"The Classroom in a Book series is by far the best training material on the market. Everything you need to master the software is included: clear explanations of each lesson, step-by-step instructions, and the project files for the students." —Barbara Binder, Adobe Certified Instructor, Rocky Mountain Training
Classroom in a Book®, the best-selling series of hands-on software training workbooks, helps you learn the features of Adobe software quickly and easily. Classroom in a Book offers what no other book or training program does—an official training series from Adobe Systems Incorporated, developed with the support of Adobe product experts. Download : [URL]
I have a classroom with 20 workstations, 5 or 6, of theses computers when using flash only shows a view of the stage without the workspace. when when reduce down to a view of 50% it places the stage in the upper right hand corner and never allows the normal view of the stage and workspace.
I am a middle school teacher and would like to create a Flash Jeopardy game for the teachers at our school to use on our school website.I would like a game similar to the game on url..I have been able to successfully create a flash jeopardy game that uses a xml file.My problem is that I have to have a swf file and an xml file for every game we create.I want to be able to have one swf file that will load many different Jeopardy games.I am using Flash CS3, Dreamweaver CS3, and MySQL.The files I have created are here: url...
As stupid as my question might sound, i have spent the last 2 weeks reading oop books; but could use some guidance. I have a flash project that is basically a supped up slide show. On the stage i have the following: main_mc (instance name = images_mc) = movieclip which holds "pictures" ui1 (instance name = ui1_mc) = user interface that allows user to draw on picture (when drawing is enabled) ui2 (instance name = ui2_mc) = activates invisible hit areas (buttons) on select pics, when hit area is clicked, we jump to another pic in the main_mc.
I accomplished all of this on the timeline, but am updating the code to OOP. I am having A HELL OF A TIME trying to figure out how to store references to the instances (images_mc etc..), so i can control them from varying class files. I have found it is easy to control the instances from the documentclass, but not from unrelated class files. Example: images_mc.stop(); works in document class; but ovieclip(Parent).images_mc.stop() doesn't seem to work from any class file.(ui2 class file for example);
Note the red code, I need to repeat this an unknown amount yet multiple times but with the number on the end of enemy incremented by 1 each time. It starts with 0 as you can see the code just above the red. I heard about for loops using 'i' but im unsure about how to use it.
edit: ah, this forum isnt letting me highlight red. Everything in this editor is also failing. well, when I say code in red i mean this code:
I'm looking for a way to have my main timeline code interact with code inside of a symbol.I'm tying to get my timeline inside the symbol to gotoAndPlay(10) when something happens in my main timeline code.
I'm looking for a workaround to the "AdSense does not let you choose only images but no flash" issue. I'm rather a newbie to JS, but is there any way for one script to prevent other scripts embedded in a site from detecting the presence of the flash plugin? Even if it doesn't work with AdSense, it would be nice to know if there's a hack to do this that might work in other settings.By the way, I suppose I wouldn't care if it failed to work on IE or obsolete browser versions.
I have attached a simple test fla.I am trying to centralize my code in all my movies using dot notation instead of spreading my code all over the place. It never works, I must be doing something wrong.The test .fla has a movieclip with a timeline animation. I used the linkage identifier to name it 'reload' AND named the instance 'reload'.
Got to the point where the hole in my AS3 knowledge is getting large!Realising I have confusion about the relationship of:Body of code on first frame of AS3 file.(Which I have so far used to create instances of library objects using addchild and make calls to class code).Is this code called the document code? What do people call it?Numerous classes linked together by extending each other etc.Library objects (usually graphical objects)Should it be done differently? have the following problems due to lack of understanding:Addchild complicated from a class but straight forward in main body code.Cant call functions on the main body code from classes, because class code does not know the main body code exists?
I have 2 tables,a main table with a field code as primary key, and other table detail, named p.e. DetailTable, with 3 fiels as primary key.What I want to do, it's a delete a row in MainTable, all the rows in DetailTable,where field code is the same as field code in MainTable should be deleted too.Here is the SQL to create the tables.
var sql2:String = "CREATE TABLE IF NOT EXISTS MainTable [code]....
when tables are created, insert data. I connect without problems, delete a row in MainTable (see the code), for example delete row with code=4, but in the DetailTable, all the rows with code=4 are NOT deleted Why?
[CODE]// Inside a class private var conn:SQLConnection; public function constructorClass(){conn = new SQLConnection();ConexionBD();}[code]...
I've literally been staring at this for 7 hours. I'm missing something.I have two movie clips on the stage. The instance name of the first is puzzleAK. The instance name of the second is pieceAK.The first is linked to a custom class called GeoPuzzle. The second is linked to a custom class called GeoPiece.The code compiles but throws an error (as explained).The code in the main timeline:
Is there a way to make code on the timeline and code in a separate AS file communicate with each other?I have two buttons, a yes button and a no button.I have a confirm box which is a movie clip. In the movie clip I have the two buttons on it and code so that every time one of the buttons is clicked it runs a function.I have the rest of my code for the movie (so the code to make the confirm box appear) on a separate AS file.Is there a way I can define the functions on the movie clip and run the functions with the separate AS file?
I had a 2 frame setup with some actionscript for each frame. Tried to move it all into one class file and a
1. frame .fla. ; Hiding and showing the resp. moviclips when i virtually move from frame 1 to frame
2. Now I get these ...Error #1069: Property edit_panel_mc not found on flash.display and there is no default value. errors or..
when i thought beeing clever adding the stage. prefix ReferenceError: Error #1069: Property edit_panel_mc not found on flash.display.Stage and there is no default value. The mc's are on the stage... i have a single .as classfile. Why cant I reference them? or how should i do it/ what should i do to change it from beeing .fla script to class script.
I'm working on an app for iOS where I want to load content dynamically from the library that contains text and graphics inside different MovieClip's.However, I have a problem, the code I have is for bitmap!How can I change it so it works for MovieClip instead?I want to use the MovieClip instead of bitmap?Also want to use the MovieClip class instead of Sprite class?[code]
I'm looking for some help converting as3 code to pixelbender code in an attempt to improve the performance of my application. This as3 code goes as follows. I scan through the Number values of a bytearray in chunks. Lets say this chunk lenght was 100 numbers I read 2 numbers (left and right) and try find the maximum values. The numbers in my bytearray are PCM data so there is millions of them and this code can often take a long time to execute, especially on a low spec machine.
The whole aim of this is to render a waveform as quickly as possible. I know very little about pixel bender. I can basically make a new file and create a shaderJob of it in flash but I'm really uncertain how to approach this...
I see a lot of tutorials about coding actionscript 3 when they use all the code in a Class.I keep thinking every time why they use it in a class, instead of using actionscript on the stage.why it is more functional to code a class instead of putting code in the stage actionscript?
I have a small slideshow loading 3 different images with XML in an animated loader.My problem is that the first round, when the images are not cached in the browser, it starts playing before the images are finished loading.Is there a way to add a sort of preloading code to my code below without having to re-write everything? I tried to add an eventListener COMPLETE to the loading images but somehow it wont work?[code]
I am trying to replace some code which loaded an external image and triggered and function once completed with code that uses and embedded image. The relevant code looks like this.
Code:
[Embed(source='globe.png')] public function Globe() { var imageLoader:Loader = new Loader();
[code]....
The commented out section is where it used to take the loaded image and apply it to a texturemap.I need to replace the lines of code in the first function with something that calls the second function correctly.
I have tried using function imageLoadComplete (e:Event = null)and calling it with imageLoadComplete(); in the first function but although it compile and runs without error, the program does not work properly. I suspect this is to do with the dispatchEvent(); line which I do not understand.
I have the code which is written in C++ I will like to convert the same in to Action Script 3 code can anyone help me how to coveter is available this is any converter is available for the same?
I was wondering how you can make variable code within code, for example, normally, you can use this["blabla"+variable]; to make the code say blablavariable. But now i want to make new variables by using this code, within a for loop [using teller1 as the increasing value] this["var ringsegment_mc:Ring_"+teller1+"=new [Ring_"+teller1+"]()"]; which i basically want to have say:var ringsegment_mc:Ring_1=new Ring_1();
but this doesnt work, it doesnt make a variable called ringsegment_mc. why I want to do this, is because i need to make an add child which makes 16 parts, from 16 different movieclips.