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




Function + Pointers



I have a loop and I am trying to create dynamic functions, each which contains a different variable. The problem is, once the loop finishes, it references the function created last.

I trimmed the code down below, but it should illustrate what I am trying to do.

Code:
// start segment
for(var j=0;j<ary.length;j++) {
var img_mc:MovieClip = new MovieClip();

var temp_str:String = "testing_" + j;
launchBanner(img_mc,temp_str);
}

// end segment

function launchBanner(object:MovieClip, temp_str:String):void {
var f:Function = new Function();
f = function(e:MouseEvent) { trace(mc_url); };
object.addEventListener(MouseEvent.CLICK, f );
}



KirupaForum > Flash > ActionScript 3.0
Posted on: 11-27-2008, 11:09 AM


View Complete Forum Thread with Replies

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

Functions And Function Pointers Etc...
hi all, as actionscript is quite high level language, i dunno whats goin on in the background when i do stuff, so i'd like to know the difference between trying to achieve the same effect with different code. E.g. i have a function which adds code to a movieclip to make it behave like a custom button.

now my question is, are the two following chunks of code IDENTICAL in how they work? (i know they EFFECTIVELY do the same thing, but internally is it the same)

function MakeButton(mcItem) {
mcItem.onRollOver = function() { this.TheGlow._alpha = 80; }
mcItem.onRollOut = function() { this.TheGlow._alpha = 20; }
}

MakeButton(mc1);
MakeButton(mc2);
MakeButton(mc3);

COMPARED TO:

function ButtonRollOver() { this.TheGlow._alpha = 80; }
function ButtonRollOut() { this.TheGlow._alpha = 20; }

function MakeButton(mcItem) {
mcItem.onRollOver = ButtonRollOver;
mcItem.onRollOut = ButtonRollOut;
}

MakeButton(mc1);
MakeButton(mc2);
MakeButton(mc3);

if I called the MakeButton function only once, I'm pretty sure both chunks of code would behave the same. My confusion arises when i call the MakeButton function many times. In the first chunk, is it gonna recreate the sub functions everytime? or juz make the rollover and rollout point to the same functions as the previous instances?

cheers,

Pointers/Refs In OnEnterFrame Function?
Here's the problem in a nutshell: I have a class that creates an anonymous (and autonymous) function. How can I make the function aware of changes made to properties of the class that created it?

Here's the setup:

I have a custom class object (singleton) with a property; the class object also creates an onEnterFrame function within its containing movieclip, and passes the property value in as an argument to the function. So far, no problem.

Here's the problem: an external component changes the value of the property. I'd like the onEnterFrame function to reflect this change. Normally I'd pass the property as a reference (instead of a value) to the function, but pointers don't exist in AS2 that I've seen.


I tried this:


class scripts.MyClass {private var __n:Number = 20;
public function get n():Number {return __n;}
public function set n(newN:Number) {__n = newN;}
public function MyClass() {// we want n to trace every time the frame updates
_root.onEnterFrame = function() {// neither of these work:
trace(n);
trace(__n); };}}
Both n and __n are undefined when you run the code. I can cheat of course by having the getter/setter write the value directly to the containing clip (in this case, _root), and calling trace(_root.n), or by redefining the onenterFrame function every time the property changes, but that pretty much breaks the whole point of OOP, now, doesn't it?

Is there a way to do this???

