Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








[solution] MX Components In Pure Actionscript...


Problem: You want to use MX components using only actionscript.

Solution: Yes, it is very possible, as I will now describe.


Setup

Before starting you must ensure you have you the framework.swc in your library path. The details on how to achieve that in the Flex Builder can be found here: http://www.moock.org/blog/archives/000197.html

For anyone using the SDK, you shouldn't have any problems, the mx components appear to be automatically added to the path.

To test if you have the correct setup try compiling the minimal application:


Code:
package {

import mx.core.Application;

public class MXApp extends Application
{
public function MXApp()
{
}
}
}
NOTE: Running this application will generate runtime errors. However, you must be able to COMPILE it to proceed.


Problem Details

There are, as I see it, two major errors people encounter trying to use MX components:

1) The component is added but does not appear.

2) The application generates runtime errors.


Solution Details

The solution to (1) is simple. Any MX component must be a child of an class descended from mx.core.Application or it will not be visible.

Most actionscript applications extend flash.display.Sprite, but to use MX components the application must extend mx.core.Application.

The solution to (2) is more complex. Generally speaking it involves specifying the default style characteristics of the MX components. This is done via the CSSSyleDeclaration object, and MUST BE DONE before any MX component is loaded.

The style elements are listed in the adobe livedocs. For example, the base element, Application, lists:


Quote:




Styles
backgroundGradientAlphas="[ 1.0, 1.0 ]"
backgroundGradientColors="undefined"
...




These values must all be specified before an Application instance can be created. The same applies for any other component; button, label, scrollbar. Indeed, the matter is further complicated by the fact that any component that CONTAINS other components requires that the child component style elements also be specified.

To specify the style elements first a CSSSyleDeclaration object is required for the type of application. Then the setStyle() is used to specify each style element. For example, for Application it might be:


Code:
style = new CSSStyleDeclaration ("Application");
style.setStyle("backgroundGradientAlphas", [ 1.0, 1.0 ]);
style.setStyle("backgroundGradientColors", undefined);
style.setStyle("horizontalAlign", "center");
style.setStyle("horizontalGap", "8");
...
NOTE: The name of the style declaration MUST match the MX component class name. It is possible however, to call style = new CSSStyleDeclaration (); and then bind a single style declaration to multiple components using mx.styles.StyleManager.setStyleDeclaration ("NAME", object, false). See the livedocs.

NOTE: It is important to pay attention to the livedocs. The style elements listed there may come in the form: "[ 1.0, 1.0 ]", or "undefined", or "mx.skins.halo.ScrollThumbSkin", or "No default". These are NOT TEXT STRINGS. Make sure the appropriate data is passed to setStyle().


Sample Application

The following is a sample actionscript application that compiles both under the Flex builder and the SDK to provide a single working swf file.

Note: This object uses Label, Application, Button, Scrollbar, HScrollBar, VScrollBar. That's about the minimum you can get away with, because the Application automatically adds a scrollbars, which includes buttons.


