Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax problem

Status
Not open for further replies.

2cxc

Programmer
Aug 29, 2003
245
CA
what the correct syntax for this:

on (rollOver) {
if (var="1") {
gotoAndStop(4);
} else {
gotoAndStop(3);
}
}
 
2 "==" in an if statement...

on (rollOver) {
if (var=="1") {
gotoAndStop(4);
} else {
gotoAndStop(3);
}
}

And "1" would be a string here, and not an integer.

Regards,

cubalibre2.gif
 
problem still presists. I have untitled-a.html that contains untitled-a.swf like so:
Code:
<OBJECT classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;
 codebase=&quot;[URL unfurl="true"]http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0&quot;[/URL]
 WIDTH=&quot;100%&quot; HEIGHT=&quot;100%&quot; id=&quot;Untitled-a&quot; ALIGN=&quot;&quot;>
<PARAM NAME=movie VALUE=&quot;Untitled-a.swf?val=1&quot;> 
<PARAM NAME=loop VALUE=false> 
<PARAM NAME=menu VALUE=false> 
<PARAM NAME=quality VALUE=high> 
<PARAM NAME=bgcolor VALUE=#FFDB52> 
<EMBED src=&quot;Untitled-a.swf?val=1&quot; loop=false menu=false quality=high bgcolor=#FFDB52  WIDTH=&quot;100%&quot; HEIGHT=&quot;100%&quot; NAME=&quot;Untitled-a&quot; ALIGN=&quot;&quot;
 TYPE=&quot;application/x-shockwave-flash&quot; PLUGINSPAGE=&quot;[URL unfurl="true"]http://www.macromedia.com/go/getflashplayer&quot;></EMBED>[/URL]

When i goto Untitled-a.html page it loads the swf. On the main stage of the swf I have symbol_15. this symbol is comprised of 4 frames:
[frame 1: image with actions]
stop();
on (rollOver) {
if (val==&quot;1&quot;) {
gotoAndStop(4);
} else {
gotoAndStop(3);
}
}

Verification that val==&quot;1&quot; doesn't happen, the else statment kick in instead. Any thoughts on this?
 
is val in that movie? where is val? if it is on the main _root then it may need to be:


if (_root.val==&quot;1&quot;) {



[conehead]
 
val is firstly in the swf's embed tag:
<PARAM NAME=movie VALUE=&quot;Untitled-a.swf?val=1&quot;>

then Untitled-a.swf has a first frame with actions:
loadMovieNum(&quot;bkgrnd.swf&quot;, 0);
loadMovieNum(&quot;menu.swf&quot;, 1);
loadMovieNum(&quot;Untitled-a2.swf&quot;, 2);
loadMovieNum(&quot;Untitled-a1.swf&quot;, 3);

the menu.swf is where on the main stage of the swf I have symbol_15 and its 4 frames. I've tried _level0.val==&quot;1&quot; and still nothing?

any suggestions?
 
I'll try to reiterate my problem:
There is an html page that has swf like so:
...<PARAM NAME=movie VALUE=&quot;Untitled-a.swf?val=1&quot;>...
...EMBED src=&quot;Untitled-a.swf?val=1&quot;...

the Untitled-a.swf movie has only 1 frame and has only these actions:
loadMovieNum(&quot;bkgrnd.swf&quot;, 1);
loadMovieNum(&quot;Untitled-a1.swf&quot;, 2);
loadMovieNum(&quot;Untitled-a2.swf&quot;, 3);
loadMovieNum(&quot;menu.swf&quot;, 4);

in menu.swf i have a button with instance of symbol 15. symbol 15 has 4 frames:
[frame1 has image and action]
stop();
if (val==&quot;1&quot;) {
gotoAndStop(4);
} else {
on (rollOver) {
gotoAndStop(3);
}
}
[frame2] // no action just image
[frame3]
stop();
on (press) {
getURL(&quot;community.html&quot;, &quot;_self&quot;);
}
[frame4 has new image and action]
stop();
on (press) {
getURL(&quot;community.html&quot;, &quot;_self&quot;);
}

I fooled around with this an no matter what arrpoach i use: if (val==&quot;1&quot; {
gotoAndStop(4);
does not stop on frame 4, i've tried lables instead of frame number and still no luck, i've tried _level0 instead of _root and nothing.

Any suggestions
 
you have to get val into menu.swf somehow... it is looking for it in menu.swf and I do not think you are getting it in there yet...

[conehead]
 
I've changed the actionscripts, but basically this is how it could be done. See if you can follow...

Leads to frame 3 of menu.swf, because the variable set in the html is not passed on...

Variable is passed correctly...

Here are the files


BTW, don't use &quot;-&quot; in file names, that'll get you in trouble!

Regards,

cubalibre2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top