Actionscript Pointers? (not Mouse Pointer, I'm Talking About C++ Style Pointers)
okay, so i have a function that i want to manipulate the global variables x and y in this way:

var x:Number = 45;
var y:Number = 32;

manipulate(x,y); //some stuff goes on here

trace(x+" "+y); //this will show completely different numbers in both X and Y.

how would you go about making such a function? and how would you use it?

thanks!

OOP Pointers
Hi,

I was wondering if someone could give me a few pointers on my code. I've programmed an OOP game - shooting gallery thing as a self teach and it's working great, I just wonder if there's an easier, more elegant way to code some of it. Here it is:

Code:
MainBaddie = function() {}
MainBaddie.prototype = new MovieClip();

MainBaddie.prototype.onEnterFrame = function() {
// if it's out of energy then die
if ((this.energy <= 0) && (this.played == 0)) {
this.played = 1;
this.gotoAndPlay(2);
_root.badindex--;
}
// moves it
if (this._x > 550) {
this._x = 0;
} else if (this._x < 0) {
this._x = 550;
} else {
this._x += this.moveby;
}
this.txt = this.energy;
}

MainBaddie.prototype.onPress = function() {
// clcik it and it looses energy
if (this.played == 0) {
this.gotoAndPlay(8);
this.energy -= 1;
_root.shots--;
}
}

// two different MC's for BadGuys
Object.registerClass("ufo", MainBaddie);
Object.registerClass("ufo2", MainBaddie);

//is there an easier way of doing this?
for (n=1; n <= 3; n++) {
_root.attachMovie("ufo", "BadGuy" + n, n);
}
for (n=4; n <= 5; n++) {
_root.attachMovie("ufo2", "BadGuy" + n, n);
}

for (j=1; j <= 5; j++) {
_root["BadGuy" + j]._x = (Math.random() * 350) + 100;
_root["BadGuy" + j]._y = (Math.random() * 200) + 100;
_root["BadGuy" + j]._xscale = 200;
_root["BadGuy" + j]._yscale = 200;
_root["BadGuy" + j].played = 0;
_root["BadGuy" + j].moveby = (1-(random(2) * 2)) * (random(20) + 11);
//could this be made better?
if (j < 4) {
_root["BadGuy" + j].energy = 5;
} else {
_root["BadGuy" + j].energy = 10;
}
_root.badindex++;
}
Any pointers would be really appreciated.

For example I have two different graphics for the bad guys and as you can see BadGuys 1 to 3 have 5 energy and 4 and 5 have 10 energy. Is there a way to set the energy depending on the name of the MC?!?

Thanks for looking.

Cheers,

Stu

Pointers In AS
This is for a radio button component. In this setInterval call I want to pass a pointer to type_val instead of the value of it. What is weird is that the outerloop value of "value" never changes when I press different buttons but the inner trace of "value" will change when I reassign it. The problem resulting is that changing radio buttons will result in value never equaling groupName.getValue() because value isnt changed.

code:
type_val = Mtype.getValue();
setInterval(checkTypeChange, 500, Mtype, type_val);
stop();
function checkTypeChange(groupName, value)
{
trace([groupName.getValue(), value]);
if (groupName.getValue() != value)
{
value = groupName.getValue();
trace(value);
}
}



I can attach an .fla if needed to explain this better. Thanks

**I found a way around this problem but I am still curious on how to do it.

Pointers In AS
I'm using MX Pro 2004, does the AS have the ability to handle pointers? I am trying to optimise some code and this would be a great help.

Looking For Some Pointers
I'm trying to create a quick little website for some friends who are off on their travels in a week or 2 and am looking for someone to point me in the right direction for how to do what i'm after....

I'd like it so that they can upload photos and text onto a server and these images and text load into this sort of a website in the picie attached

so first up for the viewer is a photo then you click the photo and it changes to text about the photo
or you can hit buttons to the left or right to load new photos

hope i got my point across....
any idea where i can find a tutorial on what i'm trying to do ?

thanks

Pointers In As3
i don't know if this is even possible in as3. but in c++ you could have a pointer to an object and then store that pointer in another object.
i want to create an instance of a class, that creates another instance of a class, with a pointer to the first instance. so that it's easier to reach other objects within the stage. maybe as3 has something for this problem, but i couldn't find it in the reference or help.

thank you.

Pointers
Say I create 2 sprites.

var s1:Sprite = new Sprite();
var s2:Sprite;

Then I set s2 = s1. Now, when I alter any properties of either s1 or s2, the property of both instances changes.

So what is s2? s1 is a sprite instance, is s2 also a sprite instance or simply a pointer to the sprite instance s1?

Thanks!

Pointers
Hello, is there a way to use pointers in flash? I couldn't find anything in the help panel. But I just want to point to characters in a static text box. I'm lost as to how to start.

Example:
static text box: "Hello"
I want to point to each char. individually

Thanks

Pointers
I need a pointer from somebody as to creating pointers

I enter
var a:int = 9;
var b:int = a;
a=7
trace(a + " " + b);
and get
7 9

which is what I'd expect, but is there anything I can do to have 'b' become a pointer, so that it would show 7 7?

It's not really like i need this, but I'm wondering how I could improve memory usage, and want to be clear on when a variable is a variable and when it is a pointer.

when I create a class, and cannot refer to the parent by simply reffering to a parent, I create a variable that holds the parent class and pass the parent in the constructor

ActionScript Code:
class a
   var _b:b
   var c:int
   function a(){
     _b=new b(this)
   }
}

