Flash :: Setting Default Parameters In A Class?

Apr 16, 2011

quick question:Is there a better way to do this?

public class ribbon extends Sprite {
private var fallAmount,taper;
public function ribbon(FallAmount=50,Taper=0.2){
fallAmount=FallAmount;
taper=Taper;
}

View 2 Replies


Similar Posts:


Actionscript 3.0 :: Creating Simple Component - Can't Get The Default Parameters "loaded" In The Class ?

Mar 18, 2010

I want to create a simple component in as3, cs4. There are 2 problems I cant solve:

1.)I can't get the default parameters "loaded" in the class for the component so lets say if I have w = 10 in the parameters how can I refer to it in the code?

2.) How can I get the tool with which I can set which corner of the component should stay the same : it looks like this in the default

flash button component
theLinesTool.png (11.82 KiB) Viewed 290 times

View 2 Replies

Data Integration :: Setting Parameters Flash From Php?

Apr 6, 2007

I would like to set these parameters in flash using a php/mysql database :

button1.maxQuantity
button1.name
button1.option1Name
button1.option1Value
button1.price ;

How would I go about doing that?

View 13 Replies

Actionscript 3 :: Setting The Default Browser To Open Flex Apps In Flash Builder On Mac?

Sep 13, 2011

I just got my MacBook and am trying out the Flash BUilder on said platform. I've installed Firefox and Google Chrome on my MacBook but I can't seem to find a way to set which browser would launch my Flex apps whenever I hit the Run button inside Flash Builder. As far as I know, I can locate the Browser property on the Project Properties on my Windows copy of Flash Builder but I couldn't over here at my Mac. Any thoughts?

View 1 Replies

ActionScript 3.0 :: Functions As Default Parameters?

Feb 11, 2009

I'm trying to set up some default parameters that are functions.

ActionScript Code:
public function makeButton(buttonUp:Function, buttonOver:Function = this.defaultButtonOver, buttonDown:Function = this.defaultButtonDown, buttonOut:Function = this.defaultButtonOut) {

[code].....

View 2 Replies

ActionScript 2.0 :: Set Default Values For The Parameters Of A Function?

Aug 12, 2010

How can I set default values for the parameters of a function in AS2? I am trying the common way but it doesn't work...

Code:
private function myFunction (param1:Number = 3,
param2:String = "a string",
param3:Boolean = false, etc ....):Void
{
....
}

View 2 Replies

ActionScript 2.0 :: [CS3] Setting The Default Value Of The Numericstepper

Feb 1, 2009

i am having problems with setting the default value of the numericstepper. what is happening is that each time i change the value of Ath in the numeric stepper then change the frame the Ath value changes to it's max value. this happens with all of the numericsteppers that i set a default value with using actionscript. all relevent code is bellow along what each frame is for/does

[CODE].....

View 1 Replies

Flex :: Setting The Default Button In Preinitialization

Jul 29, 2011

I have a more than one container in a view. I am trying to set default button at the moment page is loaded so that when I press enter, function that handles keydown event called. If I simply set default button in preinit() function, it does not work.

View 2 Replies

ActionScript 3.0 :: Setting Parameters Of A Component?

Mar 12, 2009

I'm trying to dynamically set some parameters of a component using AS3. The component has a parameter named "imagePath". I want to set this to a variable named "pathVar" This is where i'm at.

Code:
var pathVar
pathVar="images/folder1"
imagePath=pathVar

This clearly isn't working.

View 1 Replies

ActionScript 3.0 :: Setting Parameters For A Loaded Swf

Jun 6, 2010

I am trying to load an external swf (which, come to find out, does not include the background color of the loaded swf) into a movieclip. It seems to be pretty easy. But the movieclip I am loading it into is smaller than the swf I am loading. Is there a way to specify size parameters? In other words, is there a way to scale the swf down so that it fits into the movieclip?

[Code]....

View 2 Replies

Flex :: Setting Default SAVE Locations In Web Application?

Oct 30, 2009

In flex 3 web application how to set default save location for images?

View 1 Replies

Actionscript 3 :: Flex Setting Default Value For Empty Form?

Jul 9, 2010

Currently I have a form in a window like this:

<mx:Form>
<mx:FormItem label="Reference">
<mx:TextInput id="reference" width="100%"/>

[Code]....

Is there any way to change the default value of a blank form entry from null to some other value?

View 1 Replies

Actionscript 3 :: Setting Default Values For Object Properties?

Dec 28, 2010

how to set default property values for objects that are being created in a loop.

In the example below, these propeties are the same for each object created in the loop: titleTextField.selectable, titleTextField.wordWrap, titleTextField.x

If you pull these properties out of the loop, they are null because the TextField objects have not been created, but it seems silly to have to set them each time.

var titleTextFormat:TextFormat = new TextFormat();
titleTextFormat.size = 10;
titleTextFormat.font = "Arial";

[Code]....

View 4 Replies

ActionScript 2.0 :: Setting Default Alpha For Image During Loop

Sep 6, 2010

I have a script which dictates alpha on rollout and onroll but I want to set a default alpha setting for images which are loaded via xml. Here's a tidbit:

[Code]...

I've tried combinations of tn_group["tn"+i].tn_button.tn_pic._alpha = 85; and such but I'm still a big newbie

View 2 Replies

ActionScript 3.0 :: Setting ComboBox Default Selection Using Data Field?

Jul 20, 2009

I've got a comboBox with defined data and label fields. On Event.CHANGE I capture the data field. I need the comboBox to default back to the user selection if they should navigate to another screen and then come back. Normally I've got an array of labels that I can use to just lookup the index: comboBox.selectedIndex = labelArray.indexOf(user selection); In this case I don't have labelArray. What I really want to do is something like this (only with real AS, not fake):
 
comboBox.selectedData = storedDataString or, if the data array is accessible: comboBox.selectedIndex = comboBox.data.indexOf(user selection); Is there an easy way to do this, or should I just suck it up and add yet another global label array?

View 2 Replies

Professional :: Volume Control - Change Skin Default Setting?

Feb 18, 2010

Mac OSX 10.4.11 - CS4. I have a supplied video.flv that I have in Flash with a skin control and exported as video.swf and inserted into a GoLive site, all is well apart from the excessive sound. The volume controller is defaulted to max and I would like to reduce the default volume by about 50%. Is this possible to do in Flash before exporting the video.swf.

View 10 Replies

ActionScript 3.0 :: Adding Volume Control To Player And Setting Default Value

Apr 20, 2011

How to insert the volume control for this player and set a default value.
//Declaracion de variablesvar duracion:Number=10000000000000;
var flv:String='../../../'+unescape(_root.flvFile);
//trace(flv);//var flv='video.flv';//aviso.text=flv;
//trace(flv);
var conexion:NetConnection = new NetConnection();
[Code].....

View 1 Replies

Actionscript 3 :: Setting A Default Skin For A Custom Component In Flex 4?

Aug 18, 2010

How do you set the default value of skinClass for a custom component in Flex? I've extended the DropDownList with my custom component, but I would like to specify a default skin to go with it instead of always setting the skinClass value for each instance.

View 1 Replies

ActionScript 2.0 :: Setting An Empty Movieclip Default Width / Height

Aug 20, 2006

I have a movieclip with the instance name of "container_mc" that I am loading a external swf file into.When I trace(container_mc._width) after the preload it returns 0.Is there any way to tell the movieclip to stay at a width of 760px and a height of 460px regardless of the content that is loaded?Reason being, I then have a function that positions the container_mc movieclip in the center of the stage based on the Stage.width/height..The only way I have been able to get this to work thus far is to have a 760px by 460px square shape, position the movieclip.. then load the content to replace the square shape however I'd rather be able to default everything without having to do that.

View 3 Replies

ActionScript 2.0 :: Setting ComboBox Default According To Shared Object Data?

Dec 4, 2006

I have a Flash Form that is fairly long (about 8 short pages), so I have set the form up so that it can be reviewed when the filler-outer is done and they are ready to submit it. I'm using a Shared Object to store the information they enter so they won't lose their information if they hit refresh or need to come back later.

If they go back to the page with comboboxes on it, the comboboxes have reset to the default. The answer and data in the SO haven't changed, but it looks like it to the consumer/viewer.

So, I'd like for the boxes to display the choice they picked when they were on that page. I need use the value from the database to show the particular value in the ComboBox whenever the user returns to that page.

View 4 Replies

ActionScript 2.0 :: Setting Default Language In Input Text Field

Apr 30, 2009

i have a text input box in which i want to insert Hebrew (RTL language) text. now, the RTL support i need is basic, and thats easy enough to do. however, for entering hebrew in the box, the user has to set hebrew in his windows language bar. is there a way of making the default input language in the box hebrew, regardless of what is currently set in the language bar? note - the hebrew characters are showing just fine, its just that to enter them you have to make sure the language bar is set to hebrew as well.

View 2 Replies

ActionScript 2.0 :: FLVPlayback - Setting Path In Component Parameters

Oct 4, 2011

I have a video which has an flvplayback inside. I have been using it for others flv. But with these 3 flv, when I set the path in the component parameters, flash shuts down. I have used aftereffects, media encoder to convert them from mov and avi to flv.

View 0 Replies

ActionScript 2.0 :: Zoomable Map Within Frame - Setting StartDrag Parameters?

Jul 13, 2004

I've got a zoomable map within a frame, and of course I don't want it to be dragged out of view, right? So, how do I set the startDrag (L,T,R,B) parameters when it's a different size when it's enlarged (zoomed)?

if ( between Size>100 AND Size<200) {
startDrag(this, false,400,150,600,250);
} if ( between Size>200 AND Size<400) {
startDrag(this, false,500,250,500,150);
}

View 4 Replies

Flash 10 :: Change Default Package For Class?

Jun 30, 2011

When I export assests for actionscript the defaul package is empty it there change to change it? To each time I export library asset for actionscritp default value for class field will contain package?

ex.
Class: assets.MyClass

View 0 Replies

Flex :: Setting Spark DataGrid Column's Default Sort On Application's CreationComplete

Sep 8, 2011

I have a spark DataGrid component with several columns and I want to have my application default to descending order on the first column in the DataGrid. I would like to use the built-in default sort that occurs when clicking the top header once. I have no need to sort the ArrayCollection I'm working with or change what the comparators are.I also want any user-generated sorting such as clicking on a different column's header to override the default sorting.

View 1 Replies

Pass Parameters To Flash Main (Document) Class?

May 2, 2010

In Flash CSn/AS3 you associate a Main class with a flash file which when loaded in the flash player "automatically creates an instance of the program's main class."I'd like to know how to pass arguments to the main class, since you don't write it yourself (you put its name in the Document textfield in the IDE).

View 1 Replies

ActionScript 3.0 :: Set A Default Value For A Class Parameter Of Type Class?

Feb 2, 2010

I'm working on an accordion component and I was thinking that it'd be cool if I could write a very basic one and then set it up so that it would be possible to pass in any kind of container class and child class so long as they subclassed a particular parent or implemented an interface (haven't really gotten that far yet).

What I've noticed though is that I can't setup a default class for my constructor parameter. For example I'd like to do this:

Code:
public function DropDownList(containerClass:Class = ContainerSprite, childClass:Class = ChildSprite)
However it gives me the following error:
1047: Parameter initializer unknown or is not a compile-time constant.

[Code]....

View 4 Replies

ActionScript 3.0 :: Accessing Function On Sub Class Via Default Class

Oct 6, 2010

I'm trying to do this,

Code:
Main.instance.subClassFunction();

instance is a public static variable on the default class, Main. I can do Main.instance.defaultClassFunction() with no problems at all, I use it to access functions and variables from within other classes. Is it possible to use this method to call a function on the subclass, currently I have to do this,

[Code]...

View 4 Replies

AS3 :: Class - Creating A Class With Multiple And Optional Parameters?

May 18, 2010

I'm creating a slideshow where each slide can have:- a video or a still- 1 audio track or many (up to 3)- 1 button or many (up to 3)I was thinking that each slide can be it's own object, and then I would pass the video, audio, buttons, etc., into it as parameters:

package
{
import flash.media.Video;

[code].....

View 2 Replies

Flash :: Add Parameters In The Constructor Of A Class A, Subclassing Movieclip, Present On Stage At Design Time

Nov 12, 2011

There is a library component represented by Class A. But constructor of this class requires some parameters. When the component needs to be added dynamically, it's fine because of code :

var abc:A = new A(param1,param2)

But what if my movieclip is already present on the stage. I notice it gives out error, that the parameters are null.

Is their any way to insert constructor parameters for movieclips already on stage.

View 2 Replies







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