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




Simple Variable Issue



This is a simple task, but it is not working for me, thus I am forced to inquire...

-On the main timeline I can place an instance of a movie and name that instance "square"
-On the first frame of the timeline in square I can declare a variable named "cat" and assign it the value of "13"

var cat = 13;

-On the first frame of the main timeline (with the square movie instance present) I can place this code...

trace(square.cat);

And yet it will still output "undefined"

What am I doing wrong?

Thank you for your time. Best Wishes to you all,
Eric



FlashKit > Flash Help > Flash ActionScript
Posted on: 10-07-2005, 04:36 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

[FMX] Simple ? Variable Issue
I have a dropdown menu in my main movie with buttons like so...

onClipEvent (mouseUp) {
_root.Flabel = 25;
}

After clicking the button it sets the variable and an external movie is loaded.

Within the external movie the variable is called here

_root.contents.gotoAndStop(_root.FLabel);

This all works fine and dandy but I want to have several buttons go to different frames. Right now if I add this to another button:

ie onClipEvent (mouseUp) {
_root.Flabel = 17;
}

The variable doesn't get replaced. It just stays set to whatever the first buttons variable is set to. Shouldn't the mouseUp automatically change the variable when it's clicked. Not sure why this doesn't work.

[FMX] Simple ? Variable Issue
I have a dropdown menu in my main movie with buttons like so...

onClipEvent (mouseUp) {
_root.Flabel = 25;
}

After clicking the button it sets the variable and an external movie is loaded.

Within the external movie the variable is called here

_root.contents.gotoAndStop(_root.FLabel);

This all works fine and dandy but I want to have several buttons go to different frames. Right now if I add this to another button:

ie onClipEvent (mouseUp) {
_root.Flabel = 17;
}

The variable doesn't get replaced. It just stays set to whatever the first buttons variable is set to. Shouldn't the mouseUp automatically change the variable when it's clicked. Not sure why this doesn't work.

Variable Take On Content Of A Root Variable And Not Its Path - Simple Please Help
Hi there ok my brain has died and fallen off somewhere , what i am trying to do is this:


l=0

l++


_root.advert= "_root.var" + l ;

then i have a text box on stage , dynamic, etc var: _root.advert
, vars are stored in a text file , vars are called, var1, var2 etc , text box needs to display variable contents, but at the moment it just says "_root.var1" etc and not the content s of var1 this is very simple problem but my brains dead please help.

-arran

If Variable=variable Simple Problem
Ok i'm having this problem;i have tried a lot of times to try to find what is wrong but could not;it looks pretty simple though but i'm a newbie;

here is the situation:
I have 2 buttons:
-Next page
-Previous page

a dynamic text box where i load an external text;it is called "contents"(the var).

my "Previous page" button works fine while i'm having problem with my "next page" button.

I use loadVariablesNum("../texts/"+pagenum+".txt", 0);
So that when i press on
next page" button;the pagenum is incremented and it loads 1.txt , 2.txt ,etc...(where in each text; "contents" variable is loaded).

I also use a variable(lastpage) so that to stop the "next page" button to go further than the last page.

I load the lastpage variable value from an external text too.

here is the code the "next page" button:

on (release) {
if (pagenum=lastpage) {
break;
} else {
pagenum = pagenum+1;
loadVariablesNum("../texts/"+pagenum+".txt", 0);
}
}


The "next page" button doesn't stop when pagenum=lastpage.

Any idea why? thanks in advance

If Variable=variable Simple Problem
Ok i'm having this problem;i have tried a lot of times to try to find what is wrong but could not;it looks pretty simple though but i'm a newbie;

here is the situation:
I have 2 buttons:
-Next page
-Previous page

a dynamic text box where i load an external text;it is called "contents"(the var).

my "Previous page" button works fine while i'm having problem with my "next page" button.

I use loadVariablesNum("../texts/"+pagenum+".txt", 0);
So that when i press on
next page" button;the pagenum is incremented and it loads 1.txt , 2.txt ,etc...(where in each text; "contents" variable is loaded).

I also use a variable(lastpage) so that to stop the "next page" button to go further than the last page.

I load the lastpage variable value from an external text too.

here is the code the "next page" button:

on (release) {
if (pagenum=lastpage) {
break;
} else {
pagenum = pagenum+1;
loadVariablesNum("../texts/"+pagenum+".txt", 0);
}
}


The "next page" button doesn't stop when pagenum=lastpage.

Any idea why? thanks in advance

Variable Issue
Hello I have some code that I've written and it won't work. The code is in the actions for a button on the main stage. Hope you can help:

_global.current = 1;

on (release){
_global.clip = "clip" + _global.current;

with (_global.clip){
gotoAndStop(1);
}
}

The movie_clip I am trying to stop has an instance name of clip1. It does not go to and stop at frame 1, but I've tested the value of _global.clip in a text box and it says clip1. ????

Any thoughts would be greatly appreciated.
webpimp

Variable Issue
Hi!
Given:
2 movieclips that function as buttons: mc1 and mc2.
2 variables labelled var1 and var2.
1 dynamic text-field, var-name: bang

What I'm trying to do is making the text-field return "Mission accomplished!" as soon as both buttons have been released. The code I've been trying to work with so far:
code: _root.var1 = 0;
_root.var2 = 0;

_root.mc1.onRelease = function() {
_root.var1 = 1;
};
_root.mc2.onRelease = function() {
_root.var2 = 1;
};
if (_root.var1 == 1 && _root.var2 == 1) {
_root.bang = "Mission accomplished!";
}

That doesn't really do anything. Where did I go wrong?
Muchos Grazias,
me.

Variable Issue
Hey all,

Im new to Flash designing and im sure this is a very simple answer that i'll deserve a /slap for :P anywhoo here goes...

basicall I have a main menu on the left side of the screen and a sub-menu that slides out from underneath of the main menu when the mouse is on the left side of the screen and likewise slides back underneath when the mouse is on the right side of the screen *this works fine*.... Inside of that sub-menu are 42 different symbols on one layer spread out over 42 frames *1 symbol per frame*..each symbol is an exact replica of the original sub-menu except that the text is different for each one representing the pages of the website. Inside of the main-menu are the navigational buttons/links that will call up the appropriate pages inside of the sub-menu. in the root timeline on frame 1 I started a variable as follows....

pagenum = 0;

the buttons inside the main-menu have the following code attached to them..

on(release){
pagenum = 40; <<<//This should make the timeline inside of sub-menu
jump to 40
}

inside of the sub-menu on frame 1 is the following code....

