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
Similar Posts:
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
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
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
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
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
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
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
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
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
Oct 25, 2011
I'm trying to read a XML file and output the values, but i'm getting a 1120: Access of undefined property URLRequest. error.
[Code]...
View 2 Replies
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
Jul 31, 2009
I have received this big client wants a gallery built for this website. Problem I do not know how to write in flash. How to make a write flash file? Please help me this big client to work.
View 1 Replies
Aug 21, 2011
So I'm kind of an Actionscript/XML newbie, but I'll try to be as useful as I can:
I'm writing some code where I want an input text box to create a new node in my XML with that text as an xml tag.
View 9 Replies
Feb 6, 2006
I have a simple Flash/XML slideshow-esque presentation that uses images+audio.I want to hand it over to a client but I think managing the XML is too advanced for them.I'm thinking I might need to hand over an HTML form with some PHP to allow them to upload assets and add/delete slides. If I could make it in Flash, that would be even better. I'm thinking that if I do it in Flash, I can set an interval to keep reloading the XML in so the client can see their edits as they create a presentation.
View 3 Replies
Nov 20, 2007
I know there is rule how to write % so I can see in the loaded text from txt file.
So, how do I have to write "%"?
View 4 Replies
Aug 1, 2010
write this in loop?
Code:
calendarday1._visible = false;
calendarday2._visible = false;
calendarday3._visible = false;
...........
calendarday42._visible = false;
I have 42 calendardays, I need them to hide them all at the same time.
View 1 Replies
Oct 6, 2010
I am new to CS4. I have been using Macromedia 8 and used to be able to write code on a button very easily. So click on the button and go the actions. But How do I do it in Cs4?
View 1 Replies
Oct 29, 2009
I've a flash project that's developed in Flash 3.0 and action script 3.0. My requirement is I need to print debug statementsinto a seperate text file. on the serverTo be in detail Let's assume that I need to print my debug statements inside the file can someone provide us with the sample codesnippet that prints stataments inside a text file?
View 3 Replies
Apr 27, 2011
I have created the flash exe which will be working on the local machine. what i want is to write a log file. How can i do it...? I have tried using
[Code]...
View 1 Replies
May 6, 2011
I have like 2 weeks already trying and nothingSo what is my gaol?ABOUT.SWF=========1. I want to know how to read a xml file into a dynamic text field.exmaple: about_us.xml into txt_about.CMS_ABOUT.SWF==============2. I want to know how to read that same xml (about_us.xml) so i can edit it and save it.
View 3 Replies
Sep 13, 2009
how can i write my own flv player? Is there any specification ?i am now thinking to write my own flv player.
View 1 Replies
Apr 6, 2011
I have some XML I've edited in ActionScript that I would like to save locally via php. My php script (called writeFile.php) is the following:
<?php
$variable = $_POST['data'];
$file = "tmp.xml";
$fh = fopen($file, 'w');
[code].....
However, no file is being created, and thus obviously nothing is being written to it.
View 1 Replies
May 16, 2011
So I am creating a module and I have a screen that I need to be able to allow the users to write questions that they have on their screens in a text box. Does anyone know how to do this? This is the basic setup that I use for every screen:
[Code]..
View 1 Replies
Sep 2, 2011
I've been googling this for a bit but haven't come across anything definitive. Is it possible (by which I also mean practical) to compile Flash swf apps using C#?
View 3 Replies
Jun 17, 2009
On load I want to read some attribute information including x, y coords for elements that will be positioned on the stage accordingly.
On moving elements to a new position I want the new coordinates to be written back to the XML file.
I understand AS can read the XML file OK but not write native. A php script is required to perform the write.
View 3 Replies
Jul 22, 2010
Is there a shorter way to write this out?
ActionScript Code:
var bytes:ByteArray = new ByteArray;
bytes.writeByte(0x53);
[code].....
View 3 Replies
Aug 13, 2010
I want to write my xml file into flash. how do i do that? My xml file is,
<?xml version="1.0" encoding="UTF 8" ?>
<graphs width="20">
<graph value="8.2" color="0xFDC13E"/>[code]...
View 1 Replies
Dec 11, 2010
I want to be able to write to a String like in C++. Simply string[i]="stuff", to overwrite the string. Apparently this is not possible directly in Flex. How can I do it?
View 1 Replies
Dec 3, 2011
I need to have one variable contain the name of another variable so I can write the actual value using either variable.
On my main timeline I have this code:
var globalvariable = "blank";
On a movieclip I have this code:
on (press) {
var testsend = name._root.globalvariable;
testsend = "IT WORKS!";
trace(_root.globalvariable);
}
I'd like the trace to read "IT WORKS!" but it's always "blank". The reason for this is that I have a controls options page where users can change their key binding for the various controls of a game. There is a list of the actions in the game with a field for the currently assigned keyboard shortcut. When they press that field, it's a button that pops up a keyboard graphic which has buttons on it for every key. Clicking one of those buttons should assign that keyboard equivalent to the corresponding field.
So I want to have something like this actually work:
Click the MoveFowards field and click "Spacebar" on the keyboard graphic and now _root.Moveforwards has a value of "Spacebar".
Click the Jump field and click "Spacebar" on the keyboard graphic and now _root.Jump has a value of "Spacebar".
Click the Shoot field and click "Spacebar" on the keyboard graphic and now _root.Shoot has a value of "Spacebar".
So I need to pass the name of the variable to the keyboard graphic so that it outputs to the correct global variable and writes its output to the correct field.
View 3 Replies