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




:Void Different Flash 8 And Flash 6



HowdyI have this Function:
Code:
function executeCallback():Void {mySender();trace("CALLBACK");};
When I export my movie in Flash 8 Actionscript2 everything works fine.When I export it as Flash 6 AS 1 i get the following error:
Code:
**Error** Scene=Scene 1, Layer=Layer 1, Frame=1:Line 24: '{' erwartet function executeCallback():Void {**Error** Scene=Scene 1, Layer=Layer 1, Frame=1:Line 28: Unerwartetes Auftreten von '}' };Anzahl der ActionScript-Fehler: 2 Gemeldete Fehler: 2
any1 knows why? or how i can make this function that it will work in Flash 6 AS1??? Coz when i delete the VOID and export it in Flash 6 the Function is not working properlythanx in advance



KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 07-05-2007, 10:44 AM


View Complete Forum Thread with Replies

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

"Void" Operator In Flash MX. Help Please.
Hi,
I have code which begins with:

ActionScript Code:
function camControl():Void {
  parentColor.setTransform(camColor.getTransform());
  var scaleX:Number = sX/this._width;
  var scaleY:Number = sY/this._height;
.....
I get an error which says "Scene=Scene 1, Layer=Layer 1, Frame=1: Line 1: '{' expected
function camControl():Void { "
Does Void belong to AS 2.0?

Any help on this please?

:Void?
stupid question but it here goes.
in the following code...

PHP Code:




listener.onLoadComplete = function(target:MovieClip):Void{
    whatever....;
};






what does Void do? is it needed? if so why?

Void
Hi All,

My question might sound funny to some of you, but I've been scripting for years, and like to think of myself as prertty good, but a thing I never understood is...

what the hell is void???

What Does Void Mean?
Hi everyone. Can some please tell me what Void means? I tend to type it all the time but don't actually know its purpose as when i remove Void in the script my movie is still the same.

For example:

init();
function init()
{
lineStytle(1, 0, 100);
}
function onMouseDown():Void
moveTo(_xmouse, _ymouse);
onMouseMove = draw;
}
function onMouseUp():Void
{
delete onMouseMove
}
function draw():Void
lineTo(_xmouse, _ymouse);
}

If i remove :Void i still get the same drawing application and nothing changes so what is the purpose of including :Void in the script. Thanks for the help.

What Does :void Do?
ive seen it sometimes used after a function. What exactly does that do?

VOID - When?
Hello - I just don't get the difference when to use VOID or Not ..
with so many tutorials I have read, some use void, and sometimes they don't within very similar circumstances ..

Code:
function onEnterFrame(Void):Void
{
}
//and
onEnterframe = function():Void
{

}
//and there's even a lower case 'void' too .. >>
//I usually just use
onEnterFrame = function()
{
}
Can someone explain when and not to use it - or should it always be used!?
thanks ..

Init():void
Hi guys,

I'm working through a book all about AS3 but I'm a bit confused by something:
at the start of all the AS files he calls a function like so:


PHP Code:




public function happyGilmour()
{
init();
}
private function init()void:{
  //and here is all the code...







why bother with the init part? why not just put:


PHP Code:




public function happyGilmour()
{
//and here is all the code...







Just curious. Thanks, dave.

Void* In Actionscript?
Hi,
I'm a c++ programmer and I'm currently learning actionscript for a new game project. I would like to know if it's possible to create a function that will accept ANY type of parameter, then cast that parameter into the desired type, in actionscript?

In c++, it would be done this way:
void MyFunction(void* _pParam1)
{
int iParam = *(int*) _pParam1;
}

Is it possible to do something similar in actionscript?

Thanks,
Steve

Function():Void{};
PROBLEM RESOLVED...Thank you.



I am using flash mx (6), and it doesn't seem to accept the above codes.
Is it just for flash mx 2004 and is there something similar for mx6?

Button Void
I have buttons in my container that fade out at one point of my website. But they stay active as obviously the movie that is playing at that point is loaded into the same container.

How do I stop the buttons from being active?

Simple Question About VOID
Hey guys, this question has been buggin' me for a while now, and I haven't found anything well defined, and I'm just a novice actionscripter so...

1) What's the deal with the use of VOID in functions? is it safe to omit it?

I know that functions written something like this:
function MyFunction:Void()
{
do something;
}

don't return any values, so why some people use "Void" and others don't even if the function doesn't return any values. I've found many tutorials where it is used and others just omit it.
2) Return 0; is another that's buggin' me...why put it on functions that don't return any values ?

Function():Void & Array
Hey all.

I wrote a function that executes an action but I haven't added the :Void declaration at the end of it because I'm trying to make it take an action and return an array if one of it's parameters are true. It's something like


ActionScript Code:
function myFunction(theXMLfile:String, calledBySub:Boolean) {
    var xml:XML = new XML();
    xml.ignoreWhite = true;
    xml.load(theXMLfile);
    xml.onLoad = function(success) {
        if (success) {
            var node = this.firstChild.childNodes;
            showInfo(this.firstChild.attributes.txtFile);
            // this function is called in any circustances
            var tempArr:Array = new Array();
            for (var i:Number = 0; i<node.length; i++) {
                tempArr.push({tag:node[i].attributes.tag, file:node[i].attributes.file});
            }
            if (!calledBySub) {
                menuAnim(tempArr);
                // again, an action is called
            } else {
                return tempArr;
                // while I want it to return an array
            }
        }
    };
}
function showInfo(txt:String):Void {
    //
}
function menuAnim(arr:Array):Void {
    //
}
It executes the functions I've commented above but it does not return anything (returns undefined). Am I trying to do something impossible?

Thanks in advance.

Function ImJustGuessing():void
My big issue now on my path to learning this program, having learned to be OK with frustration, and that deadlines are meaningless in the face of "Error #1063", is what to put in between the parens in a function. Usually I leave them blank, with ":void" following them for good measure; if that doesn't work, putting a letter like "e" in there offers some success. I don't know why, "event.Event" works occasionally.

In the end I am guessing.

The headless snake book (Essential AS 3, Colin Moock) assures that the function is more that the list between the curly braces,

So where can I learn a little more about ()?

The BLABLA = Function ():Void {
Can someone give examples of when to use Void on functions and when not to? I know from the minimal reading I have found online that you do not when the function is returning something. Thanks in advance. Please be specific if you have the time. MT

Function FunctionName():Void...
Hi There...

This one has been puzzling me for ages... I've been using a lot of friends of ed books and noticed that a lot of them use the following:


Code:
function functionName():Void {
// function goes here
}
However I have always used:


Code:
function functionName(){
// function goes here
}
I was wandering what the :Void does to a function, so far I've not found a reason for it.

Cheers,

Bob
www.bobcooper.org.uk

Void.pt Audio Panel
Hi.
How can i make that thing with opening/closing movie clip, like on void.pt
I have that as on my button:

on (press) {
holder.onPress = function() {
(!opened) ? open() : close();
};
}

but how define the open/close function ?

Void And Variable Assignment Test
Hello,

may sound stupid but I am looking for an elegant way to check whether a specific variable, object instance, or MC instance exists or not.(don't need to test all case at once of course).

I don't know if it's linked, but I can't figure out how the void( ) function can be used and what it exactly does (assignment and comparison). No real documentation from MM about it.

THANKS

Null/undifined/nan/void Difference ? **************
SITUATION:
I'm loading a movie on level 5. Before i want to start the preloader (frame 5) I want to check (frame 3) if my movie has already started downloading the movie on level 5 (so i don't have errors while calculation percentage of download in frame 5)

Now i'm not sure if the scripting i use in frame 3 is correct. is 'null' a correct parameter to check if the movie on level 5 is already downloading? Or should i use ('undefined' or isNan() or void or...)

Is there anyone who can help me clear this out??

Thanx

CODE:

frame 1:

Code:
loadMovie("mymovie.swf",5)


frame 3:

Code:
if(_level5.getBytesLoaded()== null){
gotoAndPlay(2)
}else{
// START preloader
gotoAndPlay(5)
}

frame 5:
----preloaderScript

Different Roll Outcomes, And Void Of Blank ?
several questions questions.

You put your dex in ,
click attack, the higher your dex, the more likely you are to hit.

1: it will say hit every time even if i dont put a number in, How do I change this?

2: how Do I give the damage different outcomes? so 1 = something
and 2 = something else, etc etc

3: how do I get it to clear the damage from the previous attack, so it doesnt display a damage when it is a miss on the next roll


on (release) {
var _num = random(10)+1;
var _num2 = random(10)+1;
if (_root.Dex.text >= _num) {
_root.Result_num2.text = "Damage " + _num
_root.Result_num.text = "You hit your enemy!"
} else {



_root.Result_num.text = "Missed! "
}
}



4: how to put script in box? i forgot?

Mysql Error: Void At Callfunction();
Edited: 07/28/2007 at 05:33:18 PM by Ceiling Fan

MX Tween Classes And EndTween():Void
I have had to use MX tween classes for a project. Later into the project the need for a skip button was introduced. But as we know once a tween has started it will run no matter what. So I need to interrupt the tween and make it skip to the end. I googled and found the endTween function. but I am having trouble making it work. As I understand the function its supposed to make my tweens skip to the end and be done. But I am not having any luck. I have made a test code and could really use some help!

quote:import mx.transitions.Tween;
import mx.transitions.easing.*;

var square:Object = new Tween(square_mc, "_x", Regular.easeOut, 0, 451, 5, true);

And I try to make this tween skip to the end with a button. I have tried with alot of different configurations. None of them work. This one here is just the last. But it dosent work either as stated:

quote:btn_1.onRelease = function(){
trace("button works");
endTween(square_mc);
}

E:MouseEvent):void { E.mouse_over = Boolean ?
I was doing a simple button with mouse on and over actions...

objection.addEventListener(MouseEvent.MOUSE_OVER,o bj);
objection.addEventListener(MouseEvent.MOUSE_OUT,ob j);

And then I got this idea, why not to use the sane function for both events? Then when inside the function, I could ask if the event was MOUSE_OVER or OUT?
Something like this:

function obj(e:MouseEvent):void {
Do_something()
if(e.mouse_on==true){
Do_another_thing
} else {
Restore_Cuba_democracy()
}
}

Theres someting like this availble in as 3.0? I googled a little and found nothing. Maybe I used the wrong words in search...
By the way, the Cuba Democracy is a joke. I dont know how Cuba is and I dont care too. I like because the episode where SouthPark guys done that.

}

VOID Data Type Query?
Hey guys.

Quick question.

What is the purpose of the "Void" data type?

Came across it in a tutorial. I have never used it before! Just couldn't quite see how it applied to the codes function in the tutorial?

Thanks

[F8] Button Anime... Onrelease.. Void Other Functions
I have a btn with 2 functions on it.
there is a simple rollon and rolloff animation.
I now am trying to put a onrelease function of the btn.
The onrelease will move the btn to a different location.. which causes a problem because once it moves away from the mouse it plays the roll off function...
how do i disable the rolloff functions for this section only

Thanks

:Boolean For :Void As Standard Return Type
I'm wondering, would it make sense to make a habit of returning true from functions when they succeed even if i don't plan on doing error checking? I'm thinking that instead of setting the return type to Void when a function isn't returning anything I could return either true or false depending on the sucess of the execution.

Does anyone have any opinions on this?

1067: Implicit Coercion Of A Value Of Type Void...
I've been learning about forms in AS3, and earlier this week I created my first successful form. I attempted to create another, and I'm getting this error: "1067: Implicit coercion of a value of type void to an unrelated type flash.net:URLRequest.

Function Menu(variable:string):void - Dosent Work
What am i trying to do?
i have 4 buttons, and all are animated, onRollOver, onRollOut, onPress..
So have created this function that i call from each button and set the value of variables that i use...

i have this code on level0

ActionScript Code:
var menuNo = (0);
gumb;
function menuTest(gumb:String):Void {
        if (menuNo == 0) //if no button have been pressed before
        {
            trace(gumb);
            this.gumb.gotoAndPlay("press");
            delete this.onEnterFrame;
            trace("ok");
    }//added this, thought was not the case!
    };//the code is only for 1 button
then i have a code like this on a button the button instance name is 'web_1';

ActionScript Code:
on(rollOver){this.gotoAndPlay("over");}
on(rollOut){this.gotoAndPlay("out");}
on(press){
    _root.gumb = "web_1";
    _root.menuTest(_root.gumb);
}
on the time line of 'web_1'; i have on frame X when is reached, after the button is pressed, the code like this

ActionScript Code:
_level0.menuNo = (1);//so with this, i know whitc button have been pressed last
its strange...cos trace is ok but the button wont start to play keyframe "press"

Quick Question About "function() :Void"
I've been reading a lot of flash documentation as i have begun to
learn more about actionscript.

how does a function() with ":Void" after it differ from a normal function?

I have a pause button with this script on it and it works fine, I just want to understand it.

Question About " Function Myfunction():Void { "...
I am still delving into AS, and there are a few concepts that still confuse me a little bit.

I looked up what "void" meant in the Adobe Flash AS dictionary. I understand that when an expression is wrapped in the void function, it marks it as undefined.

However, while dissecting this one flash file, I noticed a function written out in this syntax:


Code:
function functionName(v:Boolean):Void {
//function instructions here
}
Now, I know that the "v:Boolean" part is basically taking the value and giving a Boolean datatype. I am a little confused about the usage of the :Void afterwards. What is the point of this syntax?

Thanks,

Jen

What's The Point Of Writting In "void"
I noticed that a few scripts have "void:" written after them...what's the point of it?

How To Use The "void" Operator?
any examples? and what does the "side effects" mean?
here are the help info of the "void" operator in flash5:

void

Syntax

void (expression);
Arguments

expression An expression of any value.

Description

Operator; a unary operator that discards the expression value and returns an undefined value. The void operator is often used to evaluate a URL in order to test for side effects without displaying the evaluated expression in the browser window. The void operator is also used in comparisons using the == operator to test for undefined values.

Player

Flash 5 or later

Flash Script? Is Writing Flash Code Possible? Without A Flash Builder Like Flash MX
I want to get into flash programming on my website, but i do not have thecash to buy flash MX 2004, it is 499 US thats a lot of money.

Basically what i want to know is, can flash be written as code, like HTML or do i need to buy a flash builder. And if so, what can i do about learning this code

Thanx from Fenton Multimedia Designs

Flash Script? Is Writing Flash Code Possible? Without A Flash Builder Like Flash MX
I want to get into flash programming on my website, but i do not have thecash to buy flash MX 2004, it is 499 US thats a lot of money.

Basically what i want to know is, can flash be written as code, like HTML or do i need to buy a flash builder. And if so, what can i do about learning this code

Thanx from Fenton Multimedia Designs

Flash Versions Order Of Sequence : Flash 5, Flash MX, FlashMX 2004?
some questions on FLash versions

After Flash 5 was FlashMX then followed by FLashMX 2004 ???

which means Flash MX is version 6??

thanks for answering.

Can You Open A Flash File Made With Flash Mx, Using Flash Mx 2004?
Hi,

I have recently purchased flash mx 2004. However when I go to open my old flash mx flies in flash mx 2004 all I get is unexpected file format! Why is this? Also when I open flash mx 2004 and try to open one of the sample files it comes up with the same message!

Also when you download and install an extension from macromedia exchange, how do you then use the extension feature in flash? Were do you find it?

Any help on these matters would be appreciated?

Thank you

How Do You Update A Flash Object Without Flash? Selling A Flash Site.
I am wondering what may be a large wonder. If I create a website with flash etc for somebody else, how can they update their own site? For example, if they have an 'updates' page, I don't want to have to keep on redoing it for them in Flash. I heard words like 'strings' and 'XML' kicking about, but don't really understand it. Thanks,

Alex

Making A Flash Website (flash In A Flash In A Flash Etc...)
I am working on a flash "database" as it's called and to make this possible I will need to have multiple flash documents that load within a flash to keep the loading time down, otherwise the filesize would be astronomical!

To see what I am working on go to http://www.axeldesigns.com/h2/helpdatabase then click "menu button" to open the project. Hopefully then you can get a good sense of what I am trying to accomplish...So when you click on the individual links, I want a flash within the main flash to load completely on top with it's own load bar and everything.

I'm not very experienced with action scripting, but I am quite experienced with the animation side of flash and drawing tools etc...

So, if anyone knows of any tutorials or examples that I could work off of, please help me out.

Alex

Will An Swf Made In Flash MX That Is Exported As Flash 4- Play On Flash 4 Cpu's?
Will an swf made in Flash MX that is exported as Flash 4- play on Flash 4 cpu's? How do I get my mx movies compatible with people who only have Flash 4???? I ask this because I exported a movie made in Mx to Flash 4, so I am just wondering if it will play on all Flash computers that have Flash 4, eventhough they may not have flash 5 or mx. Thanks...

Updating Flash 4 Code To Flash MX 2004 Or Flash 8
Can Flash MX or Flash 8 automatically update old flash code or update depreciated code? I have a flash 4 project that when resaved as Flash MX 2004, obviously starts to throw errors.

Flash 8: Button For Flash Paper In A Flash Presentation
I am new to Flash. I have a presentation I am putting together.  I need a button to open a Flash Paper (Flash Papers 2) .  

How do I do this?
Does anyone sell premade buttons?

Thanks!
 

Flash Over Html, Hide Flash Access Html After Flash Movie Ends
We've got a green screened video playing in a flash movie over top of our html content.

when the movie ends, flash uses external interface .api to call a javascript function which swaps the flash movie out with a 5 x 5 pixel flash movie (rewrites the <div>).

this works and you can interact with the html content after the flash movie in all browsers except firefox...!

anyone know of any work-arounds or is there a better way of handling flash over html in this fashion?

any input would be greatly appreciated!

HOW DO YOU CHANGE THE BG OF THE FLASH THING ON FLASH KIT W/OUT USING FLASH?
Plz tell me because I am making a little kid's website and they'll b sad if doesn't match the flash.

Yikes, Can I Go From Flash MX To Flash MX 2004 To Flash MX?
I have flash MX on my computer here at home, I went on campus to edit a file in a class in Flash MX 2004, now I am trying to reopen the file in Flash MX here at home again and it won't allow me to open it, saything there is an unexpected format error.

Is this caused from opening it in Flash MX 2004? Is there a way to revert the file back to Flash MX? Yikes!

Flash/CSS Question: Can Flash In A <div> Overlay Another <div> Containing Flash?
I'm guessing this answer is no but thought I'd ask anyway.

With the "wmode" set to transparent I can get my top div to overlay text/background images no problems but not on top of another flash movie.

Can it be done?

Flash 8 Function Not Working In Flash 8 But In Flash 9
I use this piece of Code from Senoculars Matrix Tutorial:


Code:
import flash.geom.Matrix;
function duplicateMovieClipImage(from, target){
var pics= new flash.display.BitmapData(from._width, from._height);
pics.draw(from);
target.attachBitmap(pics, 1);
}
duplicateMovieClipImage(this.viewer.picHolder, doubleSize.bigpic);
var my_matrix2 = doubleSize.bigpic.transform.matrix;
my_matrix2.scale(1, 1);
my_matrix2.tx = -2;
my_matrix2.ty = -2;
doubleSize.bigpic.transform.matrix = my_matrix2;

duplicateMovieClipImage(viewer.picHolder, normalSize.bigpic);
var my_matrix = normalSize.bigpic.transform.matrix;
my_matrix.scale(0.25, 0.25);
my_matrix.tx = 0;
my_matrix.ty = 0;
normalSize.bigpic.transform.matrix = my_matrix;
When I play this in a Flash 9 Player everything is made correct (A Pic generated in its Original Form and one in its 0.25/0.25 Size.

But when I watch this in a Flash 8 Player (8.0.22.0 that is)

the Script is ignored

any1 know why???

Firefox Recognizes Quicktime As Flash Player Instead Of Flash As Flash Player
I don't know why when I go to websites and all those old Flash sites don't work anymore, but I get the "Quicktime Question Mark" logo. I've tried reinstalling Flash Player so many times but the quicktime logo keeps coming up. I've tried this both with Firefox and Safari and it just doesn't work.

Nested Function Locks Flash On 2nd Frame. Cold Fusion Problem Or Flash MX ? Or Me?
It's been three days I don't sleep. Anybody,please,.....

// Flash MX code 2nd frame

stop();
validatePackage = new LoadVars();
validatePackage.onLoad = function() {
if (validatePackage.success == "0") {
setPackageCheck = new LoadVars();
setPackageCheck.onLoad = function() {
_root.packageCheck.text = setPackageCheck.packageCheck;
_root.unlockCheck.text = setPackageCheck.unlockCheck;
_root.gotoAndStop("exPrep");/* without this line
everything works perfectly !!!!!. WHY ! I mean I have other functions sending time line somewhere else accordint to if statments and it works fine!*/
};
setPackageCheck.accountID = _root.accountID.text;
setPackageCheck.sendAndLoad("setPackageCheck.cfm", setPackageCheck, "POST");
} else {
_root.packageCheck.text = validatePackage.packageCheck;
_root.unlockCheck.text = validatePackage.unlockCheck;
_root.vdDays1.text = validatePackage.vdDays;
_root.vdHours1.text = validatePackage.vdHours;
_root.vdMinutes1.text = validatePackage.vdMinutes;
_root.gotoAndStop("exPrep");/* without this line
everything works perfectly !!!!!. WHY !*/
}
};
validatePackage.accountID = _root.accountID.text;
validatePackage.sendAndLoad("validatePackage.cfm", validatePackage, "POST");


<--- "validatePackage.cfm"--->

<cfquery name="validatePackage" datasource="dsn">
SELECT packageCheck, unlockCheck
FROM accounts
WHERE accountID=#form.accountID#
</cfquery>
<cfif validatePackage.packageCheck lt 1>
<cfoutput query="validatePackage">
&success=0&
&unlockCheck=#urlencodedformat(validatePackage.unl ockCheck)#&
</cfoutput>
<cfelse>
<cfset vdDays=#DateDiff("d",#validatePackage.packageCheck #, now())#>
<cfset vdHours=#DateDiff("h",#validatePackage.packageChec k#, now())#>
<cfset vdMinutes=#DateDiff("n",#validatePackage.packageCh eck#, now())#>
<cfoutput query="validatePackage">
&packageCheck=#urlencodedformat(validatePackage.pa ckageCheck)#&
&unlockCheck=#urlencodedformat(validatePackage.unl ockCheck)#&
&vdDays=#vdDays#&
&vdHours=#vdHours#&
&vdMinutes=#vdMinutes#&
</cfoutput>
</cfif>

<--- "setPackageCheck.cfm"--->

<cfquery name="setValues" datasource = "dsn">
UPDATE accounts
SET packageCheck= #now()#
WHERE accountID=#form.accountID#
</cfquery>
<cfquery name="setPackageCheck" datasource = "dsn">
SELECT packageCheck, unlockCheck
FROM accounts
WHERE accountID=#form.accountID#
</cfquery>
<cfoutput query="setPackageCheck">
&packageCheck=#urlencodedformat(setPackageCheck.pa ckageCheck)#&
&unlockCheck=#urlencodedformat(setPackageCheck.unl ockCheck)#&
</cfoutput>

[MX04] Open A New Link In Html By Clicking Button In Flash (no Code In Flash).
Hi,

I'm facing problem while opening a new html window by clicking button created in flash.

For this i don't want to write single code in flash but want to handle this through the html only.

For this I have used <embed> tag to add swf file in html. but could not add click code in HTML on that button.

Could any one help me out?

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