stop();
onEnterFrame = function(){
if (pagenum == 1){
_root.sub_holder.sub_menu.gotoAndStop(1);
onEnterFrame = {};
} else if (pagenum == 2){
_root.sub_holder.sub_menu.gotoAndStop(2);
onEnterFrame = {};
}
^^^ there is more code than that *until gotoAndStop reaches 42 but ive cut it off so that its not a crit of text :P*

when I publish the movie and click on any of the links nothing happens, no text gets brough forward...am I referncing the variable wrong? am I changing the variable wrong? or is it impossible to use a variable from a timeline thats higher than the current timeline?

im bashing my head off my desk on this one so please help!

cheers,
Dahrken

Variable Issue
When I am loading from a text file it inputs the variable with quote marks around it.... how can I just get the number in the variable. for example

in my text file my variable is listed as &LDot=1

However when it loads the variables into flash the variable is as such

LDot = "1"

My Variable Issue
I have a problem with using a variable that I am loading from a txt file.. the variable is loading, I tested it with a trace command, however my if statement doesn't work right when i use my new variable totalTracks to subtract curTrackNum. However, when i hardcode totalTracks it works fine. I have posted my fla at www.clubouterlimits.com/solidbookings_music.fla

Thanks if you can help,
Patrick




I have some code that looks like:

myMusicLv = new LoadVars();
myMusicLv.load("vars/track_info.txt");

myMusicLv.onLoad = function (success) {
if (success) {
totalTracks = myMusicLv.totalTracks;
}else{
totalTracks = 1;
}
};



and later on some code looks like:

bgMusic = new Sound();
bgMusic.onSoundComplete = function(){

if (curTrackNum == (totalTracks - 1)){
curTrackNum= 0;
}else{
curTrackNum++;
}
playMusic();
};

Variable Issue
I'm having a little trouble with a presentation I'm working on.

I'm creating a presentation that will, depending on user inputs, change which frames are shown. To do this, I created a dynamic text box to load a text file, hoping to then pass whatever comes up there on to an if/else statement that would determine the appropriate action.

The text is loading into its dynamic text box just fine, but it doesn't appear to pass along to the if/else statement as even when "if" is true, it performs the "else" action.

Here is the code:

loadText = new LoadVars();
loadText.load("cambtn.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
cambtn.html = true;
cambtn.htmlText = this.text;
}
};

The above is on a frame with a dynamic text box with an instance name of "cambtn."

The variable name for this text box is "cambutn" (I changed it slightly as at one point I theorized that perhaps having them both named the same was screwing things up). Then on the frame that determines where the presentation goes next:

if (cambutn == "4") {
_root.gotoAndStop (4);}
else {
_root.gotoAndStop (5);}


"4" is, in fact, what's being loaded into cambtn, and yet the movie is still going to the root's 5th frame. Where did I go wrong?

PLEASE HELP - Very Simple Issue
I need to know how to make a button within a movie go to a frame in the parent scene.

More or less, I have 1 scene and there are 2 frames in that scene. I have a movie in scene 1, and within that movie there is a button. I need to know how to make that button clickthru to frame 2 of scene 1.

PLEASE HELP I'm really stuck on what is probably a simple solution.

Thanks,
Walt

Simple Issue
how does a function access a variable outside its class? because Flash 8 keeps throwing errors at me when I try to access a variable in my timeline from my .as class file?

boombanguk

Please Help With This Simple Issue
I have a simple problem but dont know how to solve after many searches...

I have 4 buttons, say Button A, Button B, Button X and Button Z.

I want to replace or swap Button X with Button Z when I click on Button A and Swap button Z with Button X with I click on Button B.

I dont want to use timeline. I want to use some kind of swap or replace function or any other method to do this.

Like:
On (release)
{
Button X = Button Z
}

Kindly, help, I will be really gratefull.

Thank you in advance.
Haider

Another Text Variable Issue
I'm loading text into variables in a MC in one movie, that is then being loaded into other movies.

I'm getting my text to show up where the variables are called in the original movie by using:
_parent.variable

as the text variable call.

But when I call that movie into another, the text no longer shows up.

why?

Loading Variable Issue
I have a movie loading a set of variables from a text file. When I preview the swf locally, everything works fine, yet when I put it online and test it, none of the variables load. Anyone out there have an idea why?

Variable From Movie To PHP Issue
Help.
I'm a complete PHP virgin, and this is my first email form in flash (I used to use perl in HTML).

I found a PHP form tutorial, and managed to get the thing working. But I also need to add in an extra feature which I am having problems with...

I created a "drop down" menu thing, which I am having huge problems applying variables to.

Any ideas?

I've uploaded the files in question to link below, so you know what I'm talking about:
http://www.londonsprout.com/email.zip

Help!

Variable Scope Issue
Hi all,
I'm having difficulties calling a variable outside of a function.
This is what i have:

Code:
//set var outside function
var totalHolderHeight:Number = 0;

//handle server response
this.getContacts_Result = function(result)
{
if(result)
{
// the code below needs attention, specifically in relation to session handling, global vars etc.
if (query_type == "detailed"){
title = result[0];
login_details = result[1];
}
company_details = result[2];
contact_user_details = result[3];

if (result['status'] == "null")
trace("EMPTY");
//if (contact_user_details['pm_user_id'].length == "")
//trace("EMPTY");

var styles = new TextField.StyleSheet();

styles.load("include/css/styles.css");
styles.onLoad = function(ok) {

if (ok) {
// display style names
this.getStyleNames();

} else {
trace("Error loading CSS file.");
}

page_title.styleSheet = styles;
page_title.text = "<p class='three'>" + title['admin_contacts_page'] + "</p>";
login_name.styleSheet = styles;
login_name.text = "<p class='login_txt'>Logged in as " + login_details['pm_full_name'] + "</p>";
company_detail_mc.company_name.styleSheet = styles;
company_detail_mc.company_name.text = "<p class='three'>" + company_details['pm_company_name'] + "</p>";

};

var totalHolderHeight = 0;

for (var j = 0; j<contact_user_details['pm_user_id'].length; j++) {

createEmptyMovieClip("holder", this.getNextHighestDepth());

contactDetails_mc = holder.attachMovie("dynamic_id", "newClip_mc"+j, j);

contactDetails_mc.user_id = contact_user_details['pm_user_id'][j]
contactDetails_mc._x = 0
contactDetails_mc._y = j*90

contactDetails_mc.full_name_txt.styleSheet = styles;
contactDetails_mc.full_name_txt.text = "<p class='three'>" + contact_user_details['pm_first_name'][j] + " " + contact_user_details['pm_last_name'][j] + "</p>";
contactDetails_mc.email_txt.styleSheet = styles;
contactDetails_mc.email_txt.text = "<p class='one'><a href='mailto:"+contact_user_details['pm_email'][j]+"'>"+contact_user_details['pm_email'][j]+"</a></p>";

totalHolderHeight += contactDetails_mc._height+14;

}
return totalHolderHeight;

} // end result
}

//Manage possible errors
this.getContacts_Error = function(status){

trace("Error")
}

_global.totalHolderHeight = this.getContacts_Result();
trace(totalHolderHeight);
When i trace(totalHolderHeight) i get "0". Anu ideas as to how i should be calling the function to give me the updated value?

Cheers

[F8] Variable Reference Issue
Ok here is the problem. I have code which stores a reference to the base object in a class for reference from code later. The problem is when I call my function (TestFunction) the first trace returns [object Object] like it should, but the second trace (inside the xml.onLoad function) returns undefined. I am sure this is a scope issue. If somone could shed some light on this for me that would be great. Thanks a lot in advance!


Code:
var m_base = null;

// DATA STORAGE
public static var m_makes : Array = new Array ();

// INITIALIZATION FUNCTIONS
function FWDataComponent(listenObject:Object)
{
m_base = this;
}

// DATA FUNCTIONS
public function TestFunction() : Void
{
trace(m_base);
var xml : XML = new XML ();
xml.ignoreWhite = true;

xml.onLoad = function ()
{
trace(m_base);
var nodes = this.firstChild.childNodes;
m_makes = new Array ();
for (var i = 0; i < nodes.length; i ++)
{
m_makes.push (nodes [i].firstChild.toString ());
}
}

xml.load (m_serverPath + "GetMakes");
}

[F8] Imported Variable Issue
I've imported a variable that is:

&myVar=0

However when I go to do stuff with it say:

myVar = myVar+1;

I get results as if it were a string.

trace(myVar)
Result:
01

So I tried this in my text file:
&myVar:Number=0;

But that resulted in "NaN" and "Undefined".

So I tried:

var myVar2:Number = myVar;

Which again resulted in "NaN", "Undefined".

So I'm at a loss as to how to import a variable that behaves like a number and not a string! Please help and thanks!

Function Variable Issue
I know this is silly, but I can't figure it out. I wrote a simple little function to flicker the opacity of a movieclip, but when I try and apply it to more than one clip at a time, it only works for the second clip. I think this is because the variables of the function get overwritten when the function is called for a second time. Here's the function:


Code:
function flicker(clip, limit, startAlpha, endAlpha, range) {
var listen = "listen_" + clip;
_root.createEmptyMovieClip(listen, 0);
trace(listen);

var flicker;
var i = 0;

_root[clip]._alpha = startAlpha;

_root[listen].onEnterFrame = function() {
if (i < limit) {
flicker = random(range);
_root[clip]._alpha = startAlpha + flicker;
i++;
} else {
_root[clip]._alpha = endAlpha;
delete this.onEnterFrame;
}
}
}

flicker("MC1", 1000, 0, 15, 60);
flicker("MC2", 100, 0, 15, 10);
In the example above, MC1 does not flicker, but MC2 does.

Variable Scope Issue?
I'm having what I think is a variable scope issue, but I'm not sure why.

In my class definition, I'm defining a number of variables, including on called "articleArray", like so:


Code:
public class ImageLoader extends Sprite {
// variables
var slideNum:Number = 0;
var imgLoader:Loader = new Loader();
var slideTimer:Timer = new Timer(5000); //runs every 5 seconds
var articleArray:Array;
var myImage:String;
And then in the constructor, I am populating that variable with an array that gets passed in to the constructor. At this point, I can access articleArray and all of its component parts.


Code:
public function ImageLoader(articleArray) {

articleArray = articleArray;
loadNextImage(slideNum);

}
However, the next step is for me to call loadNextImage. As I understand it, I should be able to freely access articleArray from within this function because the var is inititialized in the class definition, outside of any function (even the constructor). However, when I try to access it from inside the loadNextImage() function, it returns as null. Here is that function code:


Code:
public function loadNextImage(slideNum:Number) {
trace(articleArray); //this is what returns null
myImage = articleArray[slideNum].imageBig
imgLoader.load(new URLRequest(myImage));
addChild(imgLoader);
trace (imgLoader.name);
imgLoader.x = 0 ;
imgLoader.y = 0;
}

Variable Assignment Issue
Hi,

I am a newbie to Actionscript and the way it is going, I am not sure for how long I will remain in same state. As of now I am trying to modify a code sample I got on net for my need. In the process I am as well attempting to convert it from AS2 to AS3. I am appending my .as file below.

The text that it is printing is:
load func called
gridMovie width= 0 sx= 40
loaded image image1.jpg0 0

Ideally gridMovie width should be printed as 40 as I am assigning it the value of sx. Please suggest why is this happening.

And after that I receive plethora of errors:
ArgumentError: Error #2015: Invalid BitmapData.
at flash.display::BitmapData$iinit()
at ImageGrid/loadFunc()
at ImageGrid$iinit()
at portfolioas3_fla::MainTimeline/portfolioas3_fla::frame1()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at ImageGrid/enterFrameFunc()


I think these errors are being caused by aforementioned issue of width being assigned wrongly.

Please let me know what am I doing wrong. I am using Adobe Flash CS3 to build it.

Thanks,
Mukesh

Code:



package {

import flash.ui.Mouse;
import flash.display.*;
import flash.geom.Point;
import flash.net.URLRequest;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.IOErrorEvent;
import flash.geom.Matrix;

public class ImageGrid extends MovieClip {
var points:Array;
var range:Number = 80 // representative of how close mouse effects points
var accel:Number = .4 // elasticicty acceleration
var fric:Number = .55 // elasticicty friction
var gw:Number = 4 // grid width (points in grid)
var gh:Number = 4 // grid height

public function ImageGrid() {
//addEventListener(flash.events.Event.COMPLETE, loadFunc);
addEventListener(flash.events.Event.ENTER_FRAME, enterFrameFunc);
addEventListener(flash.events.MouseEvent.MOUSE_DOW N ,mouseDownFunc);
loadFunc();
}
public function loadFunc() {

var sx:Number = 40 // x spacing (distance between points)
var sy:Number = 40 // y spacing
var imgIndex:Number = 1;
var depth:Number = 0;
var movieIndex:Number = 0;

trace ("load func called");
// sections:
var sections:Array = ["cheese wheel","bird claw","movie show","cd polisher","g.i. snow","line lunge","street sign","love turtle","endless hole","grease stain"]


// function to draw line
MovieClip.prototype.DrawLine = function(p1,p2){
this.x = p1.x; this.scaleX = p2.x - p1.x;
this.y = p1.y; this.scaleY = p2.y - p1.y;
}

// Generate Points on the grid/attach buttons
points = new Array();
var currSection:Number = 0;

for (var x:Number=0; x<=gw; x++){
points[x] = []
for (var y:Number=0; y<=gh; y++){
// make point
points[x][y] = new PointNew(x*sx,y*sy)
points[x][y].target = new PointNew()

var gridMovie:MovieClip = new MovieClip();
gridMovie.name = "b" + ++movieIndex;
gridMovie.y = y*sy;
gridMovie.x = y*sx;
gridMovie.width = sx;
gridMovie.height = sy;
trace ("gridMovie width= " + gridMovie.width + " sx= " + sx);
var url:String = "image"+imgIndex+".jpg";
var loader:Loader = new Loader();
var request:URLRequest = new URLRequest(url);

loader.load(request);
//loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, loadImage);
loader.contentLoaderInfo.addEventListener(IOErrorE vent.IO_ERROR, ioErrorHandler);
trace("loaded image " + url + gridMovie.width + " " + gridMovie.height);
var bm:BitmapData = new BitmapData(gridMovie.width,gridMovie.height);
bm.draw(loader,new Matrix());
gridMovie.graphics.beginBitmapFill(bm);
gridMovie.graphics.endFill();
addChild(gridMovie);
imgIndex++;
}
}
//this["b"+gw*gh].section = "the end" // last section

var ls:Number = 2*gw*gh + gw + gh // number of lines
// Attach lines:
/*for (var i:Number=0; i<ls; i++){
this.attachMovie("line","l" + i, ++depth)
}*/
}

private function ioErrorHandler(event:IOErrorEvent):void {
trace("Unable to load image: " + event);
}
public function enterFrameFunc(event:Event){
var xdiff:Number = 0;
var ydiff:Number = 0;
var targetx:Number = 0;
var targety:Number = 0;
var d:Number = 0;
// Position points
for (var x:Number=0; x<=gw; x++){
for (var y:Number=0; y<=gh; y++){
var p:PointNew = points[x][y] // current point
xdiff = p.base_x - mouseX // x distance
ydiff = p.base_y - mouseY // y distance
d = Math.sqrt(xdiff*xdiff+ydiff*ydiff) // distance
if (d < range){ // if within range of effect from mouse
if (!d) d = .00001;
targetx = p.base_x-(xdiff-range*(xdiff/d))
targety = p.base_y-(ydiff-range*(ydiff/d))
}else{ // put at original position (base)
targetx = p.base_x
targety = p.base_y
}
// elastically move based on targets
p.xspeed = ((targetx-p.x)*accel+p.xspeed)*fric
p.yspeed = ((targety-p.y)*accel+p.yspeed)*fric
p.x += p.xspeed
p.y += p.yspeed
}
}

//Draw lines:
var currL:Number = 0
for (x=0; x<=gw; x++){
for (y=0; y<=gh; y++){
if (x) this["l"+currL++].DrawLine(points[x][y], points[x-1][y])
if (y) this["l"+currL++].DrawLine(points[x][y], points[x][y-1])
}
}

}

public function mouseDownFunc(event:Event){

/*for (i=0;i<points.length;i++){
for (j=0;j<points[0].length;j++){
trace("point["+i+"]["+j+"]: "+points[i][j].x+", "+points[i][j].y)
}
}
*/

}

}

}

import flash.geom.Point;
// Simple Point class:
class PointNew extends Point{
var base_x:Number;
var base_y:Number;
var xspeed:Number = 0;
var yspeed:Number = 0;
public var target:PointNew;

public function PointNew(x=0,y=0):void{
this.base_x = this.x = x;
this.base_y = this.y = y;
}
}

Variable Scope Issue
I have a load variables script that loads the variables a1-a15 from text files a1.txt-a15.txt. I have 16 layers that need access to these variables one layer is /game and the others are sublayers /game/board/one - /game/board/fifteen.

My problem is that before I send these variables to the layers, I need to run them through a function. normally I would run the function on each variable right after they are loaded but I need to average all the variables in the _root layer.

so now that everyone trying to help me is confused I will post the code....

================================================
================================================

This is the current working code sending the variables directly to the layers

================================================
================================================

PHP Code:



loadVariables("./dll files/q3/a1.dll", "/game/board/one");
loadVariables("./dll files/q3/a2.dll", "/game/board/two");
loadVariables("./dll files/q3/a3.dll", "/game/board/three");
loadVariables("./dll files/q3/a4.dll", "/game/board/four");
loadVariables("./dll files/q3/a5.dll", "/game/board/five");
loadVariables("./dll files/q3/a6.dll", "/game/board/six");
loadVariables("./dll files/q3/a7.dll", "/game/board/seven");
loadVariables("./dll files/q3/a8.dll", "/game/board/eight");
loadVariables("./dll files/q3/a9.dll", "/game/board/nine");
loadVariables("./dll files/q3/a10.dll", "/game/board/ten");
loadVariables("./dll files/q3/a11.dll", "/game/board/eleven");
loadVariables("./dll files/q3/a12.dll", "/game/board/twelve");
loadVariables("./dll files/q3/a13.dll", "/game/board/thirteen");
loadVariables("./dll files/q3/a14.dll", "/game/board/fourteen");
loadVariables("./dll files/q3/a15.dll", "/game/board/fifteen");
loadVariables("./dll files/q3/a1.dll", "/game");
loadVariables("./dll files/q3/a2.dll", "/game");
loadVariables("./dll files/q3/a3.dll", "/game");
loadVariables("./dll files/q3/a4.dll", "/game");
loadVariables("./dll files/q3/a5.dll", "/game");
loadVariables("./dll files/q3/a6.dll", "/game");
loadVariables("./dll files/q3/a7.dll", "/game");
loadVariables("./dll files/q3/a8.dll", "/game");
loadVariables("./dll files/q3/a9.dll", "/game");
loadVariables("./dll files/q3/a10.dll", "/game");
loadVariables("./dll files/q3/a11.dll", "/game");
loadVariables("./dll files/q3/a12.dll", "/game");
loadVariables("./dll files/q3/a13.dll", "/game");
loadVariables("./dll files/q3/a14.dll", "/game");
loadVariables("./dll files/q3/a15.dll", "/game");

tellTarget ("game/board/one") {
    gotoAndStop(1);
}
tellTarget ("game/board/two") {
    gotoAndStop(1);
}
tellTarget ("game/board/three") {
    gotoAndStop(1);
}
tellTarget ("game/board/four") {
    gotoAndStop(1);
}
tellTarget ("game/board/five") {
    gotoAndStop(1);
}
tellTarget ("game/board/six") {
    gotoAndStop(1);
}
tellTarget ("game/board/seven") {
    gotoAndStop(1);
}
tellTarget ("game/board/eight") {
    gotoAndStop(1);
}
tellTarget ("game/board/nine") {
    gotoAndStop(1);
}
tellTarget ("game/board/ten") {
    gotoAndStop(1);
}
tellTarget ("game/board/eleven") {
    gotoAndStop(1);
}
tellTarget ("game/board/twelve") {
    gotoAndStop(1);
}
tellTarget ("game/board/thirteen") {
    gotoAndStop(1);
}
tellTarget ("game/board/fourteen") {
    gotoAndStop(1);
}
tellTarget ("game/board/fifteen") {
    gotoAndStop(1);





================================================
================================================

Below is the code that doesnt want to work

================================================
================================================

PHP Code:



loadVariables("./dll files/q3/a1.dll", "/");
loadVariables("./dll files/q3/a2.dll", "/");
loadVariables("./dll files/q3/a3.dll", "/");
loadVariables("./dll files/q3/a4.dll", "/");
loadVariables("./dll files/q3/a5.dll", "/");
loadVariables("./dll files/q3/a6.dll", "/");
loadVariables("./dll files/q3/a7.dll", "/");
loadVariables("./dll files/q3/a8.dll", "/");
loadVariables("./dll files/q3/a9.dll", "/");
loadVariables("./dll files/q3/a10.dll", "/");
loadVariables("./dll files/q3/a11.dll", "/");
loadVariables("./dll files/q3/a12.dll", "/");
loadVariables("./dll files/q3/a13.dll", "/");
loadVariables("./dll files/q3/a14.dll", "/");
loadVariables("./dll files/q3/a15.dll", "/");

_global.b1 = a1;
_global.b2 = a2;
_global.b3 = a3;
_global.b4 = a4;
_global.b5 = a5;
_global.b6 = a6;
_global.b7 = a7;
_global.b8 = a8;
_global.b9 = a9;
_global.b10 = a10;
_global.b11 = a11;
_global.b12 = a12;
_global.b13 = a13;
_global.b14 = a14;
_global.b15 = a15;

tellTarget ("game") {
    timer = "60";
}
    
tellTarget ("game/board") {
    gotoAndStop(1);
}
tellTarget ("game/board/one") {
    gotoAndStop(1);
    a1 = b1;
}
tellTarget ("game/board/two") {
    gotoAndStop(1);
    a2 = b2;
}
tellTarget ("game/board/three") {
    gotoAndStop(1);
    a3 = b3;
}
tellTarget ("game/board/four") {
    gotoAndStop(1);
    a4 = b4;
}
tellTarget ("game/board/five") {
    gotoAndStop(1);
    a5 = b5;
}
tellTarget ("game/board/six") {
    gotoAndStop(1);
    a6 = b6;
}
tellTarget ("game/board/seven") {
    gotoAndStop(1);
    a7 = b7;
}
tellTarget ("game/board/eight") {
    gotoAndStop(1);
    a8 = b8;
}
tellTarget ("game/board/nine") {
    gotoAndStop(1);
    a9 = b9;
}
tellTarget ("game/board/ten") {
    gotoAndStop(1);
    a10 = b10;
}
tellTarget ("game/board/eleven") {
    gotoAndStop(1);
    a11 = b11;
}
tellTarget ("game/board/twelve") {
    gotoAndStop(1);
    a12 = b12;
}
tellTarget ("game/board/thirteen") {
    gotoAndStop(1);
    a13 = b13;
}
tellTarget ("game/board/fourteen") {
    gotoAndStop(1);
    a14 = b14;
}
tellTarget ("game/board/fifteen") {
    gotoAndStop(1);
    a15 = b15;





================================================
================================================

so far I tried using global variables, _root.<variable>, textboxes linked to glboal variables, having two sets of global variables linked to individual layers.

The only thing that brought me hope was that I can set the global variable to a value and send it to the layer but in no way can I get that global variable to accept the input from load variables.
Please Help

Variable Loading Issue
I have a program that generates a random string. The program is run when a button is released. I want to load that string into a text box. Is there a way the text box will update each time the button is clicked (and the program is run, generating a new string)?

Just for the record I am new to flash, also I have searched for an answer but obviously have found none.

Variable Issue Should Be Easy...
I know many of you hate using levels because its confusing... but, for this project to minimize file size, I will be using them. Please, bear with it

So, I'm trying to make a 'Choose your own Adventure' page that has 'Interface_Interface.swf' (_Level0) that automatically calls for 'Intro_1.swf' to get loaded to _Level1... Whenever the user clicks on an object in Level1, that cues a function to Unload level1 and then reload a new movie in its place.

On all my movies I have variables that store a string, and these different strings are the names of other files that should get loaded into level1... but, I need level0 to access the variables information loaded in level1 when the .swf is loaded into level1. Is there anything that can retrieve the value of a variable loaded on a different level... or is there any way to take the value of a variable and place it as the value of another variable... on a different level? I am going to do it this way so I can implement a forward progression of just a story on my Interface_Interface.swf... meaning, you just get the story without deciding what happens next... and, these variables will say what the next page in the story should be if a normal course is followed.

Let me know if you have any ideas Thanks.

Another External Variable Issue
Good day all,









Attach Code

In spite of the fact that the following AS3 and PHP code posts the variable values to the Flash Player, initially, that is:

<?php
$returnVars = array();
$returnVars['lname'] = "LastName1";
$returnVars['fname'] = "FirstName1";
$returnVars['email'] = "Email1@test.com";
$returnVars['category'] = "pro";
$returnVars['subscribeDate'] = "2008-07-31 14:07:34";
$returnString = http_build_query( $returnVars );
echo $returnString;
?>

...produces the following output in a browser (Firefox):

lname=LastName1&fname=FirstName1&email=Email1%40test.com&category=pro&subscribeDate=2008-07-31+14%3A07%3A34

...and the following actionscript:

var url:String = "http://localhost/site61/php/phpCode.php";
var reqURL:URLRequest = new URLRequest(url);
reqURL.method = URLRequestMethod.GET;

var loader:URLLoader = new URLLoader(reqURL);
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, handleComplete);

function handleComplete( event:Event ):void {
var loader:URLLoader = URLLoader(event.target);
var variables:URLVariables = new URLVariables(loader.data);
trace("lname is " + variables.lname);
trace("fname is " + variables.fname);
trace("email is " + variables.email);
trace("category is " + variables.category);
trace("subscribeDate is " + variables.subscribeDate);
}

...produces the following output in Flash' Output panel:

lname is LastName1
fname is FirstName1
email is Email1@test.com
category is pro
subscribeDate is 2008-07-31 14:07:34

...there is still an issue that is absolutely maddening me.

That is, my variable values are behaving as constants!

For example, changing the values in the PHP script to, let's say,:

<?php
$returnVars = array();
$returnVars['lname'] = "LastName2";
$returnVars['fname'] = "FirstName2";
$returnVars['email'] = "Email2@test.com";
$returnVars['category'] = "intern";
$returnVars['subscribeDate'] = "2008-08-01 06:23:59";
$returnString = http_build_query( $returnVars );
echo $returnString;
?>

Does reflect the changes in the browser, producing the following output:

lname=LastName2&fname=FirstName2&email=Email2%40test.com&category=intern&subscribeDate=2008-08-01+06%3A23%3A59

But does not reflect any changes in Flash CS3's Output Panel. In other words, the output produced is still:

lname is LastName1
fname is FirstName1
email is Email1@test.com
category is pro
subscribeDate is 2008-07-31 14:07:34

...instead of:

lname is LastName2
fname is FirstName2
email is Email2@test.com
category is intern
subscribeDate is 2008-08-01 06:23:59

as one would logically expect it to!

I really, truly need an explanation as to why this is occuring, so I can circumvent this issue in the future.

A working solution/resolution to this issue would certainly make you my hero ... as well as I, your biggest fan ... for the week!

Have a fantastic weekend all!

Troy

String Variable Issue - Please Help
Flash 8, I have some XML creating a few simple arrays. These pull some movie clips onto the stage with incremented names: product1, product2 and so on.

Inside these clips I have some code that is supposed to pull data from the arrays and put that data into text fields.

The code goes like this:

whichclip = this;
trace ("whichclip is this? = " + whichclip); - output: whichclip is this? = _level0.product1

var temp:String = whichclip;

var temp:String = temp.toString();

trace (temp.length);
char_pos = ((temp.length)-1);

lastpos = temp.substr(-1,1);
trace (lastpos); - output: ] - why a bracket?

-- end code

Shouldn't this last output be the number 1? I want to use this number to call the correct node for each clip, and therefore the correct data associated. Any ideas? thanks, John

XML Variable Scope Issue
Hey there. I'm not too strong at coding but I know enough to get things done in actionscript. I recently read some of the primers for XML in Flash and can't completely get it working. The example I chose to work with was the 'inventors' xml file which is read into a simple movie with 2 dynamic textboxes which was found here on kirupa. Worked like a champ, nice and simple.

I replicated it in my own project and it worked, but only on the main timeline. Whenever I tried to target a dynamic text box nested inside a movieclip, nothing would come up. At first, the nested dynamic text box was contained in it's own layer. When that didn't seem to work, I cited another example on the site (regarding an XML-driven .mp3 player i think..) and tried to attach the dynamic text box from the library to a movieclip at runtime...still wouldn't work.

I know the XML data is being loaded properly because the trace commands I output were never undefined and held valid data. Any help at all would be much appreciated!

Here's the xml file :


Code:

<?xml version="1.0"?>
<inventors>
<person>
<name>Thomas Edison</name>
<comment>Inventor of many things such as the incandescent lightbulb.</comment>
</person>
<person>
<name>Doug Engelbart</name>
<comment>Invented the mouse at the Stanford Research Institute</comment>
</person>
</inventors>
and the actionscript (on frame 1 of 'lensFlare' movieclip)


Code:

stop();
var root:MovieClip = this;

function loadXML(loaded) {
if (loaded) {
_root.inventor = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.comments = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
trace(_root.inventor);
var Mc:MovieClip = root.attachMovie("txt_mc", "txt_mc1", 1);
Mc.inventor = _root.inventor;
///here's where I think i'm going wrong in some way
Mc.txt_mc.text = Mc.inventor;
trace(Mc.txt_mc.text);
//txt_comment.text = _root.comments;
} else {
trace("file not loaded!");
}
}
xmlData = new XML();
//xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("inventors.xml");
linkage for the movieClip and the dynamic text box is enabled as well.

Variable/Movieclip Issue...
Hey dudes.. just wondering if anyone can shed a bit of light on this for me...

basically i am tryin to move logos around on screen using actionscript..i have lots of them that i want to run through so i'm using variables.. i have an array called logos[0] that the images are coming from and i have MovieClip 6 holders on the stage called holder1 - 6...i've adapted this bit of code i got off a forum to get this workin...


var boxcounter:Number = new Number(1);
var currentlogo:String =new String ("holder"+boxcounter);


var startX = 646;
var endX = 65;
var speed = 10;
currentlogo._x = startX;
function moveMe(targ){
targ._x+=(_root.endX-targ._x)/_root.speed
}
onEnterFrame = function(){
setInterval(moveMe,30,_root.currentlogo)
}


i think i know what the problem is but i just don't know how to fix it... the error is showing in this line
currentlogo._x = startX;
where it says

There is no property with the name '_x'.
currentlogo._x = startX;

what i think is happening is that currentlogo isn't a movieClip its a variable so it doesn't have the property x.. am i right in thinking this?? i've traced currentlogo and i get holder1 which is the name of the movie clip i'm tryin to target.. if i put holder1 into
currentlogo._x = startX; like this..

holder1._x=startX;
it works fine...


is there a different syntax i've to use or something? anyone know? any help would be greatly appreciated!

thanks a mill

leapin

The External Variable Issue
hello all... I know that there is quite a lot of external loading discussion going on... but I cannot seem to find a solution to my problem.

I can load an external txt file, and I can get the many variables from it... but, what I want to do is load ONE text document and have the multiple variables populate ONE text field dynamically based on the users choice. The best example I can give is a photo gallery where there is a title of the photo gallery.

I do not want to use XML (yet) but had wanted to understand how to request a changing variable rather than specify exactly which variable I want...
so rather than saying load "variable1" I want to say load "whatVariable" and then define "whatVariable" I want outside of the actual text file loading script.

do I make any sense? probably not.. my appologies...maybe this helps:

loadText = new LoadVars();
loadText.load("infoPacs/" + _root.Section + ".txt");
loadText.onLoad = function() {
DETAILS.htmlText = this.variable1;
}

-note: the text file is loading great.. and loads a different text file based on which section the user is in.
Meanwhile... the loading of the single variable also works.. but I want to make it dynamic the way the actual text file load is dynamic.

any help would be great.

Possible Variable Scope Issue?
I have the following code, where rolloverButtons is a 2-dimensional array.



Code:
for (i = 0; i < rolloverButtons.length; i++)
{
rolloverButtons[i][0].onRollOut = function()
{
rolloverButtons[i][1]._something = something;
}
}
The problem is that within the function called by the onRollOut event, the counter variable i is not recognized, therefore the reference to the movie stored in that element of the array is not recognized. Is there some way to get the value of i into that inner function?

The reason I am using a loop for this is because I have 10 buttons, and don't want to have to write out 10 different functions to control how they behave. Perhaps there is another way of achieving this goal?

Thanks in advance...

Variable Scope Issue
Hi all,
I'm having difficulties calling a variable outside of a function.
This is what i have:

Code:
//set var outside function
var totalHolderHeight:Number = 0;

//handle server response
this.getContacts_Result = function(result)
{
if(result)
{
// the code below needs attention, specifically in relation to session handling, global vars etc.
if (query_type == "detailed"){
title = result[0];
login_details = result[1];
}
company_details = result[2];
contact_user_details = result[3];

if (result['status'] == "null")
trace("EMPTY");
//if (contact_user_details['pm_user_id'].length == "")
//trace("EMPTY");

var styles = new TextField.StyleSheet();

styles.load("include/css/styles.css");
styles.onLoad = function(ok) {

if (ok) {
// display style names
this.getStyleNames();

} else {
trace("Error loading CSS file.");
}

page_title.styleSheet = styles;
page_title.text = "<p class='three'>" + title['admin_contacts_page'] + "</p>";
login_name.styleSheet = styles;
login_name.text = "<p class='login_txt'>Logged in as " + login_details['pm_full_name'] + "</p>";
company_detail_mc.company_name.styleSheet = styles;
company_detail_mc.company_name.text = "<p class='three'>" + company_details['pm_company_name'] + "</p>";

};

var totalHolderHeight = 0;

for (var j = 0; j<contact_user_details['pm_user_id'].length; j++) {

createEmptyMovieClip("holder", this.getNextHighestDepth());

contactDetails_mc = holder.attachMovie("dynamic_id", "newClip_mc"+j, j);

contactDetails_mc.user_id = contact_user_details['pm_user_id'][j]
contactDetails_mc._x = 0
contactDetails_mc._y = j*90

contactDetails_mc.full_name_txt.styleSheet = styles;
contactDetails_mc.full_name_txt.text = "<p class='three'>" + contact_user_details['pm_first_name'][j] + " " + contact_user_details['pm_last_name'][j] + "</p>";
contactDetails_mc.email_txt.styleSheet = styles;
contactDetails_mc.email_txt.text = "<p class='one'><a href='mailto:"+contact_user_details['pm_email'][j]+"'>"+contact_user_details['pm_email'][j]+"</a></p>";

totalHolderHeight += contactDetails_mc._height+14;

}
return totalHolderHeight;

} // end result
}

//Manage possible errors
this.getContacts_Error = function(status){

trace("Error")
}

_global.totalHolderHeight = this.getContacts_Result();
trace(totalHolderHeight);
When i trace(totalHolderHeight) i get "0". Anu ideas as to how i should be calling the function to give me the updated value?

Cheers

Help W/ Text Variable Issue
I've got a small app that reads the contents of a text file and then displays those contents on a Flash banner. The text file reads: Test=This is a test.

Here's the problem: I can read the contents of the text file but for some reason it won't display on the banner. If I hard code the value of the string in place of this.Text.toString, to something like say... "TEST", for example, my banner scrolls "TEST" just as it should. So, it's like I'm 80% of the way there but need help sorting out why the banner's not getting the dynamic value it needs.

If I trace this.Text.ToString() right before the call to placeText, the value displayed is correct - just like it reads in the text file, so I think it's getting passed properly. Thoughts?? Thanks.

CODE
function placeText(target:MovieClip, x:Number, y:Number, banner:String, tFormat:TextFormat, effectFunction:Function, delay:Number):Void {
    // For each character...
    for (var i = 0; i<banner.length; i++) {
        // Create a clip and place the current
        // character in the text field inside it.
        var char:MovieClip = target.attachMovie("letter", "char"+i, target.getNextHighestDepth());
        char.field.text = banner.substr(i, 1);
        char._x = x;
        char._y = y;
        // Add the width of the current text character to the
        // next letter's x position.
        x += tFormat.getTextExtent(char.field.text).width;
        //
        // Here is the effect function call, passed in as a parameter
        effectFunction(char, i*delay);
    }

var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean) {
    if (success) {
        var format:TextFormat = new TextFormat();
        format.font = "Verdana";
        format.size = 14;
        trace(this.Text.toString());
        placeText(this, 7.5, 1, this.Text.toString(), format, fadeZoom, 100);
    } else {
        //trace("Error loading/parsing LoadVars.");
    }
};
my_lv.load("ExampleFlashTextFile.txt");

Variable Reference Issue
Ok here is the problem. I have code which stores a reference to the base object in a class for reference from code later. The problem is when I call my function (TestFunction) the first trace returns [object Object] like it should, but the second trace (inside the xml.onLoad function) returns undefined. I am sure this is a scope issue. If somone could shed some light on this for me that would be great. Thanks a lot in advance!

Code:

   var m_base = null;

   // DATA STORAGE
   public static var m_makes : Array = new Array ();
   
   // INITIALIZATION FUNCTIONS
   function FWDataComponent(listenObject:Object)
   {
      m_base = this;
   }
   
   // DATA FUNCTIONS
   public function TestFunction() : Void
   {
      trace(m_base);
      var xml : XML = new XML ();
      xml.ignoreWhite = true;

      xml.onLoad = function ()
      {
         trace(m_base);
         var nodes = this.firstChild.childNodes;
         m_makes = new Array ();
         for (var i = 0; i < nodes.length; i ++)
         {
            m_makes.push (nodes [i].firstChild.toString ());
         }
      }
      
      xml.load (m_serverPath + "GetMakes");
   }

Variable Scope Issue
Hi all,
I'm having difficulties calling a variable outside of a function.
This is what i have:

Code:


//set var outside function
var totalHolderHeight:Number = 0;

//handle server response
this.getContacts_Result = function(result)
{
if(result)
{
// the code below needs attention, specifically in relation to session handling, global vars etc.
if (query_type == "detailed"){
title = result[0];
login_details = result[1];
}
company_details = result[2];
contact_user_details = result[3];

if (result['status'] == "null")
trace("EMPTY");
//if (contact_user_details['pm_user_id'].length == "")
//trace("EMPTY");

var styles = new TextField.StyleSheet();

styles.load("include/css/styles.css");
styles.onLoad = function(ok) {

if (ok) {
// display style names
this.getStyleNames();

} else {
trace("Error loading CSS file.");
}

page_title.styleSheet = styles;
page_title.text = "<p class='three'>" + title['admin_contacts_page'] + "</p>";
login_name.styleSheet = styles;
login_name.text = "<p class='login_txt'>Logged in as " + login_details['pm_full_name'] + "</p>";
company_detail_mc.company_name.styleSheet = styles;
company_detail_mc.company_name.text = "<p class='three'>" + company_details['pm_company_name'] + "</p>";

};

var totalHolderHeight = 0;

for (var j = 0; j<contact_user_details['pm_user_id'].length; j++) {

createEmptyMovieClip("holder", this.getNextHighestDepth());

contactDetails_mc = holder.attachMovie("dynamic_id", "newClip_mc"+j, j);

contactDetails_mc.user_id = contact_user_details['pm_user_id'][j]
contactDetails_mc._x = 0
contactDetails_mc._y = j*90

contactDetails_mc.full_name_txt.styleSheet = styles;
contactDetails_mc.full_name_txt.text = "<p class='three'>" + contact_user_details['pm_first_name'][j] + " " + contact_user_details['pm_last_name'][j] + "</p>";
contactDetails_mc.email_txt.styleSheet = styles;
contactDetails_mc.email_txt.text = "<p class='one'><a href='mailto:"+contact_user_details['pm_email'][j]+"'>"+contact_user_details['pm_email'][j]+"</a></p>";

totalHolderHeight += contactDetails_mc._height+14;

}
return totalHolderHeight;

} // end result
}

//Manage possible errors
this.getContacts_Error = function(status){

trace("Error")
}

_global.totalHolderHeight = this.getContacts_Result();
trace(totalHolderHeight);


When i trace(totalHolderHeight) i get "0". Anu ideas as to how i should be calling the function to give me the updated value?

Cheers

Simple Syntax Issue
I have for gotton the correct syntax for this. I am inside an MC and at the end want it to tell the main timeline to proceed to the next frame. Since there are different scenes, the one I am refering to is 'main'. I have tried:

_root ("main").gotoAndStop(2);

_root.main.gotoAndStop(1);

gotoAndStop ("main", 2);

None of these seem to work....

Can anyone help me?

A Simple Syntax Issue...
Ok, in the main timeline, i declare my variable:

movie = variable;

I have a series of buttons on the screen. Each one calls a different MC (e.g., instance 'ebusiness') and also assigns the value of that MC to the variable:

on (press) {
_root.ebusiness.play();
_root.movie = _root.ebusiness;

}

The MC plays normally. I have a general button outside on the main timline which closes whatever MC is open at the time, but this part does not seem to work too well:

on (press) {
_root.movie.play();
}

The 'play' is suppoed to get the MC to continue from it's internal 'Stop' command and it closes itself.

What am I doing wrong?

Sound Issue (simple)
I shouldn't be having this much trouble because I have great tutorial to explain, but yet I must still be doing something wrong.

take a look please, I need the mp3 to stop at frame 520, or near there depending on where in the movie exactly I want the sound to stop. Also, automatically fade the sound near the 520 frame mark would be helpful. THank-you in advance.

-=Simple Synax Issue=-
Whats the proper way to use the return command with a one-line conditional phrase?

(CheckIfTrue) ? return 0 : return 1

This will not evaluate properly. What do I need to do ... ASIDE from moving to IF conditional styles -_-.

~Brad

Simple Link Issue
Here is the situation:

I have a webpage. at the top of that page is a flash banner. On that flash banner I have a button. I want people to be able to click on that button and have the page switch to another page.

I'm not doing something right:

I click on the button and click on the get url action below. it adds "getURL();" to the code but that's it. obviously there is more to getting a link added to a button. Please tell me how I can add a link properly and publish it so that it will work when I add the flash banner to my page.

NOTE: I am not using a frameset. I dont want to open up a new window. I want the URL to load into the same page.

Thank you to anyone that helps me out!

Simple Script Issue
i have attatched a simple script to a button to make a menu bar fade up when i rollover it.
the problem is, every time i rollover the button the script starts again and the menu fades in every time.

can i make the action to only work once?

Regards,

Marcus...

Another Simple Button Issue
I have 4 pictures as buttons, I want them all to goto different scenes...the first scene is only 1 frame, with all the pictures. I want to beable to click each picture to goto a different scenes with more pictures, writing, etc. A little stuck on the codes though...any help?

A Simple Issue Of Delay
This may be a very very simple thing to do, but my searching has been spotty - most likely because I don't know how to word the question...

I'm attempting my first site (oh good, a newbie...)
and I just need to configure a button that performs three actions. However, the actions should do this:

On button click (mouse release) -

*load 1st movie into layer 3
*Pause for 15 frames
*Load 2nd movie onto layer 2(hidden by movie 1)
*Unload movie 1 on layer 3 (unhiding movie 2)

I guess my question is... can an actionscript be easily designed that can do an action, pause for a duration, then do another...etc...?

Thanks!

- TF

Simple Combobox Issue?
I have a simple combobox that just loads a URL. In testing in a blank doc 1 frame, 1 layer, it works great. When I try to add this to a current movie, I get the following errors, I have attached the script and the errors. Please help....

Script:
on (change) {
// trace("I selected: " + this.getValue() );
my_url = this.getValue()
if (my_url != "") {
getURL(my_url);
}
}




Error:

**Error** Scene=Scene 1, layer=Layer 37, frame=1:Line 1: Invalid mouse event specified.
on (change) {

**Error** Scene=Scene 1, layer=Layer 37, frame=1:Line 3: Statement must appear within on/onClipEvent handler
my_url = this.getValue()

**Error** Scene=Scene 1, layer=Layer 37, frame=1:Line 4: Statement must appear within on/onClipEvent handler
if (my_url != "") {

**Error** Scene=Scene 1, layer=Layer 37, frame=1:Line 7: Unexpected '}' encountered
}

Total ActionScript Errors: 4 Reported Errors: 4


I would do this any other way possible. I just need a pulldown that take users to a URL.

Thanks in advance.....

Simple Syntax Issue I Think....
making a basic coloring book,
the paint brush is coloring just fine, but the target areas are not.
any help on how to write this?

code:
startDrag(_root.paintbrush, true);

_global.chosencolor = 0x000000
myColor = new Color(_root.paintbrush.paintbrushColor);

_root.black.onRelease = function() {
myColor.setRGB(0x000000);
chosencolor = 0x000000
};
_root.blue.onRelease = function() {
myColor.setRGB(0x3300ff);
chosencolor = 0x3300ff
};
_root.green.onRelease = function() {
myColor.setRGB(0x33ff00);
chosencolor = 0x33ff00
};
_root.red.onRelease = function() {
myColor.setRGB(0xcc3300);
chosencolor = 0xcc3300
};


_root.area1.onRelease = function() {
area1.setRGB(chosencolor);
};
_root.area2.onRelease = function() {
area2.setRGB(chosencolor);
trace(chosencolor)
};

Simple Popup Issue
I have this action for my popup's:

on (release) {
getURL ("javascript:NewWindow=window.open('pords.html','F orm','width=550,height=300,left=0,top=0,toolbar=No ,location=No,scrollbars=yes,status=No,resizable=No ,fullscreen=No'); NewWindow.focus(); void(0);");
}


I want it to pop up in the center of the screen not the top left, what do I need to change for this to happen?

Thanks

Simple Preloader Issue
I'm trying to make a preloader for my project. I've done a few tutorials but the same thign keeps happening. When I preview the movie, it keeps flashing, like a constantly refreshing browser kind of thing. I got my current AS from here Preloader is on the first scene. Any ideas?
Attachment .fla is too big (700kb) but download it at:
http://www.theautumnrun.com/preload_issue.fla
Flash MX 2004
AS 2.0
Thank you for your help in advance.

Simple Preloader Issue
Okay, I've tried several different preloaders including the one that comes as a component with Flash MX 2004 pro. My problem is that the preloader doesn't show on the screen until the movie is at 64% loaded. There is nothing but the preloader and it's code in the first frame of the movie. Can anyone tell me why this is happening...or better yet, how to stop it from happening? I have a fairly large movie and it takes several seconds (10-15) to load and I don't want to lose viewers. Thanks!

Copyright © 2005-08 www.BigResource.com, All rights reserved