all groups > flash actionscript > august 2004 >
You're in the

flash actionscript

group:

Variable Problem


Variable Problem Silpheed
8/22/2004 1:32:18 PM
flash actionscript: I made a gallery script... I use Flash 5..
it worked in 6 but doesn't work in 7...
the frame layout of the main part of the script is...



movlocation = getProperty(this, _url);
temp = new String(movlocation);
lslash = temp.lastIndexOf("/");
prepath = temp.slice(0, lslash+1);
this.pathToGallery = prepath;
this.pArray = ["01.swf", "02.swf", "03.swf", "04.swf", "05.swf", "06.swf",
"07.swf", "08.swf", "09.swf", "10.swf", "11.swf", "12.swf"];
toPath = this.pathToGallery+(name)+"/"+(page)+"/";
thumbs = toPath+"thumbs"+"/";


and I want to change the variable Page...
Page is already equal to one...

So I used this button inside of a movieclip with these actions to change the
Page variable...


on (release) {
_parent.page = "2";
_parent.gotoAndPlay(2);
gotoAndStop (2);
_parent.rev2.gotoAndStop(2);
}
but Page just wont change to 2 and the movieclip (instance) rev2 wont go to
frame 2....
It worked in Flash 6 and not Flash 7....
Can somebody please tell me something that will work in flash 7 to set this
variable to 2...
I'd greatly appreciate it... =)

I'm using Flash MX Professional 2004
Re: Variable Problem maxil
8/23/2004 7:42:02 AM
I think you will have to change the targeting. Just try adding another _parent
for flash player 7, as I think the way Flash treats a button in 7 is different.
A button can be instance and therefore can be targetted. _parent would there
fore refer to the clip it resides in.
Re: Variable Problem Silpheed
8/25/2004 3:13:27 PM
That didn't work... I dunno what is up with Flash but I'd greatly appreciate it if somebody helped o.o;
it worked before but just wont work with 7...
Re: Variable Problem Silpheed
8/25/2004 6:31:03 PM
This is the FLA I'm working from... unmodified...
Re: Variable Problem maxil
8/25/2004 10:56:14 PM
ok there was a problem with some of your code. You were using a reserved
keyword 'name' as a variable name, I changed this to 'myName', I also opted for
setting variables in the more common way of 'myName' = "0default";

I've updated your button script to be a lot more versatile. All you have to do
is change the property MAXPAGES to reflect how many pages you want and the
buttons will increment and decrement page by 1 until it reaches 1 or MAXPAGES
and then hide the appropriate button.

The script i've used is Player 6 but if you need Player 5 let me know and I'll
tell you how to achieve the same.
Re: Variable Problem Silpheed
9/2/2004 3:37:37 PM
I'm very insterested in knowing how to do this in Flash 5 because I must
distribute the file among a user group and it has to be at least flash 5
compatible...
what code must I modify to make this flash 5 compatible... and I'm so thankful
for all of your help maxil...
you're so great for helping me out...
and I'm not sure if my first reply posted so sorr if this is a double post...
AddThis Social Bookmark Button