Alpha Property For An Array Of Buttons.
I've got an array where I've stored button instance names. Such as:
buttonName=this._name;
buttonArray[x]=buttonName;
x++;
so everytime a different button is pressed it's added to this array. Now I have one button that when the user clicks on it, it needs to set all the alpha properties of the buttons in the array back to 100 (it's previously switched to 50 when the button is originally clicked on).
I'm having problems with this.. I've tried everything I can think of. I can't seem to just loop through my array and set them all. I imagine it's has something to do with how the array points to the button (or how i've assigned the button to 'this' earlier..just guesses tho). Anyways, any help would be appreciated. Thanks.
FlashKit > Flash Help > Flash ActionScript
Posted on: 07-06-2006, 12:44 PM
View Complete Forum Thread with Replies
Sponsored Links:
Set Property Alpha
Ive got an instance (called "scherm") of an MC.
I want this MC set to alpha 20, when you rollover an object on the screen.
Why isn't this working?
on (rollOver) {
setProperty (scherm, _alpha, 20);
}
Instead of setting the alpha of SCHERM to 20, it sets the alpha of the OBJECT to 20
why is this?
View Replies !
View Related
[F8] Set Property : Alpha?
Hey there. I have this code set on a MC (with the instance name of songnotes).
So when you roll over the "button" the movie clip is visible, and when you roll out it is not.
the problem is that when you roll over it shows ok, but when you roll out, every thing on the stage goes to alpha 0 not just the MC in question.
Any ideas on how to fix this?
_root.track1.onRollOut = function():Void {
if (musicbuttn != track1) {
track1.gotoAndStop("start");
}
setProperty (songnotes, _alpha, 0);
}
View Replies !
View Related
Set Property: Alpha
Hey there. I have this code set on a MC (with the instance name of songnotes).
So when you roll over the "button" the movie clip is visible, and when you roll out it is not.
the problem is that when you roll over it shows ok, but when you roll out, every thing on the stage goes to alpha 0 not just the MC in question.
Any ideas on how to fix this?
_root.track1.onRollOut = function():Void {
if (musicbuttn != track1) {
track1.gotoAndStop("start");
}
setProperty (songnotes, _alpha, 0);
}
View Replies !
View Related
Set Property-Alpha Question
Hi All,
I want to create a button that when pressed changes its own alpha down to 50% and also starts the playing of a movie clip. When pressed a second time I want for the movie clip to play backwards and the alpha of the button to change back to 100%
View Replies !
View Related
Alpha Property Question
hi all
i was just wondering: i want to decrease (or increase, it doesn't matter) the _alpha property of a MC frame after frame with one and only appropriate script. do you have an idea?
for example, i tell the MC to play from frame 1 to 40. and in the same time, i want it's alpha property to decrease from 100% to 0%.
thank you for your answers :-)
View Replies !
View Related
Setting Alpha Property
How would I go about setting the alpha of an mc if a variable has been set?
In my main timeline (2 frame loop) I have
if (_level0.sectionname != "whoweare" && _level0.sectionname != undefined) {
setProperty ("/whoweare", _alpha, "50");
} else {
setProperty ("/whoweare", _alpha, "100");
}
but it doesn't work...what am I doing wrong?
View Replies !
View Related
Strange With Alpha Property
Hi!
I have this little code:
Code:
this.createEmptyMovieClip("bar", 1);
with (bar) {
beginFill(0xFF0000, 50);
lineStyle(0, color, 10);
moveTo(0, 0);
lineTo(0, 100);
lineTo(20, 100);
lineTo(20, 0);
lineTo(0, 0);
endFill();
_x = 100;
_y = 100;
}
bar.onRollOver = function() {
this._alpha = 100;
};
bar.onRollOut = function() {
this._alpha = 50;
};
Basicaly, this draw an rectangle, and fill with red color. Problem is with alpha property. When RollOver or RollOut, not have desired _alpha (100 respectively 50). I think i have only half of this value.
Where is the problem?
This code can be tested to verify this strange!
P.S. tested with flash 8 and mx2004
View Replies !
View Related
DataGrids And Their Alpha Property
I've been scouring the web for a way to make the background of the dataGrid component (which is added via AS3) more transparent. Has anyone figured this out?
It was easy when the component was dragged out onto the stage, but then some of the other properties aren't able to be customized.
Anyone?
View Replies !
View Related
Change Alpha Property Of A MC.
Hi!
Here I am again.This forum is very good.Thanks all for your help.
I have 3 MC with their background's alpha properties set to 0.
What I want is when I pass the mouse over each MC that one I have the mouse over gets its alpha property set to 35%.
Someone has told me to do this:
movie_mc.onRollOver = function () {
movie_mc._alpha = 35;
}
movie_mc.onRollOut = function () {
movie_mc._alpha = 0;
}
But everytime I pass the mouse over the MC even if the mouse is not over a button the cursor changes to a hand cursor.And when I put the mouse over a button inside this MC the alpha goes to 0 again.
Here is my project take a look at links www.eduardotavares.com.br/main.html
How do I do that?
View Replies !
View Related
How To Change The Alpha Property...
Hi!
I have 3 MC at my link section.Each one of them has a background (converted to a symbol) with alpha set to 0.I want that when I pass the mouse over each one the background gets its alpha property to 35 %.
How can I do that?
Here is the link so you can see what I am talking about:
www.eduardotavares.com.br/main.html and click link
View Replies !
View Related
Papervision 2.0 And Alpha Property
Hi,
Do you know how we can modify alpha parameters on Plane object with the new release of Papervision (2.0 alpha) ?
Previously, I was doing something like that :
Code:
plane.containers.alpha = 0.5;
But containers property disappeared from Plane object in version 2.0; I browsed every property of the new Plane object and couldn't figure it out.
Thanks for your help
View Replies !
View Related
Alpha Property Of Dynamic Text Box
I am trying to set the alpha property of a movie clip with the following actionscript:
_root.movieclip._alpha = 20;
the problem I'm having is that the movie clip contains a dynamic text box and while the rest of the contents of the movie clip dim to the 20% alpha setting, the dynamic text remains at 100%.
Any thoughts on how to make the dynamic text dim as well would be greatly appreciated.
Thanks,
Brian
View Replies !
View Related
Text Instance And Alpha Property
Hi everybody:
I am trying to make "dissapear" an instance from flash5 actionscript, putting its alpha propierty into 0. But I have just found out that, when that instansce consist of text, nothing happens.
However, It turns into 0 easily manually, when I change the property from main panel.
Any suggestion?
Thanks in advance.
View Replies !
View Related
Change Alpha Property From Inside A Mc
I have a button inside a movie clip. I want this button, when clicked, to change the alpha value of a differect mc on the same scene.
When using the regular code for changing alpha value:
on (release) {
b1._alpha=100; (where "b1" is the name I gave the mc)
}
nothing happens.
Is it because I am not calling correctly the mc? what method should I use to call it?
Thanks, Efrat.
View Replies !
View Related
Gone Mad --alpha Property For Text Fields?
the book says you can do this but ... not sure what I am doing incorrectly. I have created a text field -- _root.createTextField("myField", 10, 20, 50, 200, 30);
but when I then add the code myField._alpha = 40 (or whatever value) it does nothing to the text field value. Im going mad, if anyone could shed some light, would be very greatful. ta k
View Replies !
View Related
Problem With Setting Alpha Property
hi flashkit,
i have made a movie clip button & placed it in an mc (whoweare_menu) and i would like to set the alpha of another mc (events) to zero. I have used these 2 scripts but they don't work:
this._root.events._alpha("0");
this._root.events.setProperty._alpha("0");
any help is kindly appreciated.
Tks, intan
View Replies !
View Related
Apply Easing To ALPHA PROPERTY (help?)
Here is the code I am using. When I roll over (hover) the button, I still want it to glow, but have it ease from 0.0 to 0.8 then back to 0.0 when roll off. (The glow steadily gets brighter).
Anyone that can help show me what I am doing wrong would be greatly appreciated.
import flash.filters.GlowFilter;
var len:Number = 3
for (var i:Number=0; i<len; i++) {
var ref:MovieClip = this["st" + i]
ref.buttonMode = true;
ref.mouseChildren = false;
ref.addEventListener(MouseEvent.ROLL_OVER , rollMe)
ref.addEventListener(MouseEvent.ROLL_OUT, outMe)
}
function rollMe(e:Event = null) {
makeMeGlow(e.target as MovieClip);
}
function outMe(e:Event = null) {
stopMeGlow(e.target as MovieClip);
}
function makeMeGlow(who:MovieClip) {
var color:Number = 0x6caddf;
var alpha:Number = 0.0;
var targetAlpha:Number = 0.8;
who.alpha += (targetAlpha - who.alpha) * easing;
var blurX:Number = 20;
var blurY:Number = 20;
var strength:Number = 2;
var quality:Number = 3;
var inner:Boolean = false;
var knockout:Boolean = false;
var filter:GlowFilter = new GlowFilter(color, alpha, blurX, blurY, strength, quality, inner, knockout);
var filterArray:Array = new Array();
filterArray.push(filter);
who.filters = filterArray;
}
function stopMeGlow(who:MovieClip) {
who.filters = null;
}
stop();
View Replies !
View Related
Alpha Property Not Effecting Textfields
I have textfields which children of buttons. I cannot seem to get the textfields to be alpha 0. I can get all of their parents to be alpha 0. Why is this?
This would be the targeting from the maintimeline:
menuCont.indCont.btnCont.myButtonsAreHere
heres what I am using now from the maintimeline:
ActionScript Code:
var menuCont:MovieClip = new MovieClip();
this.addChild(menuCont)
function bsRollOver(event:MouseEvent):void {
//bs.ts = 150;
if (menuCont.getChildAt(1).alpha > 0) {
menuCont.getChildAt(1).alpha = 0;
} else {
menuCont.getChildAt(1).alpha = 1;
}
}
//next i call an instance of a menuClass I made
var m1:MenuDot = new MenuDot (mainTL.menuCont);
;
View Replies !
View Related
Error Defining Alpha Property
Would've thought this would be pretty basic but apparently I'm missing something here...
I'm trying to get a transparency map working in Flash from the alpha channel in a .TGA file. I'm using the following code:
asdf.alpha=1;
on a movie clip named 'asdf'. But I'm getting the compiler error "Access of undefined property asdf." What exactly is going wrong here?
While I'm on the subject in this thread, I can't figure out how to use an alpha channel as a transparency map over the RGB channels of the same file. Will the code I listed above do that?
View Replies !
View Related
Dynamic Manipulation Of Alpha Property
Code:
thumbs=["1.jpg","2.jpg","3.jpg"]//portfolio images
m = 20 // relative displacement
r = 4 // number of objects per row
count=16 // amount of objects total
h = r+(r*.25)
for (i=1; i<(count+1); i++) {
if(i >=(r+1)){xCord = (m*(i-((h+(r*2))-i)))+(Stage.width/2)}
if(i<(r+1)){xCord = (m*(i-(h-i)))+(Stage.width/2)}
if(i>=(r*2+1)){xCord = (m*(i-((h+((r*2)*2))-i)))+(Stage.width/2)}
if(i>=(r*3+1)){xCord = (m*(i-(((h+((r*2)*2))+(r*2))-i)))+(Stage.width/2)}
if(i>=(r*4+1)){xCord = (m*(i-(((h+((r*2)*2))+((r*2)*2))-i)))+(Stage.width/2)}
if(i<(r+1)){yCord = (Stage.height/2)-140}
if(i>=(r+1)){yCord = (Stage.height/2) - 100}
if(i>=(r*2+1)){yCord = (Stage.height/2)-60}
if(i>=(r*3+1)){yCord = (Stage.height/2)-20}
if(i>=(r*4+1)){yCord = (Stage.height/2)+20}
if(i>=(r*5+1)){yCord = (Stage.height/2)+60}
if(i>=(r*6+1)){yCord = (Stage.height/2)+100}
if(i>=(r*7+1)){yCord = (Stage.height/2)+140}
temp = mybox.duplicateMovieClip ("box"+i, i);
_root["box"+i].number=i;
_root["box"+i].gotoAndStop(i+1);
_root["box"+i]._x = xcord;
_root["box"+i]._y = ycord;
}
for(i=0;i<=count;i++){
contain.duplicateMovieClip("gallery"+i, i+40);
_root["gallery"+i].loadMovie(thumbs[i]);
_root["gallery"+i]._x= (((Stage.width/2)-60)+(i*20));
_root["gallery"+i]._y= (Stage.height/2);
_root["gallery"+i]._xscale = 15;
_root["gallery"+i]._yscale = 15;
_root["gallery"+i]._alpha = 0;
}
for (var i=0;i<=count;i++){
_root.attachMovie("mybox", "box"+i, _root.getNextHighestDepth(), {_x:i*30});
_root["box"+i].thei= i+1;
}
for (var i=0;i<=count;i++){
_root.attachMovie("contain", "gallery"+i, _root.getNextHighestDepth(), {_x:i*30});
_root["gallery"+i].i= i-1;
_root["box"+i].onRollOver=function(){
_root["gallery"+i]._alpha = 100;
}
_root["box"+i].onRollOut=function(){
_root["gallery"+i]._alpha = 0;
}
}
In short thumbs are images which are loaded onto the stage.
Then I have boxes which are meant to act like rollovers and dependent one which is rolled over I need the alpha to change from 0 to 100.
Since, all the images will be on the screen but, transparent, unless the button is rolled over in which makes one opaque.
I have everything set up and working besides for the dynamic application of the alpha property to each individual image.
particularly this piece of code(near the bottom):
Code:
_root["box"+i].onRollOver=function(){
_root["gallery"+i]._alpha = 100;
When I plug in a actual name for gallery this works.
For instance:
Code:
_root.gallery1._alpha = 0;
However, that makes it so any square you rollover the same image appears for each.
Therefor, I need to do it more so like I have for the box and base it on i.
Any help would be most appreciated
thanks
View Replies !
View Related
Alpha Property Not Working With Text
I have created a simple motion tween with a MovieClip created from a text phrase created in Flash and have tried to set the alpha index to got from 0% at the beginning of the tween to 100% at the end. Here is the problem, the tween works great, however the alpha value is not working AT ALL. It works with MovieClips created using jpg and png images imported into flash, however if I use text inside flash and convert that to a MovieClip it will not work. I am not using actionscript, I am only working with the timeline and property inspector. What is going on and why will this not work? I have searched the forum and it seems I am the only idiot who is having a problem like this. Can anyone please help me out? Also, I am using Flash 8.
Thanks!
Chuck
View Replies !
View Related
Sprites/Containers - Alpha Property
I have created a container for placing a number of objects and would like to globally set the alpha to 50%.
Why can't I just do:
container.alpha = 50;
(container is a sprite)
Any insight would be appreciated
Attach Code
import flash.display.*;
import flash.text.TextField;
import flash.text.*;
import flash.events.Event;
import fl.transitions.*;
import fl.transitions.easing.*;
// create container for the loading media message
var container:Sprite = new Sprite();
addChild(container);
container.x = 10;
container.y = 300;
var format:TextFormat = new TextFormat();
format.font = "Tekton Pro";
format.color = 0xFF0CCC;
format.size = 60;
var myText:TextField = new TextField();
myText.selectable = false;
myText.width = 1000;
myText.embedFonts = false;
myText.defaultTextFormat = format;
myText.text = "Loading media... please wait";
container.addChild(myText);
container.alpha = 50;
View Replies !
View Related
Smoother Increment On Alpha Property
This is my first ever question that I have posted to a forum. I normally spend hours battling with the simpliest AS and eventually work it out, but in this case I've decided to seek help.
Anyway, I've trying to run the following AS applied to a button:
on (rollOver) {
i = getProperty(this.button01, _alpha);
while (i<100) {
if (i>100) {
break;
}
setProperty(this.button01, _alpha, i++);
}
}
on (rollOut) {
i = getProperty(this.button01, _alpha);
while (i<=100) {
if (i<=50) {
break;
}
setProperty(this.button01, _alpha, i--);
}
}
The action seems to work, however the increment is instant and I want to acheive a smoother transition. Any help appreciate.
Thanks
Simon
View Replies !
View Related
External Swf Load With Alpha Property = 0
I am loading an external swf into my main movie and setting its alpha = 0;
The problem is that only the picture inside swf stays invisible while dynamic text doesnt (it appears immediatelly).
SWF consists of 3 layers: transparent background, dynamic textfiled, and mask for text.
And I am loading swf into a movie clip on stage.
Anyone know why is this happening and how to fix it?
Otherwise I cant tween it..
Thank you!
View Replies !
View Related
Smoother Increment On Alpha Property
This is my first ever question that I have posted to a forum. I normally spend hours battling with the simpliest AS and eventually work it out, but in this case I've decided to seek help.
Anyway, I've trying to run the following AS applied to a button:
on (rollOver) {
i = getProperty(this.button01, _alpha);
while (i<100) {
if (i>100) {
break;
}
setProperty(this.button01, _alpha, i++);
}
}
on (rollOut) {
i = getProperty(this.button01, _alpha);
while (i<=100) {
if (i<=50) {
break;
}
setProperty(this.button01, _alpha, i--);
}
}
The action seems to work, however the increment is instant and I want to acheive a smoother transition. Any help appreciate.
Thanks
Simon
View Replies !
View Related
Change Background Alpha Property
Hi!
Here I am again.This forum is very good.Thanks all for your help.
I have 3 MC with their background's alpha properties set to 0.
What I want is when I pass the mouse over each MC that one I have the mouse over gets its alpha property set to 35%.
How do I do that?
View Replies !
View Related
Alpha Property Change EMERGENCY
I am trying to create a frame based action where a when the timeline reaches a frame it goes to a mcInstance (ability) and goes to a frame label inside the mc(web) and then sets the alpha for the mc to zero and then fades up the alpha (like i would do with a regular tween)
how would something like that be coded?
R
View Replies !
View Related
Random Animation Of Alpha Property
Hi all, I've been racking my brain for way too long on how to do this and I'm not sure where to start anymore.
Here's what I want to do:
I have a movieclip called smoke_mc and using function I make it fade in. Once it is fully visible I'd like to have it randomly fade in and out at different rates using AS instead of tweens.
If anyone can point me in the right direction it would be greatly appreciated.
TIA.
View Replies !
View Related
Tweening Alpha Property With Tweener
Hi guys,
Got this code here that I'm trying to use to tween a movie clip in. However, when I add the alpha property to it, it just sets the alpha and doesn't tween it in over time.
Tweener.addTween(holder, {x: 200, y: 50, time: 2, transition:"easeOut"});
to
Tweener.addTween(holder, {alpha: .5, x:200, y:50, time: 2, transition:"easeOut"});
I looked in the tweener documentation and a couple other websites, but still haven't found how to do this yet. Anybody know?
Thanks.
Alex
View Replies !
View Related
Simple Alpha Property Change...not Working
I have a button clip with on(RollOver) assigned to it so that the alpha of another MC...in this case "target" is set to 100% from an original alpha state of 0%. For some reason I can't get this to work. Here are the components and action script:
-Button called "testbutton"
-MC called "target"
-All on one layer in one frame.
Actionscript:
on(rollOver) {
target._alpha = 100;
}
How much simpler can this get? How is this function supposed to work? Thanks in advance!
View Replies !
View Related
[F8] Help With List Component Setting Alpha Property On Map
I have been working on an interactive map for a hospital and am almost done. I have a list component that is filled with locations. Upon selecting an item on the list it needs to highlight a building on the map by chaning the alpha setting on a highlight movie clip. The problem comes when you pick a different location. You must click it twice to set the value. I need the list to change the alpha setting on the first click. Here is the related code.
code: function defineproperty() {
}
myListBoxListener = new Object();
myListBoxListener.change = function(eventObj) {
var eventSource = eventObj.target;
var theSelectedItem = eventSource.selectedItem;
var theSelectedItemLabel = theSelectedItem.label;
var theSelectedItemData = theSelectedItem.data;
var buildingpropertyA:String = "_root.mapgraphic.mcgmove.mcgmap.buildings.";
var buildingproperty:String = buildingpropertyA.concat("", theSelectedItemData);
if (count == 1) {
setProperty(buildingproperty, _alpha, var2);
count = count - 1;
} else {
setProperty(buildingproperty, _alpha, var1);
count = 1;
}
setProperty("_root.mapgraphic", _xscale, 80);
setProperty("_root.mapgraphic", _yscale, 80);
setProperty("_root.mapgraphic.mcgmove", _x, -379.7);
setProperty("_root.mapgraphic.mcgmove", _y, -160.6);
};
myListBox.addEventListener("change", myListBoxListener);
This seems a bit complex - here is the link to the map in it's current state:
http://s129542311.onlinehome.us/mcg/
Jeremy
View Replies !
View Related
Changing The Alpha Of A Property When Clicking A Button
I have this code in AS 3.0:
stop();
myBtn.buttonMode = true;
myText_mc.alpha = 0;
myBtn.addEventListener(MouseEvent.CLICK, ClickFunction);
function ClickFunction(event:MouseEvent):void{
myText_mc.alpha = 1;
}
I want the alpha of the movieclip called myText_mc to start at 0 (not seen) and then appear when clicked...it does not work, what did I do wrong?
Thanks
View Replies !
View Related
Alpha Property On Dynamic Text Not Working
Hello,
I have generated several TextFields dynamically through a for loop. I would like all the text fields to have their alpha set to 0 so that each field can eventually fade in.
When I apply the alpha property by setting it to 0, or even .5 the text appears to still be at an alpha of 1. Does anyone know how to make the text appear with a low to 0 alpha?
I have attached the code from the function which runs the for loop to generate the text fields. Please not that the value of the text fields are stored in a global array, and the text format objects are also global and are declared in the main body of the class.
Thank you in advance for any help you are able to provide, the code is attached below
Lee
Attach Code
private function showSlide():void {
if (s>-1) {
for (var n:Number = 0; n<slides[s].length; n++) {
root["t"+n] = new TextField();
root["t"+n].width = 980;
root["t"+n].text = slides[s][n];
root["t"+n].x = stage.x + 20;
root["t"+n].y = tY + n* 20;
root["t"+n].selectable = false;
root["t"+n].multiline = true
root["t"+0].alpha = .0;
addChild(this["t"+n]);
txtStyle.font = "Arial";
txtStyle.color = 0xFFFFFF;
txtStyle.size = 24;
this["t"+n].setTextFormat(txtStyle);
}
}
}
View Replies !
View Related
[AS3] Change Alpha Property Of Button [from Post]
I am trying to change the alpha property of a button using actionscript 3.
I dont want to create external AS file. Can you guide me on this?
Code:
circle_mc.addEventListener(MouseEvent.CLICK, clickHandler);
function clickHandler(event:MouseEvent):void {
trace("You clicked the ball");
//circle_mc.startDrag();
//square_btn.visible=false;
//what should i write to change the alpha of square_btn?
}
View Replies !
View Related
Alpha Property Does Change Textfield Prop.
I'm switching the alpha property from 1 to 0 and back on an instance of a custom class that extends a sprite. The code works for the most part. The only thing that does not turn alpha 0 some textfields associated with buttons. I cant think of why the entire button can be alpha 0 and the textfield does not get affected. Any thoughts?
ActionScript Code:
function bsRollOver(event:MouseEvent):void { if (menuCont.getChildAt(1).alpha > 0) { menuCont.getChildAt(1).alpha = 0; } else { menuCont.getChildAt(1).alpha = 1; }}
I'm sure I'm missing simple =/
View Replies !
View Related
Alpha Property Causing Play() To Stop Working.
I have a problem that is stopping my mc.play() stopping when I try to set the .alpha property of an object.
I have attached the code and have rem // out the alpha lines.
If you can help I can send you the fla to see the problem occuring.
Regards
Wayne
Attach Code
stop();
// btnRental Button
btnRental.buttonMode = true;
btnRental.addEventListener(MouseEvent.MOUSE_OVER, btnRental_Over);
btnRental.addEventListener(MouseEvent.MOUSE_OUT, btnRental_Out);
function btnRental_Over(e:MouseEvent):void {
btnRental.gotoAndPlay(2);
theGallery.gotoAndStop("fRental");
theGallery.pics.alpha = .7;
txtSplash.htmlText = "<font size="30">Rental Collection</font><br><br><font color="#FFFFFF">Choice of two, ideal for investors, from 7,995 euros complete.</font>";
}
function btnRental_Out(e:MouseEvent):void {
btnRental.gotoAndPlay(11);
//theGallery.pics.alpha = 1;
theGallery.play();
txtSplash.htmlText = "";
}
// btnSilver Button
btnSilver.buttonMode = true;
btnSilver.addEventListener(MouseEvent.MOUSE_OVER, btnSilver_Over);
btnSilver.addEventListener(MouseEvent.MOUSE_OUT, btnSilver_Out);
function btnSilver_Over(e:MouseEvent):void {
btnSilver.gotoAndPlay(2);
theGallery.gotoAndStop("fSilver");
//theGallery.pics.alpha = .7;
txtSplash.htmlText = "<font size="30">Silver Collection</font><br><br><font color="#FFFFFF">Contemporary in style, the cherry range in particular is our best seller, ideal for the discerning buyer.</font>";
}
function btnSilver_Out(e:MouseEvent):void {
btnSilver.gotoAndPlay(11);
theGallery.play();
//theGallery.pics.alpha = 1;
txtSplash.htmlText = "";
}
// btnGold Button
btnGold.buttonMode = true;
btnGold.addEventListener(MouseEvent.MOUSE_OVER, btnGold_Over);
btnGold.addEventListener(MouseEvent.MOUSE_OUT, btnGold_Out);
function btnGold_Over(e:MouseEvent):void {
btnGold.gotoAndPlay(2);
theGallery.gotoAndStop("fGold");
txtSplash.htmlText = "<font size="30">Gold Collection</font><br><br><font color="#FFFFFF">Modern contemporary in style, chic in look, for those seeking a touch of elegance.</font>";
}
function btnGold_Out(e:MouseEvent):void {
btnGold.gotoAndPlay(11);
theGallery.play();
//theGallery.pics.alpha = 1;
txtSplash.htmlText = "";
}
// btnPlatinum Button
btnPlatinum.buttonMode = true;
btnPlatinum.addEventListener(MouseEvent.MOUSE_OVER, btnPlatinum_Over);
btnPlatinum.addEventListener(MouseEvent.MOUSE_OUT, btnPlatinum_Out);
function btnPlatinum_Over(e:MouseEvent):void {
btnPlatinum.gotoAndPlay(2);
theGallery.gotoAndStop("fPlatinum");
//theGallery.pics.alpha = .7;
txtSplash.htmlText = "<font size="30">Platinum Collection</font><br><br><font color="#FFFFFF">This collection is individually tailor made to your requirements perfect for the person who knows what they want or are looking for something different.</font>";
}
function btnPlatinum_Out(e:MouseEvent):void {
btnPlatinum.gotoAndPlay(11);
//theGallery.pics.alpha = 1;
theGallery.play();
txtSplash.htmlText = "";
}
View Replies !
View Related
Setting Alpha (brightness) Property In Relation To Mouse X,y Coordinates.
I know this is somewhat simple and I've seen the tutorial before but can't seem to find it when I need it
I have a MC (instance name "footer") that I would like to change the alpha (or brightness) as the mouse nears it. For example, while the mouse is 200 pixels away, the MC's alpha is set to 20%. As the mouse nears the MC, I would like the alpha to adjust according to the mouse's position--making the MC fade in more and more... So when the mouse is right over top of it, the MC's alpha is 100%.
If someone could point me in the right direction.....
Thanks
Schimke
View Replies !
View Related
Sorting Array After A Property
I have an array with some objects.
I want to sort my array after my obj_date_number.
trace("global_items_top = "+global_items_top[0][0].obj_date_number);
so the property excists, - but how do I sort my array after that property?
This doesn't work:
global_items_top.sortOn(["obj_date_number"],Array.NUMERIC);
Any idears?
Greetings
Godowsky
View Replies !
View Related
How Can I Set Dynamic Array Property?
I want to use this function multiple times but the array has different property name. i tried this[dynamicProperty] but get error..
PHP Code:
private function eregArray(arrayData:Array, filterName:String, dynamicProperty:String):Array {
var regExp:RegExp;
if (filterName == "All") {
// do something
}
else if (filterName == "#") {
// do something
}
else {
// do something
}
if (filterName != "All") {
for (var i:int = 0; i < arrayData.length; i++) {
if (!regExp.test(arrayData[i].dynamicProperty)) {
arrayData.splice(i, 1);
i--;
}
}
}
return arrayData;
}
View Replies !
View Related
[CS3] Having An Array As A Property To An Object
Hey folks!
Does anyone know how to create multidimensional properties in an Object?! (ie. Having an array as a property to an Object)
This works:
Code:
data = new Object();
colName = "some_name";
data[colName] = "the data";
trace(data.some_name);
trace(data[colName]);
But I need to to this on a deeper level. Like this:
Code:
data = new Object();
colName = "some_name";
data.property.[colName] = "the data";
trace(data.property.some_name);
trace(data.property[colName]);
I been trying several ways to solve this problem. Searching google over and over. But I just can't find the solution!
Does anyone know how to have an array as a property!?
View Replies !
View Related
Adding An Array As A Property Of An Object
Hi all,
I'm generally familiar with addProperty and all of it's little foibles (ho-hum). The one thing I can't seem to get working is having an array as a property.
code: Tracker = function (){
this.addProperty("_sprites", Tracker.prototype.getSprites, Tracker.prototype.setSprites);
}
Tracker.prototype = new Object();
Tracker.prototype.getSprites = function(){
return this._sprites;
}
Tracker.prototype.setSprites = function(newSprite){
if (!this._sprites){
//the sprites array does not exist, create it
this._sprites = new Array();
}
for (x = 0; x < this._sprites.length; x++){
exists = 0;
//assume the sprite doesn't exist
if (this._sprites[x] == newSprite){
//the sprite does exist!
exists = 1;
theSprite = x;
//mark where it is in the array
break;
//no need to search any more, leave the for loop
}
}
if (exists){
//it exists, so remove it
this._sprites.splice(theSprite,1);
}else{
//it doesn't exist, create it
this._sprites.push(newSprite);
}
};
So, how do you create an array as a property of on object?
I think I see Catbert coming
View Replies !
View Related
[F8] Help Please Can A Class Have An Array As A Property? Having Troubles.
Okay, the pertinent information at the start of the class:
PHP Code:
class Ship extends MovieClip {
//private variables
private var _gridsize
private var _gridrow:Number = 0;
private var _gridcol:Number = 0;
private var _health:Number = 9;
//public variables
public var movequeue:Array = Array();
public var beingmoved = false;
public var _facing:Number = 90;
.....
I left in a bunch of the internal variables just so people can see how I was declaring and initializing them.
The problem is with the movequeue property/variable. I have tried declaring it with 'new Array()' at the end as well.
What is happening is that later on in the class file I have method that pushes a value into the moveque. Stripped down, the problem part is:
PHP Code:
private function move1() {
this.movequeue.push("somevalue")
}
In my main code the problem is that after this function call, all my classes of type 'Ship' are assigned the same movequeue.
So if I had ship objects 'playership' and 'playership2', if I did this:
PHP Code:
playership.move1()
trace(playership.movequeue)
trace(playership2.movequeue)
They would both trace "somevalue".
Is my error that you just can't have an array as a property in a class? Because it is a class itself? But a string and a number are classes in AS as well, aren't they?
I am confused and very annoyed.
I was debugging the wrong part of the code for about 2 hours over this issue until I found out that it was the rather simple act of doing the push itself was where the problem was cropping up.
Please help, this is driving me nuts!
View Replies !
View Related
Line Object Property -> Array
I am attempting to step through a line and copy information into an array.
I tryied creating a class but got errors.
Code:
class node {
private var x:number;
private var y:number;
private var percent:number;
private var distance:number
}
all the same, even using an array to store my data did not work
Please help!!!
Code:
// create a clip to draw to
_root.createEmptyMovieClip("mc", 1);
// set our line style
mc.lineStyle(1, 0x000000);
// draw the line based on handle locations
mc.moveTo(10,10);
mc.lineTo(100,100);
mc.lineTo(50,150);
mc.lineTo(200,200);
mc.lineTo(100,250);
var myArray = new Array();
var count:Number = mc.length;
trace(count);
trace(mc(0).x);
myArray(0).x = mc(0).x
myArray(0).y = mc(0).y
myArray(0).percent = 0.2
myArray(0).distance=12
//for ( var i=0; i<myArray.length; i++) {
// trace(myArray[i]);
//};
also any help on using the debug to view my variables.
I couldn't see any of my local variables in the debug window.
View Replies !
View Related
For + Array + Property + Variable = Trouble
i´m doing a loop to attribute the values to _x property, and use it to make random movimets with movieclips
i´ve got 16 movieclips in my stage, named
b1, b2, b3....b16
and the code is
Code:
count = 0
chama = setInterval(function () {
count++
for (a=1; a<=16; a++) {
eval("b"+a).xp = random(68)+11
eval("b"+a).yp = random(68)+11
eval("b"+a).onEnterFrame = function() {
this._x = this._x + (this.xp-this._x)/10
this._y += (this.yp-this._y)/10
if (_root.count == 3) {
clearInterval(chama)
setInterval(cPos, 1000)
}
};
}
},2000)
so... after 3 time that setinterval execute this function, i´d like to call a function to get this movieclips, in their current positions and take them in especifics positions on stage
so I created an Array and I´m trying to use this code to define variables with values from the Array, and make a moviment to the especifics positions
Code:
xC = [63.9, 16.95, 45.85, 65.55, 18.75, 26.2, 55.85, 55.25, 28.85, 21.95, 36.6, 35.75, 14.7, 45.7, 14.45, 60.75]
function cPos () {
for (a=1; a<=16; a++) {
eval("b"+a).onEnterFrame = function() {
this._x = this._x + (_root.xC[a+1]-this._x)/10
}
}
}
but it´s not working
why???
what can I do to Take the variables inside the array and use them to respectives movieclips b1, b2....b16???
thanks
Chan
View Replies !
View Related
|