ActionScript 1/2 :: Set An Undefined Loaded Variable's Alpha To 0?
Jul 21, 2010
I'm trying creating a flash navigation bar that can be edited via a simple text file. I'm able to load my different variables properly but i also want to give the user the ability to remove links. I can simply leave the variable from the text file blank and and have the text in the swf disappear but i also want to be able to set the alpha of the movieclip behind the text to zero when the variable is left blank. Alternatively, even if the user could simply set the variable to the string "Blank" and both the alpha of the dynamic text and movieclip would change to zero that would be functional as well. Here is the code i have so far.
NavLoadVar = new LoadVars();
NavLoadVar.load("navigation.txt");
NavLoadVar.onLoad = function() {
[code]......
View 7 Replies
Similar Posts:
Jun 23, 2009
One movie, named Gallery_1, with hotpots via which external swfs are loaded into a container mc of the main timeline of the Gallery_1 movie,
Via another button function the Gallery_1.swf is loaded into a container mc on the timeline of the main swf, which works alright as well, but when one then clicks the hotspots of the Gallery_1.swf one gets following error message:
ReferenceError: Error #1065: Variable GallerySite not defined.
at HotSpot1/PictureLoad()
at HotSpot1/PictureCall()
[code]....
The traces in the eventHandler function work alright.I wildly imported all relevant classes I could think of, e.g. the GallerySite class to the WebSite class and vice versa, and tried various variable definitions, but am at a loss by now as to where to define the GallerySite variable.
View 3 Replies
Jan 13, 2004
we have this variable from the internet, val(0), in a dynamic text field we can see a digit from this variable. but when we use this variable in actionscript and test it with trace, the variable shows as undefined.how can we make this work without it coming up as undefined??
View 12 Replies
Sep 1, 2011
I have loaded a model using the 3DS parser that is already linked to a material and loads fine. I would like to make this model semi-transparent part of the time but not all of the time. I would like to just set alpha = .5 but when I target the materal that is not an option.
Here is the code and using:
var slingPar:Max3DSParser = new Max3DSParser();
var slingLoader:Loader3D = new Loader3D();
sling = new ObjectContainer3D();
[Code]...
View 1 Replies
Sep 12, 2008
[Code]...
This code isnt working to fade in my loaded images. am i missing something?
View 4 Replies
Jun 1, 2009
When I load a PNG image onto my stage using AS3, Flash ignores its Alpha channel???
View 7 Replies
Sep 18, 2009
It has been years since I have used flash so I am probably a beginner again. I have just got CS3 but most of what I remember I think is action script 1.I have a website that I want to make the images load from external into swf file. I want to then control the alpha with the rollover. I got so far but... alpha works only if jpg is inside. when I have it outside it just flashes on and off on load.I need to make the my_mc to load from outside then fade in. After which I have the rollover fade in/out code below...
Button.prototype.fadeIn = MovieClip.prototype.fadeIn = function () {
this.onEnterFrame = function () {
if (this._alpha<100) { [code].....
View 12 Replies
Jan 4, 2009
i will like to create an alpha in effect when i load my external jpg, and alpha out when i close it..on this?below are my script
PHP Code:
this.createEmptyMovieClip("container_mc",this.getNextHighestDepth());
var mclListener:Object = new Object();
[code].....
View 5 Replies
Apr 14, 2010
I want to fade in a background with a alpha tween after it's loaded in by an UILoader. Everything seems to be working great when I do a Test Movie (in Flash) or view it in IE. However, I encounter a problem when viewing in Firefox. Somehow the alpha does'nt come up to 1(100%). Sometimes my background image is barely visable and sometimes it's at ~90%. It seems to be completely random.
Quote:
//load random background (1 to 10)
var randomNumber:Number=Math.ceil(Math.random()*10);
trace(randomNumber);
[code]....
I've tried increasing the final value (Regular.easeOut,0,1,2,true) and this will change something but doesn't solve the problem. I've also tried instead of fading in the background to fade out a overlaying vectorshape, but same result.Is it possible it has something to do with other script/my background img size/??.
View 2 Replies
Sep 16, 2004
the problems is that the alpha fade that I created, does not reset when a new images is loaded.Here is the script.
start of script
onClipEvent (load) {
photos = new Array("images/mel_1.jpg", "images/mel_2.jpg", "images/mel_3.jpg", "images/mel_4.jpg", "images/mel_5.jpg");[code].....
View 1 Replies
Aug 8, 2004
I am loading two images dynamically I then RESIZE them according to the Stage.width I make a crossfading effect between them. Doesn't work. I get rid of the resizing, works. I need the resizing. I must be missing something, but is there an issue with changing the alpha of resized loaded images?
View 4 Replies
Sep 16, 2004
I am learning actionscript and having a tough time of it... Here is the script I am having problems with...the problems is that the alpha fade that I created, does not reset when a new images is loaded. Here is the script,
[Code]....
View 1 Replies
Jan 20, 2011
I have a flash file to start calling this function:
Code:
public function ConnectPHP():void
{
[code]......
View 1 Replies
Aug 24, 2004
I have a situation where I am reading a wide variety of data from an XML file, and if a particular bit of data is not there, I simply want to hide a button. Before I go further, all my XML data in and out works fine, that's not a problem.
If I have this node in my XML:
Code:
<name1></name1>
read it in, assign to a variable and check that variable in the debugger I get this:
Code:
Variable _level0.assocImageName1 = undefined
This is fine. It has no value, so it's undefined.
Now, if I do the most simple of If statements this check just doesn't work. I've tried something like:
Code:
if (_root.assocImageName1 == undefined) {
_root.linked._visible = false;
} else {
break;
}
Now the odd thing, is that with quotes ("undefined") or without, this doesn't work reliably. It seems to just run right past the If and perform the hiding of the button regardless.
Also, if I put something in the XML like so:
Code:
<name1>data</name1>
I get this in the debugger:
Code:
Variable _level0.assocImageName1 = "data"
And check for that like this it doesn't work:
Code:
if (_root.assocImageName1 == "data") {
But oddly enough, if I take the quotes off it does work. What's going on there? I thought you also had to always use quotes when testing a string?
View 8 Replies
Jan 10, 2011
On my stage I have 2 empty MC holders, each of them in a seperate layer. In the bottom mc holder called 'map' a map image is loaded from my XML file using MovieClipLoader. This works fine.
What I want to achieve is that on top of the map, 24 PNG images with Alpha channels are loaded into seperate MovieClips attached in MC holder 'projects'. For every PNG image a MovieClip from my library is attached in order to determine the hit shape of the PNG image. This works fine too!
However all of sudden my first 2 MovieClips with the PNG images in it dissapear as soon as all of the images are loaded. But when I roll over on of the other MovieClips they suddenly show up again and when rolling out they dissapear again!
It has nothing to do with my XML file nor my PNG images, because when I move my first 2 XML nodes (the ones that are dissapearing) to the end, 2 different MovieClips dissapear! It worked absolutely fine before but since I added 2 more MovieClips the problems started. It almost looks like I can't load more then 22 PNG images, but that would be extremely weird.
I tried creating the first half of the MovieClips in one MovieClip and the second half in a different MovieClip, but that doesn't change anything. But when I create the first half of the MovieClips in the _root and the second half in a MovieClip, only 1 MovieClip dissapears instead of 2!
I really don't get it. I'm totally confused and lost since I don't know what else I could try.
Here's my AS2 code:
Actionscript Code:
var pimage = new Array();var pmc = new Array();var ptitle = new Array();var phit = new Array();var ptooltip = new Array();var pmenu = new Array();var ptotal:Number;var phalf:Number;function fillProjects() { nodepath =
[Code]....
View 21 Replies
Feb 25, 2010
In firefox everything works just fine, but in IE it doesn't. I tried several things but just cant get it to work. In the beginning I also had the error; swfobject is undefined - saying I had something wrong with the javascript thing. I think I fixed that now, but still the movie is not getting loaded.If I go to the page and push the right mouse button (middle of the page) it say: movie not loaded.
View 8 Replies
Feb 9, 2010
I have come across a problem where an SWF that I've developed has to be loaded by another SWF that pans and zooms the inner swf. I have created these two MovieClips to demonstrate my problem, I've called them Inner and Outer. These are the document classes for them:
ActionScript Code:
package inner
{
import flash.display.MovieClip;
[Code].....
I dropped a button component into the stage of the Inner.fla file and named it btnOne in the properties window. The Inner.fla runs as expected on its own. When I include code in the OuterClip class to instantiate an InnerClass variable it complains thus:
1120: Access of undefined property btnOne.
So I can see that there is an issue here to do with linkage ?? I've tried quite a few different settings but feel like I am just guessing and have been struggling with it for a while. In my final scenario the outer file will have timeline and actionscript frames with no document class. Is it ok to mix these two methods of scripting?
View 4 Replies
Sep 1, 2010
I've written a class in AS2 that extends the Object class It's an abstract class for debugging purposes. The class is defined in an external .as file. The problem is that in an .fla file, after I assigned a variable to a new instance of the class, and I trace that variable, it comes back as 'undefined' The reason it's a problem is that I want to call methods on the instance of the Debug objectIn the .fla, I have the following code:
//import any external classes
import Debug;
//Create general application properties
[code]......
View 3 Replies
Jan 9, 2008
How would I make an if statement to check if something is undefined
when I trace the variable, there are instances where it is undefined...I would like something to happen if the value of this variable is undefined...
I tried using null but that didn't seem to work
if(index == null)
{
...blah
}
View 4 Replies
Nov 2, 2009
I have this code:
ActionScript Code:
onLoad = function()
{
trace(_root.sliderPosition)
[Code].....
It monitors the sliders position, however, it doesnt track it. It only tracks it if i change it from onLoad to onEnterFrame.
View 3 Replies
Jul 16, 2004
here is the set up. I'm working with three files. Main.swf which contains navigation.swf in a blankmc, empty mc called mcContent where navigation sleclected materials are loaded.
In the navigation.fla here is the code
[AS]trace("now defining global");
_global.loadFile_str = strPicName;
[code]......
View 5 Replies
Nov 6, 2003
How can I test a undefined variablewith an if statement.all a this did not work and I don't want to define a value for this variable.name of the variable x.
if ((x == "") || (x == " ") (x == Nan))
{
trace("here");
[code].....
View 1 Replies
Jan 13, 2004
we have this variable from the internet, val(0), in a dynamic text field we can see a digit from this variable. but when we use this variable in actionscript and test it with trace, the variable shows as undefined.
how can we make this work without it coming up as undefined??
View 12 Replies
Dec 21, 2009
Working in AS2, using CS3 Flash Pro I've simplified this to just the one little thing I'm trying to do.
countervariables.txt has this text in it:
[Code]...
The trace shows itemsPerMili as 'NAN' and totalForYear as 'undefined'. I know itemsPerMili yields 'Not A Number' because totalForYear comes up undefined, but oddly, the loaded variable does show up correctly in a dynamic text field assigned to the variable. I don't understand why it should show up in the dynamic text field correctly when it won't trace.
I want to see the number "3.80517503" in my trace for itemsPerMili.
View 3 Replies
May 14, 2009
i'm using a php file to send some data fromm db to flash via http_build_query(). The code here looks like this:
Code:
$user = mysql_query ("SELECT * FROM users ", $conn);
if (!$user){
die ("could not execute query: " . mysql_error());[code]...........
View 1 Replies
Apr 5, 2010
I have borrowed the code from Tiago's web blog. [URL]. I have noticed a few odd things, and have tried to send off to Tiago himself but have not received any response. The first thing I noticed is the code seems to call for the .php file before it can load, so at times it will generate a "undefined" for both the quote and author. The second thing is, which may tie into the first, there seems to be the occasion where the code doesn't load the php file at all. The author and quote will be blank for a duration. And the third question I have is how do I get the text to fade out again after the fade in after an interval.
Code:
import caurina.transitions.Tweener;
var quote:Array = new Array();
var author:Array = new Array();
var totalQuotes:Number;
var rotateTimer:Timer = new Timer(10000, 100); //rotates the quote every 2 seconds for 100 times
[Code] .....
View 4 Replies
Aug 24, 2010
I have some xml and I am trying to filter it using e4x. My e4x statement looks like this:
model.config.source.fees..fee.(@min<amount).@amount
My xml looks liks this:
<flex><fees>
<fee type="credit" min="0.00" max="200.00" amount="6.00"/>
<fee type="credit" min="200.01" max="370.00" amount="10.00"/>
</fees></flex>
When the e4x statement is run, I get an error message:
Error #1065: Variable @min is not defined.
But if I change my statement to model.config.source.fees..fee.@min it will return an xmllist of all the min attribute values, so min is defined, at least in that statement. Why doesnt the original statement work?
View 1 Replies
Dec 14, 2009
why I am getting undefined every time I trace the following:
Code:
c = currentCount; //current is 1.
trace (eval("mcSlide" + c)._x);
trace (this["mcSlide" + c]._x);
I would think these would output, if I incrementally go through 3 slides, the correct _x for each slide e.g. mcSlide1._x , mcSlide2._x
View 1 Replies
May 13, 2011
without having to make my movieclip (from a swc) a global variableThe code works perfectly, but i'm guessing it's redflagging it because it's not a waterproof method.
View 4 Replies
Nov 6, 2003
How can I test a undefined variablewith an if statement.
all a this did not work and I don't want to define a value for this variable.
name of the variable x.
if ((x == "") || (x == " ") (x == Nan))
{
trace("here");
}
Someone could find me the correct if statemtn to check an undefined variable on action script 1, mx 6..develloped with MX2004Pro.
View 1 Replies