Code:
package {

import mx.containers.*;
import mx.controls.*;
import mx.core.*;
import mx.styles.*;
import mx.skins.halo.*;
import mx.events.FlexEvent;

public class MXApp extends Application
{
public function MXApp()
{
var style:CSSStyleDeclaration;

style = new CSSStyleDeclaration ("Application");
style.setStyle("backgroundGradientAlphas", [ 1.0, 1.0 ]);
style.setStyle("backgroundGradientColors", undefined);
style.setStyle("horizontalAlign", "center");
style.setStyle("horizontalGap", "8");
style.setStyle("modalTransparency", "0.5");
style.setStyle("modalTransparencyBlur", "3");
style.setStyle("modalTransparencyColor", "#DDDDDD");
style.setStyle("modalTransparencyDuration", "100");
style.setStyle("paddingBottom", "24");
style.setStyle("paddingTop", "24");
style.setStyle("verticalAlign", "left");
style.setStyle("verticalGap", "6");

style = new CSSStyleDeclaration ("ScrollBar");
style.setStyle("borderColor", "0xB7BABC");
style.setStyle("cornerRadius", "0");
style.setStyle("downArrowDisabledSkin", mx.skins.halo.ScrollArrowSkin);
style.setStyle("downArrowDownSkin", mx.skins.halo.ScrollArrowSkin);
style.setStyle("downArrowOverSkin", mx.skins.halo.ScrollArrowSkin);
style.setStyle("downArrowUpSkin", mx.skins.halo.ScrollArrowSkin);
style.setStyle("fillAlphas", [0.6, 0.4]);
style.setStyle("fillColors", [0xFFFFFF, 0xCCCCCC]);
style.setStyle("highlightAlphas", [0.3, 0.0]);
style.setStyle("thumbDownSkin", mx.skins.halo.ScrollThumbSkin);
style.setStyle("thumbIcon", undefined);
style.setStyle("thumbOverSkin", mx.skins.halo.ScrollThumbSkin);
style.setStyle("thumbUpSkin", mx.skins.halo.ScrollThumbSkin);
style.setStyle("trackColors", [0x94999b, 0xe7e7e7]);
style.setStyle("trackSkin", mx.skins.halo.ScrollTrackSkin);
style.setStyle("upArrowDisabledSkin", mx.skins.halo.ScrollArrowSkin);
style.setStyle("upArrowDownSkin", mx.skins.halo.ScrollArrowSkin);
style.setStyle("upArrowOverSkin", mx.skins.halo.ScrollArrowSkin);
style.setStyle("upArrowUpSkin", mx.skins.halo.ScrollArrowSkin);

style = new CSSStyleDeclaration ("HScrollBar");
style.setStyle ("repeatDelay", "500");
style.setStyle ("epeatInterval", "35");

style = new CSSStyleDeclaration ("VScrollBar");
style.setStyle ("repeatDelay", "500");
style.setStyle ("epeatInterval", "35");

style = new CSSStyleDeclaration ("Button");
style.setStyle("borderColor", "0xAAB3B3");
style.setStyle("color", "0x0B333C");
style.setStyle("cornerRadius", "4");
style.setStyle("disabledColor", "0xAAB3B3");
style.setStyle("disabledIcon", null);
style.setStyle("disabledSkin", mx.skins.halo.ButtonSkin);
style.setStyle("downIcon", null);
style.setStyle("downSkin", mx.skins.halo.ButtonSkin);
style.setStyle("fillAlphas", [0.6, 0.4]);
style.setStyle("fillColors", [0xE6EEEE, 0xFFFFFF]);
style.setStyle("focusAlpha", "0.5");
style.setStyle("focusRoundedCorners", "tl tr bl br");
style.setStyle("fontAntiAliasType", "advanced");
style.setStyle("fontFamily", "Verdana");
style.setStyle("fontGridFitType", "pixel");
style.setStyle("fontSharpness", "0");
style.setStyle("fontSize", "10");
style.setStyle("fontStyle", "normal");
style.setStyle("fontThickness", "0");
style.setStyle("fontWeight", "normal");
style.setStyle("highlightAlphas", [0.3, 0.0]);
style.setStyle("horizontalGap", "2");
style.setStyle("icon", null);
style.setStyle("leading", "2");
style.setStyle("overIcon", null);
style.setStyle("overSkin", mx.skins.halo.ButtonSkin);
style.setStyle("paddingBottom", "0");
style.setStyle("paddingLeft", "0");
style.setStyle("paddingRight", "0");
style.setStyle("paddingTop", "0");
style.setStyle("repeatDelay", "500");
style.setStyle("repeatInterval", "35");
style.setStyle("selectedDisabledIcon", null);
style.setStyle("selectedDisabledSkin", mx.skins.halo.ButtonSkin);
style.setStyle("selectedDownIcon", null);
style.setStyle("selectedDownSkin", mx.skins.halo.ButtonSkin);
style.setStyle("selectedOverIcon", null);
style.setStyle("selectedOverSkin", mx.skins.halo.ButtonSkin);
style.setStyle("selectedUpIcon", null);
style.setStyle("selectedUpSkin", mx.skins.halo.ButtonSkin);
style.setStyle("textAlign", "center");
style.setStyle("textDecoration", "none");
style.setStyle("textIndent", "0");
style.setStyle("textRollOverColor", "0x2B333C");
style.setStyle("textSelectedColor", "0x000000");
style.setStyle("upIcon", null);
style.setStyle("upSkin", mx.skins.halo.ButtonSkin);
style.setStyle("verticalGap", "2");

style = new CSSStyleDeclaration ("Label");
style.setStyle("color", "0x00ffffff");
style.setStyle("disabledColor", "0x00000000");
style.setStyle("fontAntiAliasType", "advanced");
style.setStyle("fontFamily", "Verdana");
style.setStyle("fontGridFitType", "pixel");
style.setStyle("fontSharpness", "0");
style.setStyle("fontSize", "10");
style.setStyle("fontStyle", "normal");
style.setStyle("fontThickness", "0");
style.setStyle("fontWeight", "normal");
style.setStyle("paddingLeft", "0");
style.setStyle("paddingRight", "0");
style.setStyle("paddingTop", "0");
style.setStyle("paddingBottom", "0");
style.setStyle("textAlign", "center");
style.setStyle("textDecoration", "normal");
style.setStyle("textIndent", "0");

this.addEventListener(FlexEvent.CREATION_COMPLETE, completedCallback);
}

private function completedCallback (E:FlexEvent):void
{
var lb:Label = new Label ();
lb.width = 100;
lb.height = 100;
lb.text = "Hello World";
addChild (lb);
}
}
}

End
Thanks to everyone who posted about this, it was a really annoying thing to struggle with when no-one knew the answer.

I hereby grant anyone who wants complete permission to take this post or any part of it and do with it as they please (even claim it was their own if they want .

g'night.




ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 07-27-2007, 03:21 PM


View Complete Forum Thread with Replies

Sponsored Links:

Pure Actionscript Or Pure Animation?
Hi. I'm just curious how to achieve the effect on 2advanced.com? In the intro there were lines will form something like a 3d background and then it form the menus. Or anyone can give me links to how to achieve this effect?

View Replies !    View Related
Pure Actionscript Or Pure Animation?
Hi. I'm just curious how to achieve the effect on 2advanced.com? In the intro there were lines will form something like a 3d background and then it form the menus. Or anyone can give me links to how to achieve this effect?

View Replies !    View Related
Saving JPG Without External Components, PURE PHP
i made a thing with flash 8 to take an image from the webcam and save it, but NOT USING PHP!!! the image is not saved in JPG format, is saved in NIM format, i invented that bicouse my server dont have the image component of php to create images, so i invent this way to save pictures to files, look!

if you have a better way of doing this, please let me know, realy.

here is the link, you have to have a webcam: http://grupoapis.com.ar/jpv/flash8/

the file taken from the webcam is 40 Kb aprox. So is not the most efficient way of saving images, but take a look!!

takes a wile in upload.

NOTE: it dosent have a preloader!

View Replies !    View Related
Pure Actionscript 3.0
I am new to AS 3.0 and coming from a heavy 2.0 background (not objects and classes though) I am finding the change quite interesting.

In particular what do people think about writing flash projects from pure actionscript alone, Not sure if I'm being clear but I read in Essential Actionscript 3.0 that this is how the book approaches it!

'Pure' meaning, that you don't actually place any objects physically on the stage in a fla file, but rather things are all accessed from libraries, put there by code dynamically! (i think, that's what it means).