class b
  var _a:a
  function b(_parent:a){
    _a = _parent
  }
}
in this case I can refer to my variable c from class b and it will retrieve it as what it is, class b doesn't create an instance of the class a but a reference to it. (I think)

what is the difference?
Any opinions on this ?

Pointers?
Hello when i pass an object in my methods do i pass a pointer to this object or is it the object its self.

Thanks for taking your time reading this post.

Pointers?
Do they exist in AS3? Still on the idea of trying to create "mirrors" for vector art (working with BitmapData in the meantime) and I'm thinking of exploring holding Drawing API instructions in a data object and having displays be pointers to it?

A very vague concept but I'm stabbing in the dark till I hit something, I'll worry about what that something is when the lights come on...

Pointers
Hey out there;
Now that I'm close to publishing and moving things onto the net, I'm wondering if you all have some advice on the published settings one should use. I'll be using many bitmaps, VOs, MP3 tunes, all for the broadband web. Are there certain settings one should use to keep down file sizes, ect? Files sizes now range from 3 - 6MBs.

In other words... there are default settings in flash MX, but are those "better than is necesary" for a website at 72 dpi?

Thanks
Hoss

Complicated, Need Pointers ..
I've been Flashing for a few years, but I've never really gotten into the difficult stuff. I'm a complete newbie to ActionScripting, and that's what I need to ask about ..

What I need is some pointers/info on an AS that will randomly duplicate one of four movie clips, and move them in an elliptical path, but varying slightly on the X and Y axes while following the path.

So far, I've been able to get one clip to move on an elliptical path using a slightly tweaked circular motion AS, but I'm pretty bad with Trig, so I can't figure out how to get the slight variance in the path.

FLA: http://www.as.uaf.edu/~fsjrn2/one.fla
SWF: http://www.as.uaf.edu/~fsjrn2/one.swf

Thanks to anyone who can help me out on this. =P

--
CRC.Error
--

Bubbling Pointers?
How do you make the pointer of the mouse look like it is trailing things like bubbles or flowers etc.? an example of this is http://www.barbie.com where flowers trail the mouse.

Question About Pointers
hi

iam trying to image this site http://www.signumprojects.de/
for learning purpose but iam stuck at a point
i will send the fla to the person who is ready to help me
i am stuck at the point where litle triangular shape thingy moves wher were u move in the x axis thank u bye

Mouse Pointers
How do you get it so you move your mouse on the flash and thepointer gos right to your pointer i have tohave it so you clikc on the end and it then turns into your mouse but it want its so you move your mouse on to the flash ad it puts the poiter under the desired symbol
ps by the way i work on flash 5

Actionscript Help/Pointers
Hi,

Was hoping someone can help me as I have little experience with Actionscript and I cannot seem to get my head around this navigation I am trying to design.

Firstly the file attached has 5 buttons each of which when clicked will open an external movieclip of a menu opening and closing.

When the menu is on its open state, it can only be closed by clicking the button on the opened menu OR by clicking any other button- which will result in the menu closing before another one is opened.

(only 1 of the 5 menus can open at any 1 time - so any that are open will close if another is clicked)

Lastly, when a menu button is opened, the button that opened it will either stay dark or not be selectable again until another button is clicked.

Catch my drift, would really apreciate some input people!

Actionscript Help/Pointers
Hi,

Was hoping someone can help me as I have little experience with Actionscript and I cannot seem to get my head around this navigation I am trying to design.

Firstly the file attached has 5 buttons each of which when clicked will open an external movieclip of a menu opening and closing.

When the menu is on its open state, it can only be closed by clicking the button on the opened menu OR by clicking any other button- which will result in the menu closing before another one is opened.

(only 1 of the 5 menus can open at any 1 time - so any that are open will close if another is clicked)

Lastly, when a menu button is opened, the button that opened it will either stay dark or not be selectable again until another button is clicked.

Catch my drift, would really apreciate some input people!

Actionscript Help/Pointers
Hi,

Was hoping someone can help me as I have little experience with Actionscript and I cannot seem to get my head around this navigation I am trying to design.

Firstly the file attached has 5 buttons each of which when clicked will open an external movieclip of a menu opening and closing.

When the menu is on its open state, it can only be closed by clicking the button on the opened menu OR by clicking any other button- which will result in the menu closing before another one is opened.

(only 1 of the 5 menus can open at any 1 time - so any that are open will close if another is clicked)

Lastly, when a menu button is opened, the button that opened it will either stay dark or not be selectable again until another button is clicked.

Catch my drift, would really apreciate some input people!


K

Need Pointers For Starting...
Hi!

I'm currently thinking about developing a Flash app that will:

1. Allow a user to import an external image
2. Display the image in a thumbnail
3. Display the height and width of the actual image size

... and so on, adding a host of options to meet my requirements.

I've tried looking around for tutorials but found nothing that can cover the first three steps of my app. Is it actually possible to get flash to load an external image on demand and display it in such a thumbnail way with height/width .... ???

If anyone can point me in the right direction on how to get even started on this it would be most appreciated!

Thanks
z3ph.

Pointers And References?
Hi,

How do I create a pointer or reference variable? I tried using & and *, but none of them seems to work.


Code:
var a = 123;
var b = &a;
b = 456;
trace(a);


I want to set the variable b as a reference or pointer to a such that any changes made to b will be made to a. Therefore, the expected output of the above code will be 456.

Thanks in advance.

Justin

Pointers In ActionScript? (2.0)
Hiya,

I have a set number of coordinates, and I want to go through all those coordinates by using a loop. The problem is whenever I push a coordinate into an Array, it creates a duplicate of the coordinate object into that array, instead of a pointer to the coordinate. And thus from the moment I modify the coordinate, the data in the Array is outdated. (see example).

Does anyone know how to fix this so the array stores pointers to the objects instead of duplicates of the objects?

Thanks!



Code:
this.Cor1 = new Vector(0,0); //x,y
this.Cor2 = new Vector(0,0);
this.Cor3 = new Vector(0,0);
this.Cor4 = new Vector(0,0);
Corners.push(Cor1, Cor2, Cor3, Cor4);

Cor1.x++;
//OUTPUT : Cor1.x = 1 / Corners[0].x = 0

Mouse Pointers
I would like to make a mouse pointer feature to a flash project I am doing but I don't know how to do it. I would like to have a picture(of a hand) follow the mouse as it moves. Could anyone help me do this?

moo

[MX] Can Anyone Give Me Some Pointers?
Hi,

Im new to these forums and new to Flash as a whole. I do have pretty good knowledge of other web-technologies like php, javascript and html but im almost a total newbie to Flash.

Anyway I am trying to develop a certain kind of website, I will try to describe what im trying to acomplish as good as possible.

I want to write a "program" where users can combine images (drag and drop) to create their own pictures. These images will be uploaded to my webserver so they need to be read dynamicly, the user should also be able to upload their own images. First teh user specifies a background and then place different images on top of the background on different layers.

I would also like the program to get these images from a database (MySQL) and would ultimately like to save the completed image to an image file.

As I said I am pretty new to Flash, I have done some basic things like adding symbols and click events etc. What I would like is some recommendations on where I should start. What kind of techniques should i use to do what i described above? Any kind of help would be very aprechiated.

Can Someone Give Me Some Pointers On How To Do This..
http://www.pedro-verhue.be/

1.The Site resizes to the size of the screen - How is this done?

2. The site has images in it and these also resize to the size of the site. - How is this done?

I have been taught flash (a few years ago) to create a set movie size and all images i would load in or use would be a a set size as well.

What is the best way to go about creating a site like this for displaying images, one that resized though so you can use the whole screen in a fullscreen browser / or just a normal browser window?

Thanks for any pointers whatsoever!
JH

[MX] Pointers To Improve
Hi all I have a flash animation that I have attached which works fine but I feel that I am doubling work where I don`t need to and I can`t make changes to some things without changing the whole symbol. Why this happens I don`t know, I would be very grateful if someone could give me some pointers as to where I can improve the animation to save time and have more control over individual symbols(movieclipos versus graphics for example) which will help me in all my flash projects.


.fla file (378k)
Thanks!

[help] Pointers/arrays
I'm trying to access variables that I've defined inside movie clips from the parent of the movie clips, with an array of pointers to each movie clip (I'm assuming when I use the expression myVariable = attachMovie(...), myVariable is a pointer?)
myArray.push(myVariable);

unfortunately, trying to access the variable inside: myArray[index].variableInside doesn't work; it says it is undefined. I'm guessing this is because I'm somehow trying to access variables assigned to the pointer object rather than the variables of the object the pointer points to maybe? If this is the problem, how do I dereference a pointer in actionscript?

Pointers For A Newbie ?
New to flash but its impressed me for so long with what it can do but its always scared me as to how to create flash files.

I have a requirement now to create one and I was hoping for a few pointers as to what I need to do, look at, read.

I guess I can split my objective into 4 different parts. Any help on any part would be great.


Part 1
I want to load 2 external images into the flash and overlay them one on top of the other. They will be gifs with areas of transparency on. All I want to be able to do is drag them around to see how they look.

For example I have a picture of a car and a picture of some graphics, I want to be able to move drag the images around to see how the graphic looks on different parts of the car.


Part 2
I need to be able to zoom in and out of the overlayed images. I also need now to rotate the images as well as drag them. Rotation can be via a button so its easier then free rotating. I also need the rotation angle and the distance the images have been moved by ( 2 dimensions, horizontal and vertical )


Part 3
Both the image files will be the same size in terms of actual image dimensions and also taken with the same scale. I will have a text file with 2 numbers in. This will indicate to me the 'scaling' of pixels to mm. Based on the number of pixels that images have been dragged I would be able to calculate in real life how far the images would have been moved.

Part 4
I need to be able to take dimensions from the flash. So the user would select a dimension button and then he would click 2 points on the image. This would feedback the actual dimension in terms of 'as the crow flies' and horizontal and vertical.

So really I envisage a 'working space' with the 2 images in and a tool palette thing with would give me the options of move, rotate, zoom and measure. Finally there will be a text output for feedback to the user ( distances, angles etc).

I don't want to come across as rude or demanding, I simply need to try and code something that will portray whats indicated above. If anyone can give me some pointers or offer some help that would be fantastic. Any pointers on any of the separate areas would be great.

Thanks and Regards
S8utt

Array Pointers
Hi I have an array in one class and I'm passing it into another class such as this

PHP Code:



var myArray:Array=new Array("asdf");
var newClass:MyClass = new MyClass(myArray); 




I'm then splicing the array in the new class. Does flash have a pointer back to the original array even tho in the new class I'm declaring a completely seperate array as a private class variable and assigning the array to that? Because when I splice the array in the new class It's splicing it in the old one also.
What i had to do to remedy the situation was something like this

PHP Code:



private var newArray:Array;
class MyClass{
function MyClass(myArray:Array){
newArray=new Array();
for(var i:Number=0; i<myArray.length; i++){
newArray.push(myArray[i])
}





after i did this it worked, but i didnt know flash to make pointers in this way
please advise

Pointers And Copies
Is there a way to set a variable to point to an array, rather than copy the current contents of the array into the variable?

example: when I declare a variable currentList, and then set it equal to an already declared array (with elements in it). When i push information to the declared array, i would like the currentList to know of the new information (rather than keeping the information from when it was assigned).

Pointers And References In AS3?
I'm confused.

I want to keep performance to a max from the start of this project (it's always a pain to go back later) and I'm wondering how Flash (specifically AS3) handles the classes. For example, when I set an existing variable to a already made one, does it copy, or just point to it?

I have classes that should be accessible by many classes, but I'm not sure how this stuff works in AS.

If anyone could explain how Actionscript handles that would be great, and links appreciated as well. Thanks!

Number Pointers
I want to pass a variable pointer to another class, not just the value.

I created a numberPointer class which is essentially an object with one variable.
it works... but is there any other way that I haven't considered?

I don't like how you cannot define whether you want to pass a pointer or the value, but I'm getting used to it. It would be nice doing away with having to create functions that have to iterate through the structure to clone objects.

Toggle Pointers
I am trying to have a pointer change after pressing a button and then change back to the default cursor after pressing the button again. After pressing it the cursor changes gloriously, but i can't get it to change back. Here is my code:


Code:
on (press) {
if (pan = 1) {
_root.pointer.attachMovie("panpointer","nn3",53);
_root.pointer.startDrag(true,0,0,800,600);
Mouse.hide();
pan = 2;
stop();
} else if (pan = 2) {
_root.pointer.stopDrag();
panpointer.removeMovieClip();
Mouse.show();
pan = 1;
stop();
Would appreciate the help on this. Thanks!

Actionscript Help/Pointers
Hi,

Was hoping someone can help me as I have little experience with Actionscript and I cannot seem to get my head around this navigation I am trying to design.

Firstly the file attached has 5 buttons each of which when clicked will open an external movieclip of a menu opening and closing.

When the menu is on its open state, it can only be closed by clicking the button on the opened menu OR by clicking any other button- which will result in the menu closing before another one is opened.

(only 1 of the 5 menus can open at any 1 time - so any that are open will close if another is clicked)

Lastly, when a menu button is opened, the button that opened it will either stay dark or not be selectable again until another button is clicked.

Catch my drift, would really apreciate some input people!


K

Pointers And References
Hello.
Is there any way to get the address of a variable etc like in c/c++?

Like:
var someRef = &_root.as['someVar'];

or

function whatnot( var *someVar ) { ... }

My initial tests shows that flash makes copies of everything, even selfsefined objects! Surely there must be support for something else...

Memory/Pointers
In c/c++ you can pass a pointer to a variable's location in memory. Is there something equivalent to that in AS3?

Actionscript Help/Pointers
Hi,

Was hoping someone can help me as I have little experience with Actionscript and I cannot seem to get my head around this navigation I am trying to design.

Firstly the file attached has 5 buttons each of which when clicked will open an external movieclip of a menu opening and closing.

When the menu is on its open state, it can only be closed by clicking the button on the opened menu OR by clicking any other button- which will result in the menu closing before another one is opened.

(only 1 of the 5 menus can open at any 1 time - so any that are open will close if another is clicked)

Lastly, when a menu button is opened, the button that opened it will either stay dark or not be selectable again until another button is clicked.

Catch my drift, would really apreciate some input people!


K

Pointers And References
Hello.
Is there any way to get the address of a variable etc like in c/c++?

Like:
var someRef = &_root.as['someVar'];

or

function whatnot( var *someVar ) { ... }

My initial tests shows that flash makes copies of everything, even selfsefined objects! Surely there must be support for something else...

Publishing Pointers
Hey out there;
Now that I'm close to publishing and moving things onto the net, I'm wondering if you all have some advice on the published settings one should use. I'll be using many bitmaps, VOs, MP3 tunes, all for the broadband web. Are there certain settings one should use to keep down file sizes, ect? Files sizes now range from 3 - 6MBs.

Thanks
Hoss

Pointers To Objects?
So I'm sick of typing out _parent._parent.objname.blahblah to get to an object. Is there anyway I can make like a pointer to that object, so I can just type in pointername.doAction(); instead of all that other stuff?

Thanks!

-Drew

Assigning Array Pointers
OK, I'm kinda stuck here...

I'm trying to do something like this:

"1" is the instance name of mc1
"2" is the instance name of mc2

in the first frame:
thisArray = new Array();
thisArray[0] = eval("1");

in the next frame I'm trying to shift the first array element to another mc - like this:

thisArray[0]._x = 500;
thisArray[0]._y = -1000;
thisArray[0] = eval("2");
thisArray[0]._y = 250;

Unfortunately, it's not working -- is this because I'm trying to do it in one frame?

Cheers,

Mike

Evil Hidden Pointers
they're probably shunned, but i think i need them... the site i'm working on has quite a few small movie clip buttons with text and i'm finding that the default hand pointer gets in the way of reading this text... i've seen before (but can't find tutorials or threads covering) buttons that allow the users preferred pointer (in most cases the standard arrow) to remain up while over a button... i've been able to make the pointer disappear completely, but i can't live with that!!! can someone help me with this (if i'm even making sense???) thanks...

dan'l

Christmas Present Pointers
Hi all,
Wonder if you can help me out - I've been given the task of designing an electronic Christmas greeting which will be sent out to our customers - the general idea is that a Christmas present (box) will open, and a bunch of our brands will pop out, followed by the greeting itself appearing on screen. My knowledge of Flash is definitely at the "novice" stage, but I'm fairly proficient in photoshop, and have illustrator and cimema 4dxl at hand if necessary - all I'm after is some pointers - the best practise so to speak!
Would you recommend designing the whole thing in photoshop, or should I just use the tools in flash to create it all? I'm aware this is a bit of an open ended question (I have searched the forum guv, honest) but any pointers at all would be most welcome - couldn't seem to find any tutorials concerning this type of animation.
Anyway - thanks in anticipation!
Mark

How Do I Do This... C++ Type Pointers In Flash
Hi everyone, I am veteran C++ programmer and new to flash. Kind of stuck here trying to populate an object with elements from an Array. Very easy in C using pointers but can't figure out a way of accomplishing it in Flash. Your help is greatly appreciated.

/* Trying to populate my_lv object with array elements so that I may submit it to a php script via LoadVars.sendAndLoad for processing
*/

// The array itself
var myArray:Array = new Array();
myArray[name] = "John Doe";
myArray[age] = 25;
myArray[height] = 70";

// The object declaration
var my_lv = new LoadVars();

// Loop to go through array elements and populate the LoadVars object
for (everyelement in myArray) {
trace ("myArray[" + everyelement + "] = " + myArray[everyelementname]);

// THIS IS WHERE I AM GETTING STUCK!!!
my_lv. & everyelement = myArray[everyelement];
// the & everyelement does not work because it makes no sense. Can someone please point me in a direction where I can make sense of it. Thanks.
}


BTW, the myArray.toString() function will not work for me because it only returns back the array data with the pointer name.

Thanks,
Mansoor Lakhani.

First Flash Site... Need Some Pointers.
So I am making this site for my friends wedding. So far I am pretty pleased with the results... But I've noticed the way the intro movie is displayed on different machines can be completely different.

On my machine, with a high resolution, the intro picture/music works very nicely and smooth. On a friend's mac, it looks like crap though.

www.cantwejustcuddle.com/wedding/index.html

I have only the picture link working... Which brings me to my question... I want to do a slideshow of the pictures with music. Is there any tips or pointers anyone can offer me to ensure a smoother transition between pictures?

Thanks!

[F8] Array Messing Up Pointers
I've attached MovieClip Loader.as as a .txt file If my information isn't sufficient enough.

I'm trying to make it so each image has it's own loading bar.
The images load fine, the loading bars all end up on the last image.
I'm not even sure if there's 4 there or not, the rest seem to vanish from the array list.
I'm adding a rectangle to use for the loading bar.

Here's how I start out:


Code:
#include "MovieClip Loader.as"
loadMovieClip("car.jpg", mc1);
loadMovieClip("clouds.png", mc2);
loadMovieClip("car2.jpg", mc3);
loadMovieClip("house.png", mc4);
The rest of the code you'll see is in "MovieClip Loader.as"

Here's the variables I use at the top of the .as file:

Code:
var _MCL = new MovieClipLoader();
var _mc_width:Number;
var _mc_height:Number;
var _MCLLoading = [];

Code:
loadMovieClip = function(File:String, MC:Object, Width:Number, Height:Number){
_MCL.loadClip(File, MC);
_mc_width = MC._width;
_mc_height = MC._height;
_MCLLoading[MC._x, MC.y] = this.createEmptyMovieClip("rect_"+MC, 5);
drawRectangle(_MCLLoading[MC._x, MC.y], _mc_width, 5, 0xAAAAAA, 100);
_MCLLoading[MC]._x = MC._x
_MCLLoading[MC]._y = MC._y
trace(_MCLLoading[MC._x, MC.y] + " = " + MC);
}
the trace at the bottom of that prints out this:

_level0.rect__level0.mc1 = _level0.mc1
_level0.rect__level0.mc2 = _level0.mc2
_level0.rect__level0.mc3 = _level0.mc3
_level0.rect__level0.mc4 = _level0.mc4

I trace the same thing again in the onLoadStart function:

Code:
_MCL.onLoadStart = function (targetMC)
{
trace(_MCLLoading[targetMC._x, targetMC.y] + " == " + targetMC)
var loadProgress = _MCL.getProgress(targetMC);
_MCLLoading[targetMC._x, targetMC.y]._xscale = Math.round(loadProgress.bytesLoaded/loadProgress.bytesTotal*100);
}
This is what the trace outputs:

_level0.rect__level0.mc4 == _level0.mc1
_level0.rect__level0.mc4 == _level0.mc2
_level0.rect__level0.mc4 == _level0.mc3
_level0.rect__level0.mc4 == _level0.mc4


Anyone have any idea why the _MCLLoading list is changing? I don't change it anywhere else other than the loadMovieClip function I made. I don't remove it or delete it anywhere either.

Streaming Songs > Need Some Pointers
Hi - I want to learn how to stream multiple songs on website. I need a play button, stop button, and forward track, and back track buttons...and basically just stream the songs. Can someone point me to a good tutorial to do that? And I don't want to use a pre-built player. Thanks

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