32 Bit Versus 24 Bit Uints
Hey everyone! Does anyone know offhand if there is a way to check if an unsigned integer has a 32 bit value versus a 24 bit one? This would be specifically in reference to a color value w/ alpha versus one w/o. Meaning, could I find that this... 0xFFFFFFFF is different from this... 0xFFFFFF Or that this... 0x00000000 is different from this... 0x000000 I realize that in an example like that, the end numerical value is the same, but there are times when it'd be nice to know if a value passed into a function originated as a 32bit uint or a 24bit, even if the value of both were the same. Thanks!
KirupaForum > Flash > ActionScript 3.0
Posted on: 05-08-2008, 03:48 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Asp Versus Swf
I have an asp page with 5 link and an swf movie. The five links tell to the swf to change the colors of a movieclip in the stage. How can i do this?
TellTarget Versus With Etc.
I am using following script:
_root.mc = new Array();
i = 3;
_root.e = _root.n.firstChild;
while (_root.e != null) {
mc[i] = "tab"+i;
attachMovie("MCprod_tab", mc[i], i);
tellTarget (mc[i]) {
caption = "";
_x = _root.first_col;
_y = _root.first_line;
gotoAndStop (1);
}
i = i+1;
_root.e = _root.e.nextSibling;
}
which loops through xml document and attaches new instance of MCprod_tab for every node it founds and then sets up some parameters of it according to data stored in xml document (like position of current instance, dynamic text displayed etc.). It works. But since the tellTarget is deprecated, I am curious whether I can do the same thing using with() - I was not succesfull so far.
Flash Versus IE
Hi guys,
I am using this actionscrit to load dynamical images in
my flash movie
code
_______________
loadMovie("/imagens/foto.jpg", "exibe");
________________
When i play my movie inside the stand alone falsh player,
it works perfect ( clics twice on the file)....
but when I call my flash inside the html, in the
browser window ( IE 5.00.315 ....) the images does not
apears ... can anyone helps me?
thanks
_root Versus This
i'll try to make this my last "random thought" question for the day...
if you have a main movie and load external .swf files into it, should all script on the loaded movies use "this" or "_root" to access its own timeline?
thanks,
-myk
Php Versus Formail Cgi
I have 20 input boxes, and I want them all to be sent via email, which is better technology, or better suited for my application, php seems simpler, but which is better? My server supports everything.
Mike
SWF Versus Scenes
Ok, here goes, this question has probably been asked many times before. I am attempting to make a movie: Presently the movie consist of a Main.swf. (and for demonstration purposes) a.swf, b.swf, c.swf, d.swf and e.swf.) My question is would it be better to try to load all the movies at one time, or separate them out and copy the timelines into the Main.swf, and use a goto to a label to start the next scene. (approximate file size is just alittle over 1MB). I have been able to load a.swf into the Main.swf, but I am having trouble getting the second b.swf to begin when a.swf finishes. This is the generic code that I am using to load the a.swf file into the Main.swf.
code: this.createEmptyMovieClip("blank_mc", 10);
with (blank_mc){
_x=50;
_y=150;
}
loadMovie("a.swf", blank_mc);
What would I need to write to continue in sequence all the .swf files. Also so there is no lag time in between movies. Also when you load a movie does all the .swf's load at the same time?
Thanks for the help.
Switch Versus If..else If
I was wondering if there is any advantage in using swtich instead of a serie of if...else if statements. I know it is "neater" when you have a long list of conditions, but is switch more efficient because of the break; part of it?
The way I see it, if...else if continues to check for validation until it reaches the end, but switch stops as soon as it meets a condition? Is it more effecient memory-wise?
thanks for clarifying
Loading Versus Get URL
Can anyone out there clarify which is better method for loading swf files? Is it more efficient to use the LoadMove Action and load it into level 0? or to use the get URL function and define the swf path that way?
-Thanks,
Brock
Colors Web: Mac Versus Pc
Hi there,
I'm working on a Mac. Now I made a site and when I compare colors on pc I get a huge difference:s. My green grey looks like it's black. How do you manage to get the colors wright on both platforms? The calibration of my screen is perfect for print.
Share the knolidge.
Sorry I putted this topic here didn't know where it was the best.
Jpg Versus Png24
i've read that flash loves imported graphics in png24 format, but i see that there is usually a massife difference in size (jpg being much trimmer)
what's the general concensus on this?
Detecting IE Versus Netscape
Is it possible to detect if an end-user is using IE or Netscape? I have a button that when the user clicks on it, if they use IE I want to direct them to one page and if they use Netscape to another page. Is this possible?
Frames Versus Scenes
Here's something that's been bothering me for a few days, and maybe some others.
Back in the day (like last year when I was using Flash for projects at school, whenever I had to "switch pages" to new content I would simply gotoAndStop (or Play) a frame or set of frames in the current scene. This worked fine, but it was kind of messy.
So my question is, is this the common practice when switching pages, or are multiple scenes used?
Thanks for the help,
Tom
Communication Swf-->swf Versus Html?
hi guys!
i´ve a little problem to solve! i should do
two flash files which communicate versus javascript.
is that possible to do or just a stupid idea?
greetz
markus
LoadVars Versus GetURL
Hi,
I am trying to use a LoadVars object to pass information from a Flash movie into a PHP script. When the movie (in this case, a game) reaches a certain point (game over), I need the browser to load a results page with some variables from the Flash.
When I do this:
var myvar = new LoadVars();
myvar.something = "test";
myvar.send("http://www.myurl.com", "_self", "POST");
It does nothing. The game remains frozen at the game over screen.
Whereas if I did:
getURL("http://www.myurl.com","_self","POST");
It correctly loads the resulting page, but not the variables.
What am I doing wrong? I have searched and searched and it looks like LoadVars is the way to do this, but it's not working...
Forms Versus Standard
Is there a difference in the way you treat a loaded swf created using a Form app opposed to a traditional swf?
for example:
_root["_level"+activeSlide].stop();
will stop the loaded swf at a level specified by activeSlide.
However, this won't work if the swf was created using Forms.
Any thoughts?
Thanks.
Bytesloaded Versus Framesloaded
hi all. first and foremost: i am working with flash mx.
here's what i have. i have a main swf application that loads 4 separate swf files. these files are one frame movies and a boatload of audio. 2.5Megs of audio specifically, which is why i've broken them down into separate swf files. i load each of these swf files via loadMovie(). what i want to know, is which is the best for preloading options? i.e. a preloader bar? cuz i can't get it to work.
is frames loaded really frames loaded? because my loading swfs are only 1 frame, but a LOT of bytes. additionally, the loading swfs are in movies that are 1px by 1px, so the loader will be in the loading movie.
any help with example code would be great!
thanks so much!
Online Versus Offline Mac, Pc
ok, i have a very confusing situation here and hopefully someone can help me out... i have a site that i have loaded three different swf files one has a preloader and loads an image at start up but is invisible until a certain action is made... i created my site on a mac using flash 2004, i test my swf files on my computer through the flash player it works great, i test it through the html files and view it locally through my browser it works great both on explorer and safari... i up load my files to my host and i check it online through my mac and it is broken... the first image doesnt load and the site is non functional... here is the wierd part i check online through a pc and it works great! any ideas of what is going on here!!!!????
Flashplayer 7 Penetration, Versus 6.
Does Macromedia post the percentage of Flashplayer 7?
I need to know what kind of exposure I'm getting when designing just for 7 instead of 6 or 7.
_level0 Versus _root
Can someone give me a rundown (or link) on where to use _level0 and where to use _root
I know I have read a thread on this somewhere before, but can't find it.
Thanks,
Stephen.
Scenes Versus 1 Frame
Hey guys,
I've started a project using Scenes, but have been reading some posts from the veterans who have strongly advised against using scenes, but I'm not entirely sure why. Does anyone have any advice on the matter? And if all is to be kept on one timeline, are goToFrame()s just slapped all over the place? What if your frame numbers change and fink everything up? Scenes just kind of seem like an easy way to organize things...when do they start becoming a nuisance? I'm scared.
Iexplorer Versus Firefox
When I export the swf in iexplorer works fine
but in firefox doesn´t.
I don't know the changes I've to make to suit the flash in the web page for firefox'
any help?
aizqper@hotmail.com
GoToAndPlay Versus Play
What's the difference between the commands "goToAndPlay" and just "play" when you're talking about a movie clip. Because after each one you put a parenthesis to tell what frame to start at, right?
Thanks
MovieClip Versus Button
The setup: A 6-tab navigation with a simple animation where the tab rises and falls. Each tab is a separate movie clip that uses a "null" Button (read: square graphic with alpha set to 0) as a hit area contained within each timeline.
The Issue: When the AS is on the main timeline (i.e., mcTab1.onRollOver...), the animation will "jitter" when the cursor passes over it slowly. But when the AS is moved directly on to the movieclip's null button instance (i.e. on(rollover)..), there is no jitter?
While the latter fixes the jitter, I'm wondering why there is this disparity. As a personal "best practice" I keep my AS on the main timeline in its own layer for ease of debugging and code maintenance. I've nothing against putting AS on instances, but it can make for some slow troubleshooting on some of my larger projects. If I have to make an exception to putting AS on Button instances, I can live with that, but I don't understand why this would even be an issue to begin with.
Any thoughts?
Flash Versus Animated Gif
After a few hundred hours, I finally got my flash opening to work right on my landing page. In the process I started to create an alternate pic for those visitors who don't have Flash installed. I decided to make it an animated gif and was quite surprised at how small the file was (66KB versus over 400 for the flash file). I also was pleasantly surprised at the quality of it. So now I have a dilemma. Should I even use the Flash since it is a larger file and requires the plug-in? Please let me know your aesthetic thoughts as well as any technical advice. Thanks!
http://www.families4change.org/lifespanmedia/test2/ffwithswfobject.html
http://www.families4change.org/lifespanmedia/test2/gifonly.html
Flash CS3 Versus Dreamweaver CS3?
Hi all,
i am about constructing a profotionnal web site...
and i don't know the best and more wide and advanced software doing that,
i am ezitated between Adobe Flash CS3 and Adobe Dreamweaver CS3 ??
Is there another one better than these 2??
Please advise me,
Thanks
Fluid Versus 100% Scale
I haven't noticed any 100% scaled flash sites out there and I was wondering why that is? It seems that everyone uses a fixed or a fluid layout. I have never made a 100% scale site and was experimenting around and trying to figure out the advantages and disadvantages. Is bitmap quality the only issue that stops people from doing 100% scaling sites or am I missing something. Also, if anyone has any links to sites that scale 100%– that would be great.
Get Timer() Versus SetInterval()
I'm using get Timer() to pause animations before they start again but am worried that, having 8-10 of these in a movie, is not an efficient use of memory. Someone told me to use setInterval() instead. Does anyone know if that is a more efficient method? (for an application accessed online.)
An eg of my code is:
onClipEvent (load) {
this._parent.stop();
Count = getTimer();
}
onClipEvent (enterFrame) {
if (getTimer()-Count>2000) {
this._parent.play();
}
}
The suggested replacement:
stop();
turnInt = setInterval(this, "turn", 2000);
function turn() {
gotoAndPlay("turn");
}
Thanks in advance for any info on this one.
.swf Versus Standalone .exe Performance
Hi All,
I've created a plinko game (drop a ball from the top of the screen that collides w/ various pegs until it reaches one of 6 cups at the bottom of the screen) that runs fine as an .exe file but has bugs as an .swf.
For example, the movement of the ball as it drops and collides is jerkier and the .swf file doesn't seem to "read" the _x and _y coordinates as well.
Is this a common problem w/ .swf files? Is there a solution?
Thanks. :-)
Ms Versus Flash 5 ( Variable Color)
Folks,
I am having a problem with a scipt that i use for sent
variables in html to the flash movie, the script makes
it changes its colors.
the html code is
param name="movie" value="teste.swf?linha=ff0000"
the code that i use in flash 5.0 is
cCircle = new Color("linha");
cCircle.setRGB(parseInt(linha,16));
stop();
My guess is that flash mx works in a diferent way
Attach Versus Load Movie
Hi
in my portfolio web site that i am building:
I have a button "Auto" that should take me to a frame label 'auto' in a MC 'folio'...
in that frame label i have an empty MC 'auto1' in which i want to attach a linkage MC from my library
so i have an action on my frame label
_root.folio.auto1.attachLoadMovie("auto1", "auto1", 20);
and that doesn't seem to work
it is keeping the MC empty although it is the right path. Is the syntax correct?
Because if I try the loadMovie command instead and I load any swf file, it works....
Now the thing is that I'd rather Attach Movie instead of Load, because in the Load Movie i will have to have 100 swf files or so to upload, whereas with the attach command everything stays in one file. But I don't want everything to load from the begining (as everything stands on one frame in my timeline, and it will be too heavy), i'd rather use a preloader when i click on the button Auto for instance to load me the attach Movie. Can I do that? Is my question clear? For any question, write to me
thank you very much
ran
Class Construction Versus Prototype?
Okay, i'm reading a book, Flash MX Actionscript:Advanced Training from the source..
for any of you who have the book, my question is due to pages 182-187.
These pages explain how to create custom classes by making a class constructor function (may not be using the right terminology), then a few pages over, the book discusses the prototype object...
It seems to me that the prototype object does essentially the same as a class constructor, except it defines properties for an object that already exists...
can someone give me a concrete example of the benefits of using one over the other?
how about some real world examples or something..
thanks for your time..
-myk
-"moo?"
Loadmovie From _root Versus Movieclip?
Hi there!
I have a MC on stage named 'clip' that has this code ...
Code:
onClipEvent(load) {
this.loadMovie("image.jpg");
}
onClipEvent(enterFrame) {
trace("size = " + getBytesLoaded());
}
This traces the bytesize of 'image.jpg' but the image is not visible??
If instead _root loads the image into 'clip' ..
clip.loadMovie("image.jpg");
.. the image is visible and off course traces the same filesize.
I find this very odd! Does anybody have a clue why this happens... ?
//pod
Ecommerce Versus Retail Stores...
Im trying to create an online video presentation that illustrates the benefits of ecommerce over the internet so current store owners can learn to operate their business anywhere in the world by way of computer and internet access. As more consumers are drawn to the convenience of internet purchasing, employment opportunities arise for technically qualified candidates like you and I. So im searching the internet for ideas and resources to include in my project. If anyone reading this has come across a really great presentation about ecommerce and internet profits please send me the link to brandon@310websites.com or preferably the original file itself. Thanks alot guys and ill let you know when its done.
Ascii To Binary And Visa Versus?
Hi,
Currently am creating a flashform on a webpage where a user can change his/her password. Since my host doesnt provide ssl, I am trying to do some sort of encryption mysql by converting string into binary. Because when string are changed to binary data, you can do some calculations on them(thus do some encryption that way)
On the serverside (PHP) I have a working script:
//---
function bin2asc ($temp) {
$len = strlen($temp);
for ($i=0;$i<$len;$i+=8) $data.=chr(bindec(substr($temp,$i,8)));
return $data;
}
//---
function asc2bin ($temp) {
$len = strlen($temp);
for ($i=0; $i<$len; $i++) $data.=sprintf("%08b",ord(substr($temp,$i,1)));
return $data;
}
//---
I must have a same sort of script on the flash side also.
Does anyone know if that is possible?
kind regards
Patrick
Compatibility Of Project Files On MAC (?) Versus PC (fla)
I use Flash MX on
Hi people, i have a question.
When i buy a Macintosh, can i the use my fla files from my Window PC? Is it compatible?
Please take it that i have no experience with MAC.
How does it works?
Is MAC better for flash developing or shall i stay on Windows?
When i save my fla? file on MAC, can i use this file on Windows PC?
Thank a lot.
Jan
Movieclips Versus Main Timelime?
Hi guys:
Just a quick technical question. I have a really light (60Kb) animation sequence:
http://www.efxmedia.com/clients/efxweb
But it plays really slowly on some machines, it is sluggish. I have set this up as several animation movie clips that are on the main timeline so could this be causing the sluggishness?
Would it be better to have everything on the main timeline so that only 1 timeline is being played and not multiple ones (through the mcs).
Any feedback/solutions would be GREATLY appreciated.
Cheers!!!!!
What Is Meaning Of Resolution Versus Size?
Would someone please refer me to a place where I could learn about the relative meanings and relationships of resolution and size and what they mean in the different media?
I need a lesson in the basics. Questions I have keep surfacing, and sometimes a little knowledge is a dangerous thing. A pixel is one dot; a screen size may be said to be 600 x 400. So that means what?
It is 600 pixels across by 400 verticle? And what does that have to do with resolution? Does the 600 x 400 display the same on a 15" monitor, a 19" monitor, a TV screen, in a flash movie, on a photograph, a CD, etc...?
Thanx,
Brian
[F8] Flash Versus Java In Speed
Hi I'm a flash newbie but am an experienced developer.
I finally am looking into converting some of my java projects to flash. For my first project I ported my voter project www.cheesygames.com/voter
The problem is that the flash version is much slower than the java version.
I created a test page to show the speed difference voter speed test along with the source code for the project.
At this point i think I'm just not doing things in a flash friendly way which is slowing things down.
If anyone can provide any pointers I would appreciate it.
Re: Flash Banner Ad With 2 Buttons Versus 1...
Hi,
I'm creating a Flash banner ad for a client, and the whole ad is clickable, but I'd also like to make the button grow bigger and light up when rolled over, which would mean the ad would now have 2 buttons and I've heard that some websites don't support ads with 2 buttons, is this so?
Thanks for any help!
-Todd
http://www.toddlerneradvertising.com
[CS3] Scenes Versus Multiple Animations?
Hi,
I'm fairly good at doing simple animation for Web Based Training examples combined with HTML. Now I want to animate an informational graphic that will most likely get a bit more complicated than I'm used to. I would like to do the entire graphic in Flash and move it into a RoboHelp application. Should I use scenes or multiple movies? I'm not sure how to call another movie if the user selects a image to expand on but I can cross that bridge later. What I would like to know is from experience what would you use with more complicated flash files? Thanks. Then I'm sure I'll be checking this site for coding help since ActionScript is not my thing in spite of multiple trys. Thanks.
Many Frames Versus Time Intervals
Is is possible to script a three-frame loop that runs until a designated time interval is up? I'd rather do this than have hundreds of frames, but am at a loss for how to make it happen.
for the sake of the thread, let's say I have a movie clip "run_mc", and I want it to loop until 30 seconds has run out, then gotoAndPlay("start").
Any help would be awesome!
Thanks,
Keith
Global Versus Local Variables
In my high school programming course, I was taught that "var" statements made inside a function create "local" variables, that cannot be accessed from elsewhere in the program, unless they are passed back (with a return statement)
I am assuming the case is the same with flash (please correct me if I'm wrong).
In my current program, I am calling a certain function "getInfo (someNumber:Number())" about 20-100 times simultaneously, like this:
ActionScript Code:
for (i=0; i<someArray.length; i++) {
getInfo(i);
}
within the function getInfo, I am declaring about 5 different variables, whose values depend on the paramater "someNumber". My question is, will these variables replace each other, and if so, what can I do to prevent this?
thnx
ENTER_FRAME Versus Timer For Animations In RIA Dev
Hi-
I'm on a fact finding mission and need some opinions from experienced RIA developers regarding using the ENTER_FRAME event or the Timer object for animations.
Which is best under ideal management?
As I understand it, with each frame, the flash player iterates through the display list looking for DisplayObjects that need updating thus adding a small amount of CPU overhead that grows incrementally as more DisplayObjects get added or as the framerate gets higher. If nothing is happening, you still incur this overhead.
On the other hand, the Timer object can be run only when animations occur, independent of the framerate allowing developers to get smooth animations at very low framerates in conjunction with updateAfterEvent() thus eliminating the overhead from high framerates or large numbers of displayobjects on stage.
To provide an example of this overhead, use the following code
ActionScript Code:
var i : int = 20000
while(i--)
{
var sprite : Sprite = new Sprite();
with(sprite.graphics)
{
beginFill(0x000000, 1);
drawRect(0, 0, 25, 25)
endFill()
}
this.addChild(sprite);
}
Publish the movie and make sure your mouse is over the stage and still. press Ctrl+Shift+Esc for the task manager and note the CPU usage for the flashplayer process. No animations are going and on my 9300 Quad core, this causes a 7-9% CPU overhead at 30 FPS but at 3 FPS it is barely noticeable.
Obviously this is an extreme case unless you are building a monster app or game that required 30,000 objects on stage at once but it provides compelling evidence that the Timer object may be the best choice for animating.
What say you?
Load XML In Package Versus FLA File
i have a problem.
when i attempt to load my XML in the FLA file
using this code:
ActionScript Code:
var navData:XML;
var myLoader:URLLoader = new URLLoader( );
myLoader.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
myLoader.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
myLoader.load( new URLRequest( "products.xml" ) );
function onComplete(evt:Event) {
try {
navData = new XML( evt.target.data );
trace( navData );
myLoader.removeEventListener( Event.COMPLETE, onComplete );
myLoader.removeEventListener( IOErrorEvent.IO_ERROR, onIOError );
} catch( err:Error ) {
trace( "could not parse loaded content as XML:¥n"+err.message);
}
}
function onIOError(evt:IOErrorEvent) {
trace( "an error occurred while attempting to load the XML:¥n"+evt.text);
}
it works fine and traces my XML file with no problem.
though, when i try to use the same code in an AS file package, i get many errors.....
ActionScript Code:
package {
import flash.events.*;
import flash.net.*;
public class photoLoad {
public var navData:XML;
public var myLoader:URLLoader = new URLLoader( );
myLoader.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
myLoader.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
myLoader.load( new URLRequest( "products.xml" ) );
public function onComplete(evt:Event):Void {
try {
navData = new XML( evt.target.data );
trace( navData );
myLoader.removeEventListener( Event.COMPLETE, onComplete );
myLoader.removeEventListener( IOErrorEvent.IO_ERROR, onIOError );
} catch( err:Error ) {
trace( "could not parse loaded content as XML:¥n"+err.message);
}
}
public function onIOError(evt:IOErrorEvent):Void {
trace( "an error occurred while attempting to load the XML:¥n"+evt.text);
}
}
}
what in the world would my problem be??? any clues?
Linkage Identifier Versus Instance Name
What are the differences between linkage identifier and instance name of any
object(mc,symbol etc)
Some commands in flash require linkage identifiers to me provided.What if
the movieclip is being created dynamucally.How would then the link Id be
given.
On the other hand if movieclip is static with linkage identifier then how to
create handlers (on press ,etc) for it after attcahig it on stage or some
container to recieve events from those container also.
Any suggestions and thoghts appreciated.
Math Tweens Versus Keyframes
Hey all, I just took an advanced actionscript class and basically learned the finer aspects of math tweens.
However, my teacher was kind of an actionscript "zealot" and said he uses math tweens for everything (I don't find them easier to do like he does- I'm more visual than theoretical). My question is this...
are actionscript tweens less CPU intensive? do they create much smaller file size?
What are the "real world" advantages of math tweens versus frame tweens? And in which applications would you use them???????
THANKS ALL!!
Text Versus HtmlText In Texteffect
Hi Coders.
I have tried to do a script which makes a texteffect.
It is one of those regulars in which you use dynamic text, at multiline, with substring and an onEnterFrame.
So the textfield starts at noll characters and goes up.
But the main problem which I dont know how to handle really is when it comes to make the .text property to a .htmlText property.
It seems to be really difficult to port the code for .text to allow .htmlText.
Since when using substring on a html-formatted string will take all html-markup into consideration.
Is there any solutions you can think of?
Thanks
My XML Versus Kirupa Photo Gallery With XML
Hello hello...
Back with another xml problem.
I tried the tuto from Kirupa for photo gallery and xml .
I modified the xml file with my own pictures.( I copied it and added the path to them)
But when I try the swf this message appears :
Error opening URL "file:///C|/Documents%20and%20Settings/user/Desktop/divers%20flas%20et%20swfs/undefined".
Here is an example of one of my xml picture nod :
- <images>
- <pic>
<image>Divers flas et swfs/allimages/1.jpg</image>
<caption>diving</caption>
</pic>
- <pic>
<image>Divers flas et swfs/allimages/2.jpg</image>
<caption>Magic Dhony</caption>
</pic>
etc...
This of course means that the image 1.jpg is in folder allimages which is in the folder divers flas et swfs.
So why this undefined message ? Is it a wrong path ?
Note : I work with flash 8.
Thank you for your help again.
|