ActionScript 3.0 :: Making More Effective Code?

Feb 16, 2011

It's working and all..however... It's not very dynamic.. It's hardcoded every tween / fade function , one for each of the images, and pause functions...when basically it does the same thing for each image...So thought I'd have a go here with you guys which are much more experienced than myself on this field.This is the code I currently use: (displays first image..then fades it out...fade in the next image...pauses...fades out..fades in next..pauses..etc etc.. )

Code:
package{
import com.greensock.TweenLite;

[code]......

View 3 Replies


Similar Posts:


Actionscript 3.0 :: Drawing API - Effective Rationalising Of Code Using Functions And Loops?

Jan 4, 2010

i need to draw an API Drawing and do the following with it;

-Effective experimentation with the drawing API e.g. gradient fills, curves etc.

-Effective rationalising of code using functions and loops.

-A sophisticated/realistic looking drawing, that shows the ability to use the drawing API with a high degree of skill.

View 14 Replies

ActionScript 3.0 :: Effective Way To Write?

Nov 27, 2009

Lately i've been trying to right in external classfiles to create everything and make everything work instead of stuffing everything in my timeline. So now i have made a classfile that first creates all the movieclips i wan't on the stage and then defines what all the buttons do.
 
But when i want to acces a variable that has been created in "createMc" from a private function i get an error, so i have fixed this by giving the var's a name and then use getChildByName().
 
But i think this looks like a really innificiant way off writing something and was wondering if it was possible to write this in a better, shorter, and thus more effective way.

[Code]...

View 5 Replies

ActionScript 3.0 :: Password Protecting A Swf: Effective Or Not?

Feb 15, 2012

I've created a password variable w/input text on the first frame of a swf to enable private viewing of a swf; so if you dont know the password you cant procedd to frame 2, to see the whole thing.

View 21 Replies

CSS :: Most Effective Way To Style Flex Application?

Feb 2, 2010

I have a fairly complex Flex application that uses many different components. I want the application to be able to custom styling and/or skinning. I also want to be sure that the styling approach makes the most efficient use of system resources (memory, CPU, network), and that it does not adversely impact performance. We currently are using a hybrid approach to styling the application that uses both CSS and a Flash skin created in CS3. It seems odd to me to have a two-pronged approach to styling an application and ideally would like to settle on one approach or the other. Some outline about advantages and disadvantages of using either exclusively CSS or a Flash skin? Is there a justification for using both within the same app?

Using CSS exclusively seems advantageous because it is approachable by anyone with a basic understanding of other uses of CSS, especially when using the Flex 2 Style Explorer. On the other hand, I know that the CS3 skin we use declares up/over/down/disabled/pressed skins for each component where these states are needed and Flex manages the transitions to the appropriate skins as each state is (de)activated. However, my impression is that creation of a Flex skin in CS3 requires somewhat specialized skills and tools. So what would you recommend for styling a Flex application if performance, customization, and efficient resource utilization are priorities?

View 3 Replies

ActionScript 3.0 :: Making Code More Efficient?

Aug 5, 2011

I have an activity with 6 buttons. Each button loads a movieclip from the library. Users can click the buttons in any order. The code below shows my long process of checking to see if other movieclips are present and removing them before I add the new movieclip.I'm wondering if there's is an easier way to do this. So far I've only written the code for the first 3 buttons. It is long and creates plenty of opportunities for syntax errors

var answer01:MovieClip = new swap01target();
var answer02:MovieClip = new swap02target();
var answer0

[code].....

View 1 Replies

ActionScript 2.0 :: Code For Making Something Disappear?

Apr 20, 2004

I am making a game . all the code is working , but , i can't make when the bullet hit the enemy , the enemy will disappear and start from top again.

View 5 Replies

ActionScript 1/2 :: Effective Preloading With Sound In FLA Library?

Sep 9, 2010

I've run into some trouble with making a preloader for my flash file. First I went ahead and made an external preloader that loaded in the swf file - but then all my audio did not play (they are called upon as sound objects). Found this out because the file is loaded into the preloader but not the audio files from the library???
 
But if I put the preloader in the actual flash file it's kind of useless as it wants to preload all the audio on the first frame. Now I went ahead and changed it to load on frame 2 or 3 (using the publish settings to set "Export frame for classes") but now the audio will not play at all!
 
Are preloaders doomed to fail in AS2 when there is audio files being called within the library as sound objects??

View 2 Replies

ActionScript 3.0 :: Effective EventListener With Many Event Listener?

Jun 19, 2009

I'm new to AS3.0 Is there a good way to deal with many event listeners like say MouseEvent.MOUSE_OVER and MouseEvent.MOUSE_OUT for the same type of movie clips? I've been getting the following error if the mouse rolled over or out too fast.

TypeError: Error #1009: Cannot access a property or method of a null object reference. at csAS/onSubmenuRollOver()
TypeError: Error #1009: Cannot access a property or method of a null object reference. at csAS/onSubmenuRollOut()

View 4 Replies

ActionScript 3.0 :: Making Code Backward Compatible?

Jun 11, 2009

So I made a slideshow swf in AS3 only to later find out it needs to be compatible with Flash 8...and in my estimation AS3 cannot publish back to a Flash 8 swf without it being AS2...is there anyway I can do this without rewriting the code? I'm fairly new to AS, starting with 3 - so I really don't have any AS2 knowledge.

View 3 Replies

ActionScript 3.0 :: Effective Slideshow - Fading Image Transitions

Apr 5, 2009

I'm trying to create a simple yet effective image slideshow for my homepage. It'll be a bar, 600 pixels wide, by 300 pixels high. There will be 4 buttons that will line the bottom, numbered 1 through 4, that will control 4 separate slides that'll appear in that window. If you don't click anything, the images will fade in and out after x amount of seconds. Clicking on the numbered buttons will load the appropriate slide, and each slide when clicked will take you to a certain part of the website.

I wish to do this in actionscript... not using the timeline as I prefer to do all transitions in actionscript. Can anyone shed light on how to set this up? I've been trying to use the TransitionManager function... however I'm getting mixed results. Here's a screenshot:

Code:
import fl.transitions.*;
import fl.transitions.easing.*;
ss1_mc.alpha = 1;
ss2_mc.alpha = 0;
ss3_mc.alpha = 0;
ss4_mc.alpha = 0;
var currentImage:MovieClip = ss1_mc;
[Code] .....

View 1 Replies

ActionScript 3.0 :: Effective / Quick Management Of Elements On Webpage?

Jun 6, 2010

Just a question about a page im building.. it may not be the optimal method of doing it (and im open to other suggestions) but still would like an answer to if the below is possible... Every time I switch pages, the 'new elements specific to that page' are created with AS3, placed on the page, animated etc etc. On frame one I have attached to each button a 'check' for the destination when the button is clicked and based on where the user currently is, all elements from that section are removed from the stage.

My question... I am removing each element individually by its name.. and some sections are quite large and i plan to modify heavily continuously. Can I add them to an (invisible) container of sorts in each of their respective sections and then remove via some kind of '.childrenOf' method ?? eg. when user is in the 'about' section of the site and clicks to go 'home', all elements in 'about container' are removed via 'for all childrenOf about_container ?

View 0 Replies

ActionScript 3.0 :: Code For Making A Contact Form On Flash CS4?

Apr 25, 2010

I want to make a contact form on my website so that when the user types info into the input textboxes I have and presses the SEND button, the message will automatically send, instead of opening up their mail service and having them manually send it.[url]...

And it worked, but when I tested it, it just when to my Outlook and had already entered everything in the subject and message, but I had to manually send it.[code]...

View 9 Replies

ActionScript 3.0 :: Scale World Larger And Smaller To Effective Zoom In And Out?

May 22, 2010

For lack of a better description, I have a world of bitmaps, but some are outside the boundaries of the stage. How can I scale my world larger and smaller to effective zoom in and out?

View 7 Replies

Actionscript 3.0 :: Process Of Making Code For A Whole Scene Without Compiling Periodically?

Jul 21, 2010

I run through the process of making code for a whole scene without compiling periodically I overlook where a child is added to and try to remove it from somewhere else. However, I dont believe this to be the case on this occasion. I have only two funcytion that deal with the addition and removeal of the children of the mc that is throwing me errors. If I add the simple:Code: Select allif (holder.contains(thisChild)) {It stops the error but doesn't fix my actual problem...

Code: Select alloverride public function unLoad():void {
for (var i:int = 0; i < currentDeck.length; i++) {
currentDeck[i].removeEventListener(MouseEvent.CLICK, clicked);

[code].....

View 3 Replies

ActionScript 3.0 :: Link (code) Swf Pages To Each Other (through Buttons) When Making A Flash Site Or Portfolio?

Nov 2, 2010

how do you link(code) your swf pages to each other (through buttons) when making a flash site or portfolio?

View 5 Replies

ActionScript 3.0 :: Making A Code That Automatically Writes The Mouse's Current X And Y Position As Text?

Jul 6, 2009

I have trouble making a code that automatically writes the mouse's current x and y position as text every frame.

View 3 Replies

ActionScript 2.0 :: Array Code For Making A Dynamic Text Field That Up Dates As User?

Sep 16, 2009

Ive been in the lab trying to make this work for 3 days now, and im about to get put out to the couch.

View 9 Replies

ActionScript 2.0 :: Making Flash 7 Code Working On All Flash Versions

Apr 20, 2009

I did this AS2 code in Flash CS4 and have a little trouble with it.[code]It works like I want it to in Flash 7 and looks like this, but when I change the publish settings into Flash 8/9/10, the code looks like this.How do I make the code work on all AS2 Flash versions?

View 8 Replies

String :: Achieve Fast And Effective String Compression

Dec 2, 2011

I have an Object which stores pairs for a find and replace that I perform on up to 1500 Strings at a time.The Object is populated with pairs using a method that will accept a String and then store this as a property with the value being an automatically assigned base 36 number, like this:[code]nextShort returns an automatically incremented value being the subject of .toString(36), so running the above a few times might make _pairs look like this:[cod]ehowever in my mind I foresee a massive problem in a case where I might want to "shorten" 2000+ Strings and the _pairs Object has at the same time has over 500 pairs.That ends up being 1,000,000 iterations all up which obviously doesn't seem very efficient at all.

View 2 Replies

ActionScript 3.0 :: Making Spacebar Act As Mouse For Making A Sidescroller?

Feb 8, 2011

For a project, I'm making an interactive side scroller.You move the character with the arrow keys and press the space bar to interact with things.So far, I followed DexNote's tutorial on YouTube.I thought that I would make the interactable objects as buttons, while the mouse focus would be on the character and when you press the space bar it make a mouse click in that area.The trouble I'm having now is that I don't know how to make the space bar trigger the "interactions."

View 1 Replies

ActionScript 2.0 :: Making A List And Making It Fast

Jul 12, 2003

I want to generate large text files, basically 4 columns, several thousand rows, of numbers. Making an array with all this info in it occurs farily quickly, it's getting it to a displayable format that takes a really long time. Right now I use something like this:

[Code]...

View 10 Replies

Flash :: Timeline Code To Object Oriented Code - Access Instances Already On Stage

Jan 12, 2011

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);

[Code]...

View 2 Replies

ActionScript 1/2 :: Repeat Small Bit Of Code 1-100 Hundred Times With Each Code Having Different Instance Name?

Nov 20, 2010

here's a part of my code:
 
player_mc.onEnterFrame = function() {
if (enemy0.hitTest(this)) {
enemy0.speed = 0;
} else {

[code]...
 
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:

if (enemy1.hitTest(this)) {
enemy1.speed = 0;
} else {
enemy1.speed = 1;
}

View 3 Replies

ActionScript 3.0 :: Way To Have Main Timeline Code Interact With Code Inside Of Symbol.

Jan 29, 2012

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.

View 3 Replies

Javascript :: Can Js Code On Site Prevent Other Js Code From Detecting Presence Of Flash

Jan 22, 2011

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.

View 1 Replies

ActionScript 2.0 :: Centralize Code In All Movies Using Dot Notation Instead Of Spreading Code All Over The Place?

Jul 10, 2003

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'.

_root.reload.onRollOver = function() {
this.gotoAndPlay(2);
}

The pointer doesnt even change to a hand.

View 4 Replies

Flash :: Relationship Of Code On First Frame Of Main Time Line To Class Code And Library Objects?

Mar 27, 2011

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?

View 1 Replies

ActionScript 3.0 :: Delete Row With Code=4, But In The DetailTable, All The Rows With Code=4 Are NOT Deleted?

Feb 4, 2010

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]...

View 3 Replies

ActionScript 3.0 :: Copy And Pasted Code, First Code Works, Second Doesn't?

Jun 9, 2011

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:

puzzleAK.fullName = "Alaska";puzzleAK.abbrev = "AK";puzzleAK.isLocked = false;trace ("made it through puzzle definitions: " + puzzleAK.fullName + " " + puzzleAK.abbrev + " " + puzzleAK.isLocked);

[code].....

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved