Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 02-16-2007, 01:16 PM   #1 (permalink)
 
MexicanOnABike's Avatar
 
Location: up north
[Flash] a few questions that i cannot find in the help.

I got this code
Code:
if (songmax.text == uvr_max.text)
	{
	songmax.text = 1;
	}
else if (songmax.text !== uvr_max.text ) 
	{
	songmax.text = Number(songmax.text) + 1;
	}
}
basicly, everytime someone pushes the button, it should add 1 to the dynamic text until it's equal to the other dynamic text and when it's equal, it should return to 1. now why is my if and else if not working? this way, it gets to being equal and then it just keeps counting up. like the IF was never there. i can give more info if you don't get it.

==================================
added questions:
using:
Code:
loadMovie();
I'm importing a swf in my movie and i need to be able to control it.
let's say this swf has 10frames, and with 1 button i need to stop when i want. how would i do this?!

i also need to find the file when it's loaded:
I have to find out how many frames there are. is that possible?
basically i need to know how to control a loaded movie in every way possible.
and if you don't know, can you tell me what would i do to find this in the help?
__________________

Last edited by MexicanOnABike; 02-19-2007 at 05:35 PM.. Reason: added question and changed title.
MexicanOnABike is offline  
Old 02-16-2007, 01:21 PM   #2 (permalink)
Please touch this.
 
Halx's Avatar
 
Owner/Admin
Location: Manhattan
Correct me if I'm wrong, but isn't the correct syntax for "not equal" != or <>

At first glance, it just appears you have an extra = in your Else If
__________________
You have found this post informative.
-The Administrator
[Don't Feed The Animals]
Halx is offline  
Old 02-16-2007, 01:45 PM   #3 (permalink)
 
MexicanOnABike's Avatar
 
Location: up north
well macromedia doesn't like the <> anymore but it does the same as !=.
and this is what the help says on these 2.

<> inequality operator
!= inequality operator
!== strict inequality operator

with 2=, and 1= it does the same. I don't get it.

-------------
more info if it helps:
songmax is a Dynamic text that starts at 2.
uvr_max is a dynamic text that starts from a loaded text file so it's random which is why it needs to check songmax with uvr_max. right now, it's set to 5.
before i click:
songmax=2
so when i click the button:
songmax=3
again:
songmax=4
again:
songmax=5
At this point, the next click should recognize it's at 5 and go back to 1. but it keeps going.
__________________

Last edited by MexicanOnABike; 02-16-2007 at 01:49 PM.. Reason: added info.
MexicanOnABike is offline  
Old 02-16-2007, 02:19 PM   #4 (permalink)
Lover - Protector - Teacher
 
Jinn's Avatar
 
Location: Seattle, WA
You gotta let me see this flash app after you're done.. after that last post.

That said, why do you need an if / else if? I know they recommend checking all your conditions so you don't accidentally fall into an else, but why even check the condition?

The else implies that they're not equal simply by the fact that it didn't go into the if;

If they're equal, do this.
Else (it's implied they're not equal)

Also, have you tracing your uvr_max ? I know you're watching songmax, but are you sure uvr_max is being set correctly from the file?
__________________
"I'm typing on a computer of science, which is being sent by science wires to a little science server where you can access it. I'm not typing on a computer of philosophy or religion or whatever other thing you think can be used to understand the universe because they're a poor substitute in the role of understanding the universe which exists independent from ourselves." - Willravel
Jinn is offline  
Old 02-16-2007, 08:33 PM   #5 (permalink)
 
MexicanOnABike's Avatar
 
Location: up north
well i tried with an else but that wasnt working so i tried a "else if" but it's still not working. I know it's working because they're dynamic text fields that are there visible. i'll try tracing them which i shoulda done in the 1st place...
and yes, i will post what I'm making once it works! haha

off to try more things!

.:::EDIT:::.
ok, i'm an idiot. I was loading from a text file right? well i thought the text file would work like a normal flash script so i added some comments // after my uvr_max variable so when i tried doing your trace idea, it gave me:
Code:
3

//
i'll go and make it work now. the equal should work! thanks for making me realize my stupidity! haha.
__________________

Last edited by MexicanOnABike; 02-16-2007 at 08:49 PM.. Reason: Automerged Doublepost
MexicanOnABike is offline  
Old 02-19-2007, 11:19 AM   #6 (permalink)
 
MexicanOnABike's Avatar
 
Location: up north
added questions:
using:
Code:
loadMovie();
I'm importing a swf in my movie and I need to be able to control it.
let's say this swf has 10frames, and with 1 button i need to stop when I want. how would I do this?!

I also need to find the file when it's loaded:
I have to find out how many frames there are. is that possible?
basically i need to know how to control a loaded movie in every way possible.
and if you don't know, can you tell me what would i do to find this in the help?
__________________
MexicanOnABike is offline  
Old 02-22-2007, 12:32 PM   #7 (permalink)
Lover - Protector - Teacher
 
Jinn's Avatar
 
Location: Seattle, WA
Sorry I took so long to reply.

No, not to the best of my knowledge, not easily. Extracting the number of frames in a SWF requires reading the file header itself, which there is no standard library for, as far as I can see.
__________________
"I'm typing on a computer of science, which is being sent by science wires to a little science server where you can access it. I'm not typing on a computer of philosophy or religion or whatever other thing you think can be used to understand the universe because they're a poor substitute in the role of understanding the universe which exists independent from ourselves." - Willravel
Jinn is offline  
Old 02-22-2007, 02:49 PM   #8 (permalink)
 
MexicanOnABike's Avatar
 
Location: up north
Quote:
Originally Posted by JinnKai
Sorry I took so long to reply.

No, not to the best of my knowledge, not easily. Extracting the number of frames in a SWF requires reading the file header itself, which there is no standard library for, as far as I can see.
it's cool. i was on flashkit's forum looking for an answer but most ppl don't get what i mean 99% of the time...

knowing the frame # isn't a big deal anymore. now i just need to PAUSE the movie. is that even possible? someone mentionned levels but I have no ideas how to work with them . and flash isn't any help. typing LEVEL in the help brings nothing at all.

edit: oh someone replied to me. http://board.flashkit.com/board/show...98#post3815598

now the impossible task to figure out how to know when the movie is done playing.
__________________

Last edited by MexicanOnABike; 02-22-2007 at 02:51 PM.. Reason: Automerged Doublepost
MexicanOnABike is offline  
 

Tags
elseif, flash, if, work


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 09:50 AM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360