CreateEmptyMovieClip() And Setting _visible Property
I am attempting to create a series of empty MCs, load an external .jpg into each created MC and then make the MCs invisible so I can have my way with them later in the file.
My code is as follows:
Code: var slideCount = 1; while (slideCount<=6) { createEmptyMovieClip("slide"+slideCount, slideCount); loadMovie("img/img"+slideCount+".jpg", "slide"+slideCount); setProperty("slide"+slideCount, _visible, false); slideCount++; } The creating and the loading are working fine. But it seems it is not possible for me to set the _visible property of the created movie to false. Strangely, any other property I attempt to manipulate this same way (_alpha, _x, _xscale, everything else I've tried) works. But not _visible. I've even tried using direct references in later frames to make these created clips invisible and it's not working.
What am I missing here? So baffled.
ActionScript.org Forums > Flash General Questions > Other Flash General Questions
Posted on: 02-15-2006, 05:25 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Looping And Setting _visible Property
Hi everyone, I've been a lurker for awhile, but now I'm stuck myself.
I'm basically trying to load a given number of .swfs into new mc's and then turn the _visible = false but it's not working. I think I'm reference the mc's correctly since the positioning is working...here's the code. And it is getting in the if..then statemement. THe movies are loading and positioning, just not hiding. Thanks!
PHP Code:
for (x= 1; x <= maxSlide; x++) {
var sName = "slide" + x;
this.createEmptyMovieClip(sName,x+1);
this[sName]._x=0;
this[sName]._y=50;
var sPath = "content/" + sName + ".swf";
trace (sName + ", " + sPath);
if (x>1) {
trace ("in loop, " + sName);
this[sName]._visible = false;
}
loadMovie(sPath,sName);
}
_visible Property?
In my main timeline i have a movie clip instance called "menu_mc" that consists of 4 buttons that animate. So when i first load the my swf or whatever i want it so 3 of the 4 buttons dont show. I tried going "_root.menu_mc.buttonName._visible=false; but it doesnt seem to work. Am i doing something wrong or what? plz help thanks!!
[F8]using _visible Property
I'm creating a standalone .exe file in Flash. Instead of loading external swf's (the whole file needs to be completely self-contained if possible) I'm trying to use the _visible property to turn a slide show on and off. However, when I assign a "_visible = true" property to a button, the movie only stays visible for one frame then blinks off again.
Complicating this somewhat is that I'm using a scroll pane component. The button which turns on the _visible property is inside the scrolling content, and the slide show plays on a layer in front of the scroll panel. So the end result I'm looking for is being able to make the slide show visible from inside the scrolling content, then turning it off again with a button that is either inside the slide show or a separate mc.
Thanks for any help!
Gerry
_visible Property
I am loading external swfs as my webpages, but when i roll over them and go over a location where i have buttons on my homepage behind the external swf i still get the little hand pointer, but there is no button in the swf just on the homepage(parent swf) behind it. I thought of trying to make the buttons not visible when i load an external swf but that was no help because then they go away before the page is loaded. Is there an alternative to this problem. Please Help!
Help With Text._visible Property
In my movie when I get to a certian key frame I want to make 2 text fields that are in the next frame invisible. But I don't seem to understand the syntax correctly.
Would not do something like this in the keyframe before you get to the frame with the text? I need to control it from one frame ahead.
Code:
evelutionText1._visible=false;
evelutionText2._visible=false;
Problem With _visible Property
i got this as error
**Error** Symbol=Clock, layer=a, frame=1:Line 6: Syntax error.
clock_mc.0_mc._visible =false
this is the code
clock_mc.0_mc._visible =false
0_mc is a movie clip that is inside clock_mc, another clip, WHATS WRONG :S this is driving me crazy
Please Explain _visible Property...
Can someone please explain how the _visible property works and how I can use it with loading external movies into my main.swf...
I have 3 movies loading into my main and I want to hide two of the movies until my main movie is preloaded. I am using a preloader for the main movie but I don't need it for the other two movies...
Any help is appreciated.
Help With _visible Property Onload...
Hi All,
I'm hoping someone can help me with this... I have 2 EXTERNAL movies being loaded with initial load of my site into my main.swf, one of which (movingbg.swf) is being loaded with a preloader. The problem is that my other movie (menubar.swf) is loaded before my first movie. I think I should use the _visible property to solve this and here is what I have so far...
On second.swf I have:
onClipEvent (load)
{
_y;
_y = 0;
this._visible = false;
}
On my preloader located in my main I have:
this.onEnterFrame = function ()
{
var _l1 = _root;
percent = _l1.empty.percent;
if (_l1.empty.percent == 100)
{
_l1.menubar._visible = true;
this._visible = false;
} // end if
};
I am stuck because I have no idea what to use in the first frame of my main movie. I think I am on the right track here... please let me know if I am not.
Any help is greatly appreciated.
Question On The _visible Property
As in, I want to load up a bunch of jpegs, but not display them on the stage.
Is there a way to load jpegs and swfs, into the library, and not even worry about killing their visibility on the stage?
thanks
Property Assignments Etc. Ignored (_visible And SwapDepths Mainly)
Hi!
I have a lot of functions which are called in an onClipEvent(enterFrame) based on a lot of boolean variables. One of the functions sets ._visible = true and .swapDepths(nDepth)
on a clip, but it doesnt happen. if I try to trace the ._visible property, it's true, but in the debugger it's still false. the clip doesn't show either. I even tried to call ONLY .swapDepths in one frame, but this results in some random behavior.
Seems like only 60% of my new settings is applied, but all of the code is correct. (believe me, I'm not green)
Is there some rules not described by Macromedia for those properties and methods? Like "this action must be executed in a frame for iteself".
I haven't found anything in the documentation.
please help!!
bonghead
_visible Property Not Displaying Correctly
I have a problem with programming a simple Memeroy game, where you have to find pairs. Only two cards can be revealed at a time. If it is a pair they will stay visible, if not they should be turned again after waiting some seconds. The pictures are the underlaying layer, the backside of the cards are in movieclips of which the visible property is changed and invisible buttons on top trigger the thing.
The SWF can be viewed at http://www.mhofele.de/Memory3.swf
The code should be fine, because all the trace prompts are correct, but somehow I can't see the visibility changing on the second cards. Can someone see what is wrong with it?
Here's the code of the buttons. (There is only a global variable in the framescript, no other scripts)
Code:
on (release) {
trace ("Beginn");
if (A2._visible == true) { // this script is only doing something, when card was not revealed
trace ("card is not yet revealed");
// 1. Click
if (aufgedeckt < 1) {
trace ("1. Click");
A2._visible = false; // reveal card
aufgedeckt++;
trace ("Variable 'aufgedeckt' was increased by 1");
k = A2;
trace ("movieclip is saved in global Variable k");
trace ("k = " + k);
}
// 2. Klick
else {
trace ("2. Click");
trace ("reveal card");
setProperty("A2", _visible, false); // reveal card
trace (" is partnercard already revealed?");
if (D2._visible == false) { // if partnercard (pair) is revealed
aufgedeckt = 0;
trace (" Card was already revealed, var 'aufgedeckt' is set to 0");
}
else { //if 1. Click was not the partnercard: wait and then turn the cards
//Timer
trace ("Timer for waiting: wait 3 seconds");
x = getTimer()/1000;
y = x+3;
while ((getTimer()/1000) < y){
trace ("Timerstart:" +x +"Timer plus 3 seconds" +y);
setProperty("A2", _visible, false); // Karte aufdecken
}
trace ("Timer finished, now turn cards again");
trace ("turn this card");
setProperty("A2", _visible, true);
trace ("now turn the card that was revealed first");
trace (" What is in k? " + k);
setProperty ("k", _visible, true);
aufgedeckt = 0;
trace ("cards are turned and 'aufgedeckt' was set back to 0");
}
}
}
}
[Edited by MoniH on 05-25-2002 at 05:28 AM]
._visible Property True...only For Several Seconds?
Hi everyone,
I'm wondering if there is a way to make a movie clip only visible for several seconds. Instead of saying
Code:
this._visible = true;
Is there a way that "true" could be replaced with the amount of seconds somehow?
Thanks for any advice here.
Brian
_visible Property Resets After Scene Redraws
Hi,
I have a button on a scene. I make it invisible onrelease and goto a different scene. When I come back it is visible again.
What can I do besides not leave the current scene?
Does Setting _visible To 0 Disable Code?
Hi there, a quick question: does code driving a movie clip stop when it's _visible property is set to 0. So If I had code spinning a movie clip (using the _rotate property) and at some point the visibility of the movie clip is set to 0, is the code that's spinning it disabled or does it continue to spin the MC but you just can't see it?
Cheers, K.Rice
Setting All Buttons In A Movie To _visible=0
Hi, I have a movie which is a map and every country have a button attached to it. I want to set all the buttons at the opening of the movie to ._visible = 0;
And then only activate the one present in an XML file.
I have the XML parsing file sorted now, but was wondering if there is a way to collect all button or all mc instance name (as all buttons are inside their own mc)
Thanks.
Having Problems With An If Statement And Setting _visible [renamed]
I cant figure out why this dosent work.
Im trying to get a movieclip to disapear if a variable loaded from a text file is yes.
in the txt file
&fp1=no&
if (fp1 == "no") {
setProperty("fp", _visible, false);
} else {
setProperty("fp", _visible, true);
}
The Movieclip instance is fp.
The Variable is fp1
Do i need a instance name??????
I cant figure out what im missing.
Thanks
Having Problems With An If Statement And Setting _visible [renamed]
I cant figure out why this dosent work.
Im trying to get a movieclip to disapear if a variable loaded from a text file is yes.
in the txt file
&fp1=no&
if (fp1 == "no") {
setProperty("fp", _visible, false);
} else {
setProperty("fp", _visible, true);
}
The Movieclip instance is fp.
The Variable is fp1
Do i need a instance name??????
I cant figure out what im missing.
Thanks
Property Setting
No choice but to post this method I have created to ask for your help.
Problem is that I am not able to see the value of the container_mc.dataLoaded property from inside of the MCLiListener.onLoadInit = function(param_mc:MovieClip) {...
In this function, I am looking for param_mc.dataLoaded property but it is always coming up as undefined.
Please just do a search on the dataLoaded property below to see where it is defined and where I am trying to access it from within the onLoadInit function and tell me what is the memory path I should be using to get at the property.
Any help is appreciated.
Attach Code
/*
* Create a new clip that will contain the external file loaded
*/
static function getExternalFile( param_targetedMC:MovieClip, param_filePath:String, param_progressBarContainer:MovieClip ){
trace('******************************************
UTIL.getExternalFile()');
/*
Create a variable that points to the location of the newly create
empty movie clip where the external file shall be loaded into
*/
if(param_targetedMC == null ){
trace('> > issue > UTIL.getExternalFile(): param_targetedMC: ' + param_targetedMC);
} // if
// This is only used for offsetting the images to see that they are all loading on the stage
if(_global.mcCounter == null){
_global.mcCounter = 0;
} // if
if(_global.xPosition == null){
_global.xPosition = 0;
} // if
if(_global.yRow == null){
_global.yRow = 0;
} // if
_global.mcCounter++;
if(_global.mcCounter % 5 == 0){
_global.xPosition = (_global.xPosition + 200);
_global.yRow = 0;
_global.mcCounter = 0;
}
_global.yRow = (_global.mcCounter * 25);
// Swap the level for the new movie clip so the progress bar stays on top
param_targetedMC.swapDepths(param_progressBarContainer);
// The event loader that will listen for events
var MCLiListener:Object = new Object();
var MCLi:MovieClipLoader = new MovieClipLoader();
MCLi.addListener(MCLiListener);
/**
* While the external file is loading
*/
MCLiListener.onLoadProgress = function(param_target, param_bytesLoaded, param_bytesTotal) {
myProgBar.label = "....ELijah Marshall....";
myProgBar._visible = true;
myProgBar.setProgress(param_bytesLoaded, param_bytesTotal);
if( myProgBar.percentComplete % 100 == 0 ){
trace( ' > UTIL.getExternalFile().onLoadProgress(): target ' + myProgBar +
': % completed ' + myProgBar.percentComplete );
} // if
} // onLoadProgress
/**
* After the external file has loaded
*/
MCLiListener.onLoadComplete = function(param_mc:MovieClip) {
trace( ' > UTIL.getExternalFile().onLoadComplete(): ' + param_mc + ' ' + param_mc.getDepth() +
', loaded: ' + param_mc.dataLoaded );
// This is only used for offsetting the images to see that they are all loading on the stage
if(_global.mcCounter == null){
_global.mcCounter = 0;
}
trace('_global.mcCounter [' + _global.mcCounter + ' ]' );
_global.mcCounter = (_global.mcCounter + 1);
param_mc._x = ( Stage.width ) * (-1);
param_mc._y = ( 0 );
} // onLoadComplete
// After the external file has been initialized in Flash
MCLiListener.onLoadInit = function(param_mc:MovieClip) {
trace('FINISHED . . UTIL.getExternalFile().onLoadInit():' +
'
> > myProgBar:' + myProgBar + ', ' +
'
> > MC: ' + param_mc +
'
> > Loaded: ' + param_mc.dataLoaded +
'
> > Depth: ' + param_mc.getDepth());
myProgBar._visible = false;
param_mc._visible = false;
param_mc.dataLoaded = true;
} // onLoadInit
MCLiListener.onLoadError = function(param_mc:MovieClip, e:String) {
trace( ' > UTIL.getExternalFile().onLoadError(): ' + param_mc);
param_mc.dataLoaded = false;
switch (e) {
case 'URLNotFound':
trace ("UTIL.onLoadError():1: file not found: " + param_mc + ' ' + param_mc.dataLoaded);
break;
case 'LoadNeverCompleted':
trace ("UTIL.onLoadError():2: loading interrupted" + param_mc + ' ' + param_mc.dataLoaded);
break;
default:
trace ("UTIL.onLoadError():3: file not loaded for unknown reason" + param_mc + ' ' + param_mc.dataLoaded);
}
};
// Create A unique id
var uid = "progBar" + Math.round((new Date().getMilliseconds() * Math.random(1,300) ));
// Create and initialize the progress bar into the targeted movie clip that shall hold all progress bar instances
var myProgBar:ProgressBar = param_progressBarContainer.createClassObject(ProgressBar, uid, param_progressBarContainer.getNextHighestDepth(),{label:(uid)});
myProgBar._x = _global.xPosition;
myProgBar._y = _global.yRow;
myProgBar.mode = "manual";
// Set local level var reference to the created movie clip in the targeted movie clip
var container_mc:MovieClip = param_targetedMC.createEmptyMovieClip("externalFile", param_targetedMC.getNextHighestDepth() );
container_mc.dataLoaded = false;
container_mc._x = 0;
container_mc._y = 0;
// Call to load the image
trace('START . . UTIL.getExternalfile():
> > uid: ' + uid +
'
> > url:' + param_filePath + ', ' +
'
> > MC: ' + container_mc +
'
> > Loaded: ' + container_mc.dataLoaded +
'
> > Depth: ' + container_mc.getDepth());
MCLi.loadClip(param_filePath, container_mc);
} // getExternalFile
} // class
Setting Property Problem
is there anyway to set property and let the object scale like animation instead of just suddently change the scale size?like i want it to be motion tweening
here is how i did
on (rollOver) {
setProperty (_parent.test, _xscale, "200");
setProperty (_root.test, _yscale, "200");
}
on (rollOut) {
setProperty (_parent.test, _xscale, "100");
setProperty (_parent.test, _yscale, "100");
}
the object just change the size when rollover
with out any motion how do make motion? by just setting property
or i have to do it a movieclip?
Setting Property In Javascript
I have a scene with a movieclip in it called theMovie and on the movieClip is a checkmark called check5 and what I am trying to do is make this come up semitransparent from javascript what I don't know is the syntax to get to this instance in a movieClip inside a scene this is my best try
theMovie.TSetProperty ("/scene1.theMovie.check5", 6, "50");
Can anyone tell me the correct syntax or if its even possible to do it this way.
Thanks Larry
PS unfortunatly this needs to work in netscape 4 and flash 4
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?
Setting Property Of Duplicated MC
function clouds() {
set(c, c++);
if (c<=rcloud) {
duplicateMovieClip("cloud", "cloud"+c, c);
setProperty("cloud"+c, _x, Random(400));
setProperty("cloud"+c, _y, Random(400));
} else if (c=rcloud) {
setProperty("cloud"+c, _x, getProperty("cloud"+c, _x)+ windx);
setProperty("cloud"+c, _y, getProperty("cloud"+c, _y)+windy);
}
}
------------------------------
i've got this code generating a random number of clouds and controlling them depending on windx windy but for some reason im only able to get the original 'cloud' to move.
i've got
------------------------------
onClipEvent (enterFrame) {
_root.clouds();
}
------------------------------
attached to the cloud mc, i've tried putting it inside the movie clip, but the same thing happens
Setting Property Of MC With Variable In Name
In one part of my AS I had an attachMovie. For part of the new instance name, I used a variable, like "clipname"+var. But how would I set a property of all instances with that name? I figured it would be something like:
_root.clipname+"var"._x=random()*100;
but that doesn't seem to work. Anyone know how to do what I'm trying to do? Thanks
Setting ScrolLRect Y Property
Hey everyone
I have this code:
Code:
private function moveScrollObject(e:MouseEvent):void
{
var moveNum:Number = 50;
_scrollObject.scrollRect.y += moveNum;
trace(_scrollObject.scrollRect.y); // traces 0 all the time
}
I can't see what my problem is. Even though I plus the scrollRect y property with 50, it keeps tracing 0?
Does "_visible" Property Really Invisible?
A simple Question!
I have a movieClip with a lot of tweens... When I set the "_visible" property to FALSE, does my movieClip still running for my CPU??? Does my CPU still calculate the tweens of my Mc???
Thank's for lightning me???
???
Problem With Setting .scroll Property
Hello, all.
Question: at the moment, this is how I am appending to a dynamic text box:
_root.textbox += "Some text...";
This seems quick and easy to me and works well besides. BUT does anyone know if this could in someway be affecting the way Flash sets the .scroll property?
Basically, all my attempts to get the text box to scroll "automatically" - i.e., follow the last new text appended to the text box - have failed.
Any ideas?
Regards,
: ar :
Setting Movie Property Of Level 1
Hi. I have an external swf that I want to load upon a button press into the center of my screen.
I used loadmovie and it loads into the top left corner on level1. What do I do now to move it to the center of the screen. I tried setproperty, that didnt work.
I can make it change in the debugger but then I dont know how to save the change.
Thanks
Debbie
Setting A Property To Multiple Instances
If you are setting the same property to multiple intances at the same time do you have to write out that same line of code over and over or is there some way to combine them all into one line? For example: if you have instances 01, 02, 03 and you have a button that says
on (release){
setProperty("01", _alpha, "0");
setProperty("02", _alpha, "0");
setProperty("03", _alpha, "0");
}
How can you condense this to one line of code?
Correct Syntax For Property Setting?
Hi,
Im trying to get the correct syntax for this...,
Could anyone help....deadline looms ahead for me.
Basically a bubble mc called bbl_1 on the root timeline gotta be duplicated in random _x positions while the _y coordinate stays the same. It duplicates allright but, no random positioning.
The code:
onClipEvent (mouseDown) {
_root.main.bbl_1.duplicateMovieClip("bbl_"+"x", x);
_root.main["bbl_"+x]._x=random(400);
x++;
}
HELP please!
Correct Syntax For Property Setting?
Hi,
Im trying to get the correct syntax for this...,
Could anyone help....deadline looms ahead for me.
Basically a bubble mc called bbl_1 on the root timeline gotta be duplicated in random _x positions while the _y coordinate stays the same. It duplicates allright but, no random positioning.
The code:
onClipEvent (mouseDown) {
_root.main.bbl_1.duplicateMovieClip("bbl_"+"x", x);
_root.main["bbl_"+x]._x=random(400);
x++;
}
HELP please!
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
Attaching A Component And Setting A Property
I'm using attachMovie() to add a movieclip, made up from simple components, to the stage (a FlashMX UI Component)
When I attach the component, I find that I can't set any properties or run any component functions in the same frame!
To get around this, I am creating an clip.onEnterFrame script and then deleting it when a property is set! Silliness!
ActionScript Code:
this.attachMovie("radio button group", "group", this.getNextHighestDepth(), {_x:100, _y:100});
//
this.onEnterFrame = function() {
if (group.button1.getLabel() == "" || group.button1.getLabel() == undefined) {
group.button1.setLabel("hello!");
group.button2.setLabel("there!");
group.button3.setLabel("world!");
} else {
delete this.onEnterFrame;
}
trace(group.button1.getLabel());
};
this seems to be the only way I can find to set any properties for my components! This is going to get really annoying (not to mention it just seems very bad form!).
Can anyone give me some ideas on how to attach and then set property in one function call?
I guess I mioght be able to do it by playing with the attachMovie("xxx", "xxx", 1, {set properties here}); but I reckon that might not work either.
Global Image Property Setting?
I have a series of images that were exported from a 3D modeling program that I am animating. In the Bitmap Properties dialog box there is an option to "Allow smoothing". This gives a much better look to my png images when they are rotated, resized, etc. However, I have hundreds of these little images and I can't find a way to get around having to manually apply this to each image individually. Ug, does anyone have a way to do this? Thank you.
AS3 Setting List Component Property
I know this has got to be simple but I am having a difcult time trying to set the font and the size of the font on a List Component. Does anyone have an example or can point to a place where I can read up on this?
Thanks
Non-Script Way Of Setting Visible Property
Why hello there!
I am looking to set the "visible" property of a movie clip in the Flash CS3 designer, as opposed to using AS3.
In my movie, I set a movieclip to invisible in code immediately. However, I sometimes see the artefact of the image for a split-second on running the swf in my browser. I would therefore like to set the property in the designer.
I am guessing that there is not a way of doing it. Are there any suggestions?
I'm now considering setting the alpha value to 0 in designer, and then setting the alpha value to 1 in code when I need to be able to see the mc.
(I have posted in this forum as I did not receive any answers in the General forum)
Raffi.
Setting Property Of Duplicated Component?
hi there, ive got a radiobutton component on my stage named radio1.
I need to duplicate it and then change a few properties, but i cant seem to get the path/naming right. This is my code:
Code:
i=2;
radio1.duplicateMovieClip("radio"+i, radio1.getNextHighestDepth(), {_x:20, _y:20});
_root["radio"+i].setLabel("test");
i++
if i use a constant name instead of "radio"+i it works but the ["radio"+i] seems to be the problem, could someone help me with this? (using flash mx)
Setting Property Of Duplicated Component?
hi there, ive got a radiobutton component on my stage named radio1.
I need to duplicate it and then change a few properties, but i cant seem to get the path/naming right. This is my code:
Code:
i=2;
radio1.duplicateMovieClip("radio"+i, radio1.getNextHighestDepth(), {_x:20, _y:20});
_root["radio"+i].setLabel("test");
i++
if i use a constant name instead of "radio"+i it works but the ["radio"+i] seems to be the problem, could someone help me with this? (using flash mx)
Setting Property In A Child Clip
via "Attachmovie"
my script has created these 3 levels ClipA.ClipB.ClipC
Clip C has a dynamic text box
When the movie loads...
ClipA creates multiple ClipB's and then assignes each with a different color
myColor = new Color(boxname); //boxname = new instance name
myColor.setRGB(0xAB12B8);
When the mouse hovers over a ClipB it attaches a ClipC which automatically becomes the same color as it's parent, which is good, except the Text in ClipC becomes the same color and therefore invisible.
I've tried using multiple methods, and MANY different places to drop the scipt in order to change text in ClipC
It seems once a new color has been invoked in ClipB, ClipC not only takes it but it can no longer be separated.???
By the by If I do not change the color of ClipB in the script, I can change ClipC;s colors
Is it a lost cause? Need I do this manually?
thx in advance
Ghandigu
Problems Setting The _alpha Property
Hello all, I had no luck on other forums with this...you're my only hope!
I have a button symbol and a movieclip symbol called links_desc (which
displays text) ...I have been trying to configure them as follows:
when mouse passes over the button, the alpha property (initially set to 0) for the text movie clip must be set to 100 (opaque)
I just entered the following code in my actionscript window for the button
but nothing happens...
on(dragOver){
links_desc._alpha = 0;
}
PS : both symbols have been exported for actionscript.
Any help really appreciated...
Setting Property Of An Object In Another Class
Hello,
I have a little problem of understanding on how to set properties of an object that is in another class. The firstclass draws a circle and set's it's alpha to a random number.
from the secondclass i call the public function in the fristclass which sets a new random alpha. i can trace the call of the function but the alpha is still the same.
can me anyone explain what i do wrong?
Code:
package {
import flash.display.Sprite;
public class FirstClass extends Sprite{
private var _cont:Sprite;
public function FirstClass() {
_cont = new Sprite();
_cont.graphics.beginFill(0xFF0000, 1);
_cont.graphics.drawCircle(30, 30, 10);
_cont.graphics.endFill();
addChild(_cont);
setAlpha();
}
public function setAlpha():void {
trace(_cont);
_cont.alpha = Math.random() * 1;
}
}
}
and the second class:
Code:
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
import FirstClass;
public class secondClass extends Sprite{
private var _btn:Sprite;
private var _first:FirstClass;
public function secondClass() {
_first = new FirstClass();
_btn = new Sprite();
_btn.graphics.beginFill(0x00FF00, 1);
_btn.graphics.drawCircle(30, 80, 10);
_btn.graphics.endFill();
_btn.addEventListener(MouseEvent.CLICK, onClick);
addChild(_btn);
}
public function onClick(e:MouseEvent):void {
_first.setAlpha();
}
}
}
XML Loading And Property Setting Issue
I am trying to bring in an XML file that gives several properties of a photo gallery item. Here is my code.
Code:
var galleryList:XML = new XML();
galleryList.ignoreWhite = true;
galleryList.onLoad = function() {
var items:Array = this.firstChild.childNodes;
var gItems:Array = new Array();
for(i=0;i<items.length;i++) {
gItems[i].itemTitle = items[i].attributes.title;
gItems[i].itemSize = items[i].attributes.size;
gItems[i].itemYear = items[i].attributes.year;
gItems[i].formatdesc = items[i].attributes.formatdesc;
gItems[i].availability = items[i].attributes.availability;
gItems[i].image = items[i].attributes.image;
// Trace Call will Result in undefined, why?
trace(gItems[i].itemTitle);
}
}
I think that my problem is that I don't have a clear understanding of the interaction between arrays, objects, and properties. However, why doesn't the above code work for setting the gItems properties?
Thanks in advance.
Setting Button Goto Property In Actionscript
I have an XML file used in an example from ultrashock.com.
this is the code:
<menu title="Sections">
<button name="Ultrashock Forums">
<link>http://forums.ultrashock.com/</link>
</button>
<button name="Ultrashock Links">
<link>http://www.ultrashock.com/links</link>
</button>
</menu>
My problem is this. I want the buttons to link to another frame, not URL. How would I do this?
John Moritz
[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
Setting Alpha Property Halts Animation
I have a strange problem. I have an mc tweening from left to right. 2 keyframes, very simple, but when I try to set the alpha of it it halts. Is this a bug in Flash?
i attached the fla
Setting A Movieclip's _visibility Property To False
Is it not possible to set a movieclip into which a swf was loaded dynamichally to false and make in invisible?
I spent the last three hours trying to set a bunch of movie clips invisible into which I loaded SWfs and it won't work. I am going cocoo here.
|