what are the advantages to this, does anyone approach projects this way?

I trying to avoid going through this whole book and still not be able to start with AS 3.0! Any pointers

thanks lots
Ikonik

-----------------------------------
i laugh at aliens

View Replies !    View Related
Generating Menus With Pure Actionscript
hey there

I've seen this sort of thing done but don't know advanced actionscript. Can somoen point me to some code that I can edit to my own specs?

here is what i need to do. An interface for a cd rom i am designing need to be generated on the fly so that the client can edit a simple xml file (or whatever kind) to make new menus, sub menu, sub subs, and then links to portfolio pieces, jpgs, which also are pulled out of a folder on the server via actionscrpting. Using flash MX by way

ANy ideas? Thanks much for any help!


Stevie Spin

View Replies !    View Related
Alpha Fading MC Using Pure Actionscript
Hi everybody i have a question...i want to make a banner that looks similar to this http://nikon.ca/en/ each picture is a movie clip and after its done playing it uses alpha to change from that mc to another one...i only want to use actionscript nothing else....any help is greatly appreciated!!!

View Replies !    View Related
Best Way To Create Different Screens With Pure Actionscript
I'm trying to write a simple game with pure Actionscript (i.e. no Flash CS3 or Flex MXML). What's the best way to create different screens, and switch between them?

Is it possible to use the [Frame(factoryClass="blarg")] notation to create a separate frame/class for each screen?

View Replies !    View Related
Pure ActionScript For Waving Flag
Last edited by Codemonkey : 2007-06-14 at 10:13.
























Hi everybody,

Does anyone know of a pure ActionScipt way of generating a waving flag animation like the following (made in swish by the way)?

http://files.swish-tutorials.com/ex/...le.php?id=1482

Thx, KD

View Replies !    View Related
Create Flash Movie Pure Actionscript
Hi All,
I'm a newbie in flash and I'm wondering is it possible to create a flash movie with an actionscript editor(without even using the flash IDE) by writing pure actionscript codes? Thank you very much.

With my best,
Jim

View Replies !    View Related
[Action Script] Basic "pure" Actionscript Flash
Hi, for a project, I need to render a basic flash applet from scratch (without flash studio). I never used flash before without flash studio (MX 2004) and never really used actionScript at all. I am looking for the complete code to create an applet (in action script, not bytecode) with a line, circle and squre in it. This include the "main" function and everything. Thanks for helping!

Partial answer are welcome to

View Replies !    View Related
[F5] Looping In Actionscript (or Another Solution)
Hey, anyway, my problem is this, I am creating a photo gallery, but I want it to scroll when the user puts their cursor over a button. The code I've used so far is this

on(rollOver){
var scroller = scroller +1;
gotoAndStop(scroller);
}

which works fine, however I can't figure out a way to constantly execute this script for as long as the user keeps their cursor on the button (which this code is in). The only thing I can think of is using an if statement, but Im still fairly new to actionscript, and Ive tried a few diffrent ways and haven't had much luck. Any help would be appreciated! Thanks!

View Replies !    View Related
Flash Actionscript 2 Bug? Is There A Solution To This?
hi there

been working with actionscript for a while, and got this very strange issue with adding numbers. Checkout this simple code:


Code:

var x:Number = 0;
var y:Number = 2.05;
for(var i=0;i<50;i++) {
x+=y;
trace(x);
}
and the output below:

2.05
4.1
6.15
8.2
10.25
12.3
14.35
16.4
18.45
20.5
22.55
24.6
26.65
28.7
30.75
32.8
34.85
36.9
38.95
41
43.05
45.1
47.15
49.2
51.25
53.3
55.35
57.4
59.45
61.5
63.55
65.6
67.65
69.7
71.75
73.8
75.85
77.8999999999999
79.9499999999999
81.9999999999999
84.0499999999999
86.0999999999999
88.1499999999999
90.1999999999999
92.2499999999999
94.2999999999999
96.3499999999999
98.3999999999999
100.45
102.5

this is giving me a serious headache! How is this possible? where do this 99999 values come from? Has anyone encounter this?

thanks in advance

View Replies !    View Related
Question About Possible Solution To Actionscript Problem.
My flash file is set up in scenes and in each scene I have a seperate slideshow made w/ action scripting. The problem I am having is when I go to that scene it shows the same picture that is in the first scene. For example when I am on the worship pictures scene and click over to the friends scene the first picture of the worship scene that is shown w/ action script shows up. I have this actionscript on every scene but it is coustomized to the folder in which the picture are from and to which pictures it shows.

Heres the script:

//Code written by sbeener (suprabeener)
/*
i wrote this code, but you can use and abuse it however you like.
the methods are defined in the order which they occur to make it
easier to understand.
*/
// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. "pics/")
// leave it blank if they're in the same directory
this.pathToPics = "animation/";
// fill this array with your pics
this.pArray = ["image0.jpg", "image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg", "image5.jpg", "image6.jpg", "image7.jpg", "image8.jpg", "image9.jpg"];
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.photo;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
// Actions -----------------------------------------
// these aren't necessary, just an example implementation
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);
]

Well thats the script if anyone could help me I gotta have this project done by tommrow thanks.

View Replies !    View Related
Creating A Scroll Bar With ActionScript? Or Other Solution?
i've been (unsuccessfully) teaching myself Flash for a while, and recently found myself needing it for a job. I've done what I can, but I can't figure out how to attach a scrollbar to a dynamic text box... Wait a second though, because it's not quite that simple.

I have a number of buttons which, upon release, display a text panel movieclip that contains the HTML enabled dynamic text box i need to scroll. The ActionScript attached to each button contains the text displayed in the text box. Each button's AS has different text to be displayed, some have a lot more text than others, hence my need a text box that scrolls.

When I'm done, there will be somewhere around 40 different buttons, which is why creating the text with ActionScript seemed the right thing to do. So I either need to know how to attach the scroll bar to what I have or create one entirely with ActionScript that can be attached to the text panel's movieclip that opens with the click of each button.

Here is what my AS looks like currently for a button:


code:
on (release) {
_root.panel._visible = true;
_root.panel.title = "Details: Unit 1D";
_root.panel.text = "1 Bedroom 1 Bathroom 812 Sq Ft Group 2A Unit (Handicapped Accessible) Please Call: (617) 576-3800 ext 210 To Schedule a Showing or For More Information";
}




please help me....i have been struggling with this for over a week and i need a solution ASAP. Also...if anyone could tell me how to insert a carriage return into the text contained in the ActionScript....that would make things a whole lot easier.

Oh, if you want to see what it looks like:

http://www.unionplace.info/floorplans2.htm

Thank you for any help or suggestions you can provide. If necessary, I can post the .FLA just ask.

View Replies !    View Related
Please Help Need Solution To Bug In Actionscript Filter Application
Greetings Actionscript Geniuses,

I'm looking for some help on what seems to be a glitch in Actionscript. I've run into problems with Actionscript functions when applying filters before, but this time it is particularly annoying. If you can help me find a work-around or if you know of a solution to my problem, I will be forever grateful.

I want to use an animated movie clip button to load an external SWF file, and I want to be able to interact with the SWF while it's on the stage. I want multiple buttons with the same functionality, so it is necessary to unload the SWF when the user explores further (i.e., moses over a new button or mouses off of the hit area). My button animation is accomplished by changing the angle of a gradient filter.

My approach has been to define a hit area in the shape of the external SWF. When the user mouses over the mc button, the shape of the hit area changes from just the button to a new hit area defined by a movie clip that is shaped like the button + the externally loaded SWF. In this way I can add functionality to the external SWF (buttons, exc.). When I mouse off of the newly defined hit area, I have the hit area revert back to the shape of the mouse.

The problem is that the hitArea method does not work properly when a filter is applied to the button that calls the external SWF. I can get this functionality when I animate the mc button in the timeline, but, of course, there are problems with the animation sticking if I mouse on and off before the button's timeline runs through completely.

I attached some code so you can see this glitch for yourself, and here are some quick instructions to get you there fast:

1. Create a new file and make a circle and a rectangle and convert both to movie clips and put them on separate layers if you like.
2. Give the rectangle the instance name "btn_mc" and name the circle "hit_mc."
3. Adjust the circle (hit area) to be 2-3 times the size of the rectangle (mc button) and make the rectangle button overlap the hit area.
4. Now make a separate SWF to load onto your stage and save it as Btn1.swf. It could contain a shape or bitmap, but make sure the external SWF has the same stage dimensions and put the shape or bitmap on the stage away from the button and hit area. (Alternatively, you could make both the button and the hit area be rectangles that overlap, then you could load an image into the space taken up by the hit area. This would be similar to what I want to do, but this bug test can be much simpler.)
5. Add the attached code.
6. Try disabling the filter by commenting out the following line (5th from the top):
var gbevel:GradientBevelFilter = new GradientBevelFilter(4,45,colors,alphas,ratios,20,2 0,5,2,"inner", false)

If you play with the code you will experience this glitch for yorself. When you test your movie, mouse over the area of the button that does not overlap with the hit area, and try to mouse onto the hit area from the button, both with the filter applied and not applied. You will se that the filter modifies the functionality such that the hitArea method is useless for its intended purpose. If you know of a way to get around this problem, please let me know.

Onward. . .
Randall
import flash.filters.GradientBevelFilter;

var colors:Array = [0x000000,0x0000FF,0xFFFFFF];
var alphas:Array = [.5,0,.5];
var ratios:Array = [0, 128, 255];

var gbevel:GradientBevelFilter = new GradientBevelFilter (4,45,colors,alphas,ratios,20,20,5,2,"inner", false)

btn_mc.filters = [gbevel];
hit_mc._visible = true;
btn_mc.onRollOver = function() {
btn_mc.hitArea = hit_mc;
this.onEnterFrame = function() {
if (gbevel.angle < 95) {
gbevel.angle+=10;
} else {
delete this.onEnterFrame;
}
this.filters = [gbevel];
}
_root.createEmptyMovieClip("canvas1_mc",canvas1_mc .getNextHighestDepth);
canvas1_mc.loadMovie("Btn1.swf");
canvas1_mc._lockroot = true;
}
btn_mc.onRollOut = function() {
btn_mc.hitArea = btn_mc;
canvas1_mc.unloadMovie("Btn1.swf");
this.onEnterFrame = function() {
this.filters = [gbevel];
if (gbevel.angle > 45) {
gbevel.angle-=10;
} else {
delete this.onEnterFrame;
}
};
}

View Replies !    View Related
Third Party Newsletter Service - Is There A Flash/Actionscript Solution?
Hello,

I'm looking for some advice or help. I work with a customer who really needs to have a flash/actionscript frontend for their subscription form but are using a subscription service to collect and process their mailing lists and need to do so for legal reasons.

Here is the code for a very basic version of the what we have to work with in html


Code:
<!-- START CODE -->
<FORM ACTION="http://theserviceused.com/ex/manage/subscriberprefs.aspx" METHOD="POST">
<FONT SIZE="-1" FACE="arial, helvetica">
<STRONG>Register for email updates</STRONG>
</FONT>
<BR>
<INPUT TYPE="TEXT" NAME="email" />
<INPUT TYPE="HIDDEN" NAME="customerid" value="000000" />
<INPUT TYPE="SUBMIT" value="Sign up" style="background-color:white;color:green;font-weight:bold" />
</FORM>
<!-- END CODE -->
Is it possible to create a flash frontend with this information alone? I cannot get access to the subscriberprefs.aspx file, and I doubt that I ever will. The Flash version I have is Flash 8.

View Replies !    View Related
Components Actionscript + PHP
Hi,

I'm trying to create a contact form using flash components. I have no problem creating one with original text fields but can't seem to figure out an actionscript for these components! I need these fields:

Name: (TextInput)
Country: (ComboBox)
Contact Number: (TextInput)
Additional Information: (TextArea)

I've tried using the component inspector to change instance names to match them with ActionScript 2.0 and my PHP document but to no avail.

This is probably very easy, but i'm new to using these!!

Thanks in advance!!

View Replies !    View Related
ActionScript With Components-Large FLV
Hello, board,
I have 13MB FLV file that progressively loads fine with a high speed connection. I am using MediaController and MediaDisplay and I would like to know is there a way to let the FLV load 50% before playing? When it starts playing back on slower connections it gets a little jumpy and makes for a bad viewing experience. Can I add Actionscript to these mediacomponents, if yes, how?

Any help would be greatly appreciated!

Sincerley,
Patrick

View Replies !    View Related
Actionscript For A Form Using Components
I am working on my company's website and they wanted me to post a form for potential customer's to use to request samples. I have set up my form using the following components:
A datefield
4 Check boxes
7 text input boxes
3 combo boxes
and 1 submit button

After looking over the tutorial on how to create a form I became grossly confused as to what Actionscript actually collects the data from the form so that the information can be e-mailed to an e-mail address. Any help with this would be greatly appreciated.

View Replies !    View Related
ActionScript/Components-Large FLV
I have 13MB FLV file that progressively loads fine with a high speed connection. I am using MediaController and MediaDisplay back and I would like to know is there a way to let the FLV load 50% before playing? When it starts playing back on slower connections it gets a little jumpy and makes for a bad viewing experience.

Can I add Actionscript to these media components, if yes, how?

Any help would be much appreciated!!
Thanks,
patrick

View Replies !    View Related
Some PURE Newbie Help
Okay guys don't get too mad at me I just wanna know where I could get a flash maker preferibly Free or for Trial that i could make a short movie with like on www.newgrounds.com I just want to mess around a bit.

View Replies !    View Related
Are Sites Like These Pure AS2?
I guess my question is, when I look at sites like the new 2Advanced Site:

http://www.2advanced.com/

I always wonder, are they pure AS2.0? Do you guys think that sites like this are built entirely via classes, without a single procedural script or frame-based code or keyframe animation? I guess the reason I ask, is because there's this idea that the perfect flash site should be 100% Class-based, but when I look at sites like this, I'm amazed they can manage to do what they do, only through code.

-Z

View Replies !    View Related
Failing In Pure AS3 Gui
Hello, this is my first post, and i need some help.
Currently i am trying to replace an AJAX gui with a pure-AS3-flash version, however, i have one *big* problem ( and maybe i'm just "google-impaired", but could not found any working examples online ):
on my gui, the user drags elements around ( Sprites are working fine ), click on the element to have a menu ( eventListeners and ContextMenu are very nice ) and can open up a modal-window with selectors ( and here lies my trouble ).

The window should have one first "select-box", given the selection, the gui fetches the data for the next selector from the server, which could be another select-box, or a text-box, or a label... i *must* build the gui dynamically, accordingly with the user's inputs.
Well, right now i'm absolutely frustrated that i can't even place a static select-box ( or a button ) on the stage

for instance, here http://willperone.net/Code/as3ui.php gave me this idea:

Code:
package {
import mx.containers.Canvas;
import mx.controls.Button;
import flash.events.MouseEvent;
import mx.core.Singleton;
import mx.resources.ResourceManagerImpl;
import mx.resources.IResourceManager;
import mx.resources.ResourceManager;

import flash.system.*;

public class App extends Canvas {

private var button:Button;

public function App() {

/* this should HACK-away the IResourceManager error
( http://groups.google.com/group/flex_india/browse_thread/thread/b53a0a828f1346eb )
, but it doesn't */
var resourceManagerImpl:Object =
ApplicationDomain.currentDomain.getDefinition("mx.resources::ResourceManagerImpl");
Singleton.registerClass("mx.resources::IResourceManager", Class(resourceManagerImpl));



button = new Button();
button.label = "I'm a Button!";
button.addEventListener(MouseEvent.CLICK, click);
addChild(button);
}

private function click(evt:MouseEvent):void {
removeChild(button);
}
}
}
despite the Singleton HACK, i still get this dreadful error, that aparently does not happen on a MXML project:


Code:
Error: No class registered for interface 'mx.resources::IResourceManager'.
at mx.core::Singleton$/getInstance()
at mx.resources::ResourceManager$/getInstance()
at mx.containers.utilityClasses::Layout()
at mx.containers.utilityClasses::CanvasLayout()
at mx.containers::Canvas()
at App()

i'm fixed on using pure-AS3 classes because i don't believe that MXML would play nicely with my requirements of
truly-dynamically-gui-fetched-from-server elements... no Flex-drag'n'drop, no MXML, just pure programatically AS3 classes with gui components.

Could anybody, please, point me to the right direction ? I'm really lost on how to work with select-boxes, text-fields, checkboxes and such GUI components on a pure-AS3-classes project.

(
I'm running:
$ ~/src/flex3_sdk/bin/mxmlc -version
Version 3.0.0 build 477

on Linux.
)

many Thanks in advance.

View Replies !    View Related
Pure AS3 And Sqlite
Is it possible to interact with a sqlite database directly using pure AS3? The deployment platform will be the browser.

I've seen connectors for use in Air, but not in a browser. I know I can use server-side stuff such as php/mysql/amf, but was wondering if there's anyway to just use AS3 and sqlite?

View Replies !    View Related
Pure Flash
Do you guys advice me to do a pure flash site ?? or shall I inlude with it some Html an PHP?

View Replies !    View Related
Pure HTML/CSS Help Here...thanks.
I am trying to get this HTML effect....(the RED Line in the center of the page to be directly in the center between the two headers)

http://mikebake.p194.pandawebsites.com/ ... center.jpg

with this page...

http://mikebake.p194.pandawebsites.com/ ... /index.php


if it looks right to you, then you are probably like me, and either have a mac, or use firefox...

but in IE I can't for the life of me get the darn red line to center in the window...it is slightly off to the right...if its not for you, try this link

http://mikebake.p194.pandawebsites.com/ ... s_home.php


The code for the page is very complex due to all the dynamic data loading...but even the simplest of pages....doesn't work...

I am trying to have a 5 column table....

the far left and far right are just indents....the 2nd and 4th are 300 wide...and the middle is 40 wide...

the middle TD has css applied to it like this..

Code:

.verticalLine {   background: #000000; background: url(/Staging-StudioAuditions/DesignTempImages/vertical_line.gif);
      background-repeat:repeat-y; background-position: center;

}


But I think the dynamically loaded text in the page makes the 2nd column widen sometimes...

I have played with all sorts of table-fixed type solutions...and cannot come up with a valid way to predict the outcome of this type deal.

I have played with
Code:

word-wrap: break-word;


but no luck at all....I have tried makiing a huge graphic in the background table and putting other tables on top of it....no luck.

What is the best way to keep a vertical line centered between to columns...and have it STAY no matter what...

The page can grown in the down direction forever.


My first born is up for grabs!!

View Replies !    View Related
Actionscript For Opening Windows Components
I have SWF Desktop and was wondering if there is a special command or scripting i can use for my actionscript to do these things

1. open my computer, my documents etc.
2. Right click menus or maybe some way to do this
3. any other goodies that would be nice to have on a Desktop flash file.

any thoughts

View Replies !    View Related
Assigning Labels To Components Using Actionscript
Hi there people. Does anyone know how I could use actionscript to change the labels of components like radiobuttons and checkboxes?

What I currently have is text that is stored in variables, such as:

var text1 = "Email";
var text2 = "Fax";

What I would like to do is to assign the values of these variables(such as "Email" for the variable text1) to the radiobuttons or checkboxes dynamically using actionscript. Is there anyway I could do it?

View Replies !    View Related
Playing Video With Actionscript How To Add Components
My code so far:


Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
myVideo.attachNetStream(ns);

var listener:Object = new Object();
listener.onMetaData = function(md:Object):void {};
ns.client = listener;

ns.play("showreelsized.flv");
I want to add components to it, (play, pause, volume) but have no idea.

View Replies !    View Related
ActionScript To Bind XML Data To Components
How can I use ActionScript to bind XML data to a comboBox component instead of using the component inspector? (I have done the latter, successfully, but that doesn’t allow access to the code - .)
My ActionScript so far imports the data (the trace picks it up) – but the ‘cbType.dataProvider line’ doesn’t work. It works when I change the data provider to an array – so what am I doing wrong?

MY CODE:
import mx.data.components.XMLConnector;
var xcFestival:XMLConnector = new XMLConnector();
xcFestival.ignoreWhite = true;
xcFestival.direction = "receive";
xcFestival.URL = "festivalItems.xml";
xcFestival.trigger();

//POPULATE THE COMPONENTS WITH THE DATA
var festXMLlistener:Object = new Object();
festXMLlistener.result = function(evt:Object) {
trace(xcFestival.results);
cbType.dataProvider = xcFestival.results;
};
xcFestival.addEventListener("result",festXMLlistener);

View Replies !    View Related
Actionscript + Components Flash Form?
How can Replicate this HTML form into a Adobe FLASH form using components. (I'm using Flash 8) There would be 6 checkboxes + 1 button and 1 textarea..



Quote:




<form action="includes/process.php?action=update" method="post">

<input type="text" name="u" id="input" class="urlinput" size="40">
<input type="submit" value="Go" class="submitbutton">
<input type="checkbox" name="encodeURL" id="encodeURL" checked="checked">
<input type="checkbox" name="allowCookies" id="allowCookies" checked="checked">
<input type="checkbox" name="stripJS" id="stripJS">
<input type="checkbox" name="stripImages" id="stripImages">
<input type="checkbox" name="stripFlash" id="stripFlash">
</form>

View Replies !    View Related
Assigning Labels To Components Using Actionscript
Hi there people. Does anyone know how I could use actionscript to change the labels of components like radiobuttons and checkboxes?

What I currently have is text that is stored in variables, such as:

var text1 = "Email";
var text2 = "Fax";

What I would like to do is to assign the values of these variables(such as "Email" for the variable text1) to the radiobuttons or checkboxes dynamically using actionscript. Is there anyway I could do it?

View Replies !    View Related
Am Doing A Webby Using Pure Flash.
me and my friend r doing a webby in flash..... and uuh... he noticed something...... ( i have programmed nothing to do this ) but for some strange reason. when i export it to a moive as a "swf" file, just to test see if everything is working ok. it can skip to the next scenes by pressing "CTRL + ENTER" on my swf....... i reprogrammed our webby 3 times and it's still doing da same thing. does anyone know why it's doing this? or is it a bug? plz i need to know .

.... is it something to do wid scenes?
[Edited by xanbarian on 07-09-2002 at 12:51 PM]

View Replies !    View Related
Pure Flash E-commerce
I am really interested in making and e-commerce store that operates 100% in flash. Flash posts the variables, calculates the shipping and everything.

I have never seen a site that stays in Flash for the entire transaction process. Is there a reason not to do this?

View Replies !    View Related
Hybrid To Pure Flash
Hi...

Right now I have a complex page built and I want to remake this page so that it functions the same, but uses only flash (no more hybrid design).

The problem I am running in to is tying the PHP together with Flash. I can pass variables back and forth no problem, but I do not know how to detect if this variable is fully loaded in to Flash. When using a textfield it is no problem because Flash will automatically place the text in to the textfield whenever it's done loading. However, how is this done otherwise?

If I query the PHP page and have it return the result (for example: echo "&result=blah,blah,blah,blah,blah" and I want Flash to take that returned string and split it at every , (NOT do this with php's explode function), how do i determine if the return string is fully loaded <B>WITHOUT</B> using a timeline loop?

basically, let's say I have a button that has this:

Code:
on(press)
{
loadVariablesNum("page.php?section=1", 0, "POST");
myArray = result.split(",");
for(i = 0; i < myArray.length; i++)
...
}


and the php is something along the lines of

Code:
<?
$section = $_GET['section'];
switch($section)
{
case 1:
$message = "&result=blah,blah,blah,blah,blah";
break;
...
echo $message;
}
?>


how do I check, in flash, that "result" is fully loaded in to flash so that I can continue with the actionscript to manipulate the string.

Sort of like doing the following, which makes logical sense, but does not work:

Code:
on(press)
{
loadVariablesNum("page.php?section=1", 0, "POST");

while(1)
if(message != "")
{
myArray = result.split(",");
break;
}
}

View Replies !    View Related
Using Library Symbols Vs. Using Pure AS3
Hey,

I have a pretty general question about Flash CS3/ AS3. I'm creating an application that has several windows (forms) that will be visible at different times, and I've been able to successfully implement them using both pure AS3 (creating classes that build the windows and populate them all with AS3 addChild...), and also using the "old" author time way (create the symbols for them in the library and populate and control them with the getChildByName() methodology).

My question is pretty simple, and in many ways it is probably opinion. Is there a significant difference in performance one way or the other ? On the one hand, using the coded approach makes for smaller file sizes, but then using the symbol approach seems to make designing the visuals much faster and easier to edit.

File size isn't that big of a consideration, only because the app is going to be run on a LAN most of the time, where loading times are not that much of a concern.

In using the coding approach, I find myself 'mocking up' the appearance of the windows anyway, and then just translating that into code, but is there a real reason to do this, or should I just make the symbols up and pull them from the library when I need them.

I'm sure that there is a happy medium to be found, but I wanted to see if there is a definitive 'best practice' for this type of thing and I figured others might have questioned it as well.

Thanks in advance.

View Replies !    View Related
MovieClip Instance In Pure AS3
I am sure that this has been asked before so please forgive me.

What I'm attempting to do is display a GIF image with fading provided by TransitionManager. The only examples I can find assume that a MovieClip instance has been created already in the Flash authoring tool. How can I create this instance in pure Actionscript 3.0?

View Replies !    View Related
Pure As3 Vs Frame Script..
Im am getting to grips with AS3 and classes, but am struggling on where to start on a project now. There are so many ways of building a site:

pure as3, all classes and objects in library
objects in library, script on frames

What is the best solution to working out which way to start a project?

View Replies !    View Related
Pure Code (CreateEmptyMovieClip)
Hello,
I have been using Flash for quite a while now, thinking I had got rather good at actionscript.
How wrong I was.
Having copied code from various places in order to try and figure out how it works, I am completely BAFFLED by what can be achieved without tool-drawing anything at all.
A good example would be McGiver's "eye candy flowers"

My question therefore is: Could anyone explain in a very basic way how to create a shape and colour it using pure actionscript? possibly explaining step by step how to get curves and angles as in the example above.
Just a couple of lines would do, just to get me started...

Actionscript - There's always something new

Many thanks for any help on this one
All the best

View Replies !    View Related
Magic Or Pure Coding?
Does anyone have a clue how did they create this menu??
http://www.capitalcomm.com.my/

This strings are amazing.... even the preloader in separated strings..

Did they use FUSE?...
I really wanna know this code... I am clueless how to achieve this effect.... I have seen tons of others examples but none is as good as this one..

thanks..
cheers

View Replies !    View Related
Pure Mvc /// Design Patterns
here is a really cool MVC app development framwork i have found and am currently playing with, check it out:

http://puremvc.org/
what does everyone think?

View Replies !    View Related
Are There Any Good Tools Or Components To Generate Actionscript Doc?
Just like the style in flash cs3's document?

http://livedocs.adobe.com/flex/3/lan...l-classes.html

thx

View Replies !    View Related
Custom Composite Components In MXML/ActionScript
Hi,

I am trying to figure out how to create a custom composite component that is composed of several other custom components.

For example I want something along the lines of:


Code:
<MyPackage:Clock size="50">
<MyPackage:Hand id="hour" length="30" width="10" />
<MyPackage:Hand id="minute" length="40" width="5"/>
<MyPackage:Tick label="12" angle="270" />
<MyPackage:Tick label="*" angle="90" />
</MyPackage:Clock>
Where the Clock, Hand, And Tick classes are defined in ActionScript, but the number of sub components each instance of Clock contains can be defined in the MXML file.

Currently, my subcomponents are subclasses of the Sprite Class, and my main component is a subclass of the UIComponent.

The error I am getting on the MXML page is Component declarations are not allowed here.

Additionally, if I get this working, is there a way subcomponents could gain access to properties of the other already instantiated subcomponents during its instantiation?

View Replies !    View Related
Article: Creating ActionScript 3.0 Components In Flash CS3
I just now noticed that its live:

Creating ActionScript 3.0 components in Flash CS3
http://www.adobe.com/devnet/flash/ar...omponents.html

... and its massive. It's in PDF format now, but I think eventually it will be assimilated into the new "Adobe Developer Connection"
http://developer.adobe.com

View Replies !    View Related
Communicating Between Flash MX And Pure Data (PD) ?
anyone have idea about how to implement it ?

the communication should happen in both directions.

using database/php as gateway between them is one possibility ???

View Replies !    View Related
Tutorial: Spinning Preloader In Pure AS3
I just finished a tutorial on an all-time classic, the spinning preloader. -> Link

I hope you find the tutorial useful.

View Replies !    View Related
Pure Flash Page Has Problems With MS-IE
I produced a pure Flash web page for some friends who have a small local fashion label. I made the movie with Flash MX Version 6 and made a primitive HTML-wrapper for it in Dreamweaver MX. The page has behaved very well over years and was enhanced with occasional updates.

Recently however people, usually from corporate Windows platforms report problems accessing the page. In fact the page seems to stay black for them. Since I am only an occasional Flash programer I am puzzled and I wonder about an easy cure to this.

Would any of you experts here offer help for me? Thank you very much. Oh yes, the page is www.viento.ch. Press on ''VIENTO'' to start. Its works well in Safari, Firefox, Netscape and older type IEs.

Thank you

View Replies !    View Related
Tutorial: Spinning Preloader In Pure AS3
I just finished a tutorial on an all-time classic, the spinning preloader. -> Link

I hope you find the tutorial useful.

View Replies !    View Related
.:pure Actionscripted Animation Goodness ::...
ok i have read many tutorials. including the one all about the drawing api in my flash mx 2004 actionscript bible... but i still have yet to understand the simplest & most basic fundamentals involved with (creating objects &) animating via actionscript.

i'd like to know... for example... how to (PURELY WITH ACTIONSCRIPT !) ::...

. make a vector based (or any) object scale, & tween as it does it. (like i see on some juxtinteractive sites... and many others...)

. make a point draw into a line. then into a shape. i want to see it draw. not just appear in full.

. move an object. from current x/y position to another x/y position... though i want it to appear to move, not just pop over to another coordinate.

** robertpenner... i keep seeing your name on more and more forums/tutorials/sites... & i've gone through one or more of your tutorials (on as.org i think) but it's still a little too complicated... the proverbial lightbulb hasn't gone off on this topic for me.

...any help or even pointers to already existing tutorials on this(/these) topics will be greatly appreciated!

T H A N K S !!

marzstar aka cyberblue aka wannabeflashgoddessvixon

View Replies !    View Related
AS3 - Tutorial: Spinning Preloader In Pure AS3
I just finished a tutorial on an all-time classic, the spinning preloader. -> Link

I hope you find the tutorial useful.

View Replies !    View Related
Build A Pure As3 Project With Design Pattern
Hi all,
probably it's a generic and presumptuous thread: building a pure really reusable As3 project with design patterns. It's too long I'm trying to imagine how and reasearching the web with fews results. I'm looking for a general approach not detailed code.
Where to start? I was thinking to start from a main Application class (something like flex <mx:Application>) which retrieves informations (like:background color, backgroundimage, size, layout) from xml and responsible of the creation of a background, a backgroundImage and manage a layout.
Any ideas or suggestions, someone is interested?
Thanks, Jad.

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved