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




I Just Can't Get My Head Around Targets



Hi,

I am trying to make a button load a MC into the place of an existing MC, i.e. I have an MC on my timeline called music, with the instance name "musictarget" and on the click of a button I want to load another MC, nomusic from the library into it's place. All this is within another MC, not the main timeline. I also want to be able to load the original "music" MC back in again with the click of another button.

I'm assuming that I have to use a target, but I just can't get my head around the whole thing. I'm really bad with ActionScript, I don't have a clue what I'm doing, so as much help as possible would be greatly appreciated.

Thanks a lot...



FlashKit > Flash Help > Flash ActionScript
Posted on: 07-07-2003, 01:13 AM


View Complete Forum Thread with Replies

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

Load Movies Into Targets That Load Lovies Into Targets
Hi,

I am designing a website for FM ROcks - a production ompany in Loas Angeles.

The home.swf file loads commercials.swf file into an empty movieclip called "main" on the main timeline of home.swf

I then want commercials.swf to load about.swf into the movieclip called "sections" on the main timeline of commercials.swf

It is saying that it can't find the file...

see for yourself:

http://www.projectorstudio.com/fmrocks/beta

click on commercials.

-m

Tell Targets, I Think Please Help
Hi,
I am a relative newbie to actionscipt. I have created a site that has an image in the middle as the focal point. When a button is pressed i want the image then to be wiped off using an effect i have created. Then i want the correct image corresponding to the button pressed to appear once the 'shutters' open.

Any suggestions as the best way to accomplish this or directions to tuorials would be much appreciated

Tony

My 1st Tell Targets...Help
Please help! I'm trying to make a button with rollover and rollout MCs. I've tried the tutorials and it doesn't work in Flash 5. I can't figure this out! Here is my fla...please fix my action script inside by button clip from the link below. Thanks, this way I can see what the settings are for this...

http://www.hyattart.com/flash/navmenu-test.fla

Targets..........PLZ PPL
I've got an HTML file divided to 2 frames:
topFrame : a flash menu that I've created
mainFrame : an html page that have in it an <IFRAME>
<IFRAME>'s name : main ,here comes all the content.

Now, when I specify the target in GetURL() what should it be?

I tried something like: _parent.mainFrame.main
but it doesn't work!!!

please help, it's kinda urgent...

thanx

Kugy

Targets..........PLZ PPL
I've made ab HTML page with 2 frames named:
topFrame : Where is a flash menu
mainFrame : Where is an <IFRAME> called main and that's where I want the content to be

I attached a getURL action to a button with a target like this:

_parent.mainFrame.main but It doen't work!

please help!
It's kinda urgent

Kugy

Tell Targets
Hi,

Could somebody describe the logical process of tell targets to me.

Have been through the literature and cannot seem to make sense of it.

The closest I have come is with a tutorial on this page:
http://www.flashkit.com/tutorials/In...20/index.shtml and I will use this in my example.

I am really trying to find out why, on page 2, you leave frame 1 empty and also, more crucially, what is the link between naming the instance 'over', 'buttonover' and what is its connection with the 'telltarget("buttonover")' lines on page 4 of the tutorial.

Sorry, but I am getting old!

Best regards

David Jacobs

Targets
I can't get the whole target thing to work. When I try to enter any sort of movie clip anywhere, it doesn't acknowledge that there are clips in its little table. This means that it doesn't acknowledge clips at all. Please explain how I can tell a movie clip named "test" to goto frame 6. Also, how to tell "test" to have alpha 50%. (With setProperty) Thanks.


Mr. Guru

::Better Way Of Tell Targets?::
When i create a button in a mc with a tell target option i have to put the movie i want to load in that same mc. is there a better way to do this. or to get around it? thanks
n.

Tell Targets To Tell Targets
I have a MC in my flash, and with in it is a button. Now, how can that tell a movie clip on main flash timeline, to do something??

I have tried...

tellTarget ("_level0") {
tellTarget ("MUSIC") {
gotoAndPlay ("MUSICOFF");

But that don't work, how do you do it??

Pop Up Targets
this may not be as clear as it could be.
i'm not a very good scripter so help will be gratfully recieved
i want to roll over a link to reveal a contents movieclip etc.(i can get start drag to work with a invisible button) then on press i want to open a new window and launch the site.

simple enough but the pop up window code is in a smart clip which will not allow me to target the individual rollover movies.

i need both functions to work. any ideas

rat

Targets ?
On the main movie timeline I have created a button with a script to change the alpha property of a movie clip called purple which is also on the main timeline. I have tried several scripts and tried to understand what’s written in books etc but so far nothing has worked. What am I doing wrong. I wonder if I understand targetting properly.

The last script I tried was

on (release) {
_root.purple._alpha = 35;
}

Tell Targets
I have a series of buttons on my main timeline. Each button targets a different movie clip on the main timeline. The movie clips are all in the same place, meaning they will overlap each time another button is hit. What actions do I apply in order for only one unique movie clip to pop up when a different button is pressed? In other words, how can I stop playing a movie clip once a new button is pressed? This is something easy, I'm sure, but its driving me nuts!!
<Flash 5>

More Tell Targets
I am trying to use a button to activate a movie using tell target but when I click the button, it says "Target not found: Target="/HCSinglePlayerMenuB" Base="_level0""

How do I make it so that it will recognize the target? Currently the movie clip I would like the button to go to is in my library.

OR is there a way for me to not have to use tell target?

(Using Flash MX, but it needs to be exported into Flash 3)

Targets
I have 2 swf videos in 1 page. Can't join them all up as its in a U shape and i got an I frame to form a square. And i can't use iFrames in flash.

Well the point is, the bottom flash file is a navigation and the right side is sort of a display page. How do i make it that when i click a button in flash file 1 (bottom navigation) it will change the frame or scene in flash file 2 (display page) to load a new frame or new scene? And how do i make it so that when i click on a text in the iframe it will have the same effect to flash file 2? I need to know BOTH so anyone who knows how to do it please tell me how

Can I Tell 2 Targets At Once?
can i refer to 2 targets in one tellTarget command, to be more efficient in my code? if so, will it run both simultaneously or one after the other?


thanks in advance...
...kp

How Many Targets Are There You Could Use?
Hi people , in flash you can assign specific targets to a button, such as, "_blank", "_parent", etc, etc

are there any more available besides those?

cheers

Tell Targets?
i have a cursor trail movie i made but i dont know how to tell target something in the code. where do i find Begin Tell Target and End Tell Target, all i could find was tell Target? if i a button within a movie, so that when the user clicks it should play the movie but where do i put it in my .fla file? right now i have it on the down state of my button, but it only plays if i click and hold down the mouse instead of just clicking and releasing.

also on a side question, how do i get it so that when i click the movie plays where i clicked instead of the movie just following wherever my cursor goes?

if anyone can answer any of these questions id be much abliged!

Web Log & Targets
I have a issue, my previous site used levels but now i am using targets. Everything else works fine accept for my web log. Basicaly what i have is a MC on root, and i have a child that loads into that. RandVar = random
ActionScript Code:
(100000000000);
theXML = new XML();
theXML.ignoreWhite = true;
theXML_firstChildXML = new XML();
theXML_secondChildXML = new XML();
theXML_thirdChildXML = new XML();
_parent.iItemParent.iItem._visible = 0;
theXML.onLoad = function () {
        theXML = this;
        Path = "_level2.iBlog.iItemParent";
        trace("theXMLpath=" add this._target);
        buttonOffset = 100;
       
        _level0.levelTracker = 1000;
       
        _level2.stripWhitespaceDoublePass2(theXML);//trace (theXML);
        theArr = new Array();
        theArr = theXML.childNodes;
        theArr_firstChild = new Array();
        theArr_secondChild = new Array();
        theArr_thirdChild = new Array();
        //trace ("theArr:" add theArr);
        for (i=0; i<theArr.length; i++) {
                theArr_firstChild = theArr[i].childnodes;
                //trace ("theArr_firstChild:" add theArr_firstChild);trace ("");
               
               
                // Reset y-offset to zero for new second-level menu
                itemOffset = 0;
                itemName = null;
               
                for (ii=0; ii<theArr_firstChild.length; ii++) {
                        nodename = theArr_firstChild[ii].nodename;
                        nodevalue = theArr_firstChild[ii].firstchild.nodevalue;
                        nodetitle = theArr_firstChild[ii].attributes.title;
                        nodedescription = theArr_firstChild[ii].attributes.description;
                        //( nodeactiontype != "loadmenu" ) ? nodeaction = theArr_firstChild[ii].attributes.action : nodeaction = "";
                        theArr_secondChild = theArr_firstChild[ii].childnodes;
                       
                        //trace ("secondChild=" add theArr_secondChild);
                        trace (">> nodename=" add nodename add " : nodetitle=" add nodetitle add " : nodeactiontype=" add nodeactiontype);
                       
                       
                        if ( nodename == "item" ) {
                               
                                // Create Expanded Item List
                                (itemName != null) ? higherItem = itemName: higherItem = "";
                                itemName = "iItem_" add _level0.levelTracker;
                                duplicateMovieClip (Path add ".iItem", itemName, _level0.levelTracker);
                                set (Path add "." add itemName add ".higherItem",higherItem);
                                trace ("Path=" add Path add "." add itemName);
                                trace ("higherItem=" add higherItem);
                                _level0.levelTracker++; //trace (_level0.levelTracker);
                               
                                // Position Expanded Item List
                                trace("ITEMOFFSET = " add itemOffset add " : ITEMNAME=" add itemName add " : actualoffset=" add _level0.iMoluv.iItemParent.iItem_1000._y);
                                setProperty(Path add "." add itemName,_y,itemOffset);
                                itemOffset = itemOffset + buttonOffset;
                               
                                for (iii=0; iii<theArr_secondChild.length; iii++) {
                                        nodename2 = theArr_secondChild[iii].nodename;
                                        nodetitle2 = theArr_secondChild[iii].attributes.title;
                                        nodevalue2 = theArr_secondChild[iii].firstchild.nodevalue;
                                        nodedescription2 = theArr_secondChild[iii].attributes.description;
                                        //( nodeactiontype2 != "loadmenu" ) ? nodeaction2 = theArr_firstChild[ii].attributes.action : nodeaction2 = "";
                                        trace (">> nodename2=" add nodename2 add " : nodetitle2=" add nodetitle2 add " : nodedescription2=" add nodedescription2 add " : nodevalue2=" add nodevalue2);
                                       
                                       
                                        // Put action info and data into Items
                                        ( nodename2.toLowerCase() == "title" ) ? set (Path add "." add itemName add ".tTitle", nodevalue2):trace("this is false") ;
                                        ( nodename2.toLowerCase() == "dc:creator" ) ? set (Path add "." add itemName add ".tAuthor", nodevalue2):false ;
                                        ( nodename2.toLowerCase() == "dc:date" ) ? set (Path add "." add itemName add ".tTimeStamp", nodevalue2):false ;
                                        ( nodename2.toLowerCase() == "description" ) ? set (Path add "." add itemName add ".tDescription", nodevalue2):false ;
                                        ( nodename2.toLowerCase() == "description" ) ? set (Path add "." add itemName add ".tDescription2", nodevalue2):false ;
                                }
                        } // end if statement
                }
        }
};
theXML.load("http://www.otradesign.com/blogXML.cfm?" add RandVar);

can any one modify the code here to work in targets?

Targets
I have a question:

is it possible to call 2 targets at the same time, with different mouse behaviours?

for ex:
on (press) {
tellTarget ("nfi100") {
gotoAndStop(2);
}
}
on (release) {
tellTarget ("bd") {
gotoAndPlay(1);
}
}

thx

Targets
Hello

I am making a semi flash site and i am using a flash header with buttons to navigate round to site.

I have also used an iframe where the pages are loaded.
the iframe id is: iframe

on each button i has used the command getURL to navigate the pages.

This is what i used:

Code:
on (release) {
getURL("homepage.html", "iframe");
}
However, the target doesn't work, instead of the pages loading in the iframe they load in a blank window.

I have tried: _iframe and iframe as the target.

Also the defualt for the page is the iframe but it still loads in a new window

The site i am on about

Stealth

Targets
Hello

I am making a semi flash site and i am using a flash header with buttons to navigate round to site.

I have also used an iframe where the pages are loaded.
the iframe id is: iframe

on each button i has used the command getURL to navigate the pages.

This is what i used:

Code:
on (release) {
getURL("homepage.html", "iframe");
}
However, the target doesn't work, instead of the pages loading in the iframe they load in a blank window.

I have tried: _iframe and iframe as the target.

Also the defualt for the page is the iframe but it still loads in a new window

The site i am on about

Stealth

In Over My Head Now
Ive been playing with Bryce 4 and have got a nice assortment of 3d models, so I thought I would use them to give me a direction to take my flash learning to.

The question is,
If say I animate a cube(borg-ed up! lol) in bryce, I can make a movie of it at any degree spinning or whatever,
I can then inport this animation as a sequence of images into flash.
But what do I need to do if I wanted the user to be able to use the drag function on the cube so as they could spin it around in any direction so as to view it from all 360 degrees.

Is this going to be a bit of a mission?
Im able to carry out the first stages and know I can grab things with the drag function.
Any and all suggestions will be appreciated.
Thanks in advance

Doing My Head In
what i would like to do is have a graphic or button moving from ond side of the screen to the other. When it hits the other sise it will return back to the starting position. I dont want to use a motion tween, instead i want to use scripting to keep the file size down. This surely must be quite easy???? could someone paste up the code???

I have it working to a dgree except that the damn starting position sets itself instead of where i tell it,

please help if you can

Cheers, C

In Over My Head?
Hi all! just getting into flash and glad I found this forum.

A friend of mine has learned that I'm learning flash and already wants me to do a project that I said I would happily take on.(afterall you can't learn anything unless you've had some practical experience) He's looking for something along the lines of the http://www.californiaclosets.com/ intro page.

I checked it out and thought it looked simple enough to work off of but now I'm feeling a little overwhelemd and am unsure of where to start. I can't seem to come up with anything even close. Granted, I haven't dedicated a lot of time...

I've done the basic tuts that come along with flash5 and read some other tuts from various sources.

How does one approach a project like this and does it look like a lot of work for a novice to pull off?

Any advice would be appreciated. I hope I don't come off sounding like a whine.

Help Me Get My Head Around This
Gday

ARound the edge of stage, i have a boarder. Within it i have 5 buttons.

As you can imagine, i want my buttons to have a 'goto' command when pressed and each button will have a different goto and play 'frame'.

What i want to happen is when any of these buttons are pressed, i want my boarder to collapse upto the top of the stage into a rectangle and have these buttons within it. This animation i want to happen no matter which button is pressed

The problem i have is that i do not know how to tell each button that you must do the animation first then got to your frame with the relevant information on it.

I do not want to duplicate my workload and construct the last frame of my home page on the first frame of each button press.

Please help me.

Thanks
Huggs

Pop Pop Pop Goes My Head~
Hi all,

I'm trying to create a pop window in flash mx running on osx. below is some code that I am using for the button:

[code]on (release) {

// url,_winName,_width,_height,_toolbar,_location,_di rectories,_status,_menubar,_scrollbars,_resizable

openWinCentre("http://www.musicbycab.com", "blank", 800, 600, 0, 0, 0, 0, 0, 0, 1);

}

Can't Get My Head Around This
The following script works fine, no troubles - I'm just trying to work out how to make MC '_root.ewq' just PLAY. No 'gotoAnd'.. just straight out Play();

Sending Movie


Code:
on (release) {
my_frame = 5
talkingAtoB = new LocalConnection();
talkingAtoB.send("simple_lc", "communication", my_frame);
}


Receiving Movie


Code:
stop();
listeningLC = new LocalConnection();
listeningLC.communication = function(my_frame){
_root.ewq.gotoAndPlay(my_frame);
};
listeningLC.connect("simple_lc");


Hope you can help me!
Thanks!

Over My Head...
i really need some help here! (im a real newbee in some areas)


i am creating a projector exe for a distributed cd-rom.
the file size is already 4.5 mb, which i think is ok for cd streaming.

but i need to add a 3dmax animation (4 min long: 4200 targa frames) to be able to play within the flash/projector and have movie control (i already know how to control playback of a movie clip or video)

i have been having problems embedding the animation (too big: it crashes)

can i load the animation from the cd-rom as an swf?
or is there another way to accomplish this simple task.

Over My Head
Hello, I'm currently re-designing our guild's website and I'm having trouble figuring out what's the best way to build my opening and closing doors transition effect from section to section. I've tried several different noob hacks that I thought would work to get the effect I'm after, but my knowledge of AS isn't that great yet.

I've listed below the links to the source file and test site to demonstrate what I'm trying to achieve. If you click on the "Join" button that's exactly how I would like the transition to work for all the sections. Now click on the "Backstory" button, I want the doors to close on the current section being displayed and then when they open to display whatever section the user clicked from the menu.

Test Site

Source File

Could anyone give me some advice on how to build this transition effect for my sections? I'm guessing I would have to make some kind of function with if statements, etc.

Cant Get My Head Around This One...
Ok...I have two swf...a standard view and a "full screen" view...by default the standard view loads and there is a button to switch to full screen...when the standard view loads to begin with...the exhibitor list on the left works fine with the booths in the floorplan....meaning when you click an exhibitor, the corresponding booth lights up...however, when you load the second swf...which loads to _level0 using the following cose loadMovie("standard-0.48.xml", _level0); the exhibitor list does not work quite the same...when I click on an exhibitor now, the color for the whole floorplan changes, and does not change back...and if you click the standard view button, it goes back to the standard view, but again when you click an exhibitor, the color of the whole plan changes...any idea how to fix this?

you can see the results at www.expocadvr.com/temp/default.html

THanks,
Paul

In Over My Head. ?What?
I have an external SWF gallery type web page in the process.

The last part i have to figure out is how to have a vector square resize on button click in my root SWF. The resizing shouldn't relate to anything and is independent of the content in the external swfs. I didn't think it would be that difficult but i have looked at a lot of posts and can't wrap my head around it.

I'm willing to learn and figure it out for myself but i just don't know enough about flash/actionscript to know where to start.

is there a God out there in cyberspace?
send help/S.O.S

thanks

Please Help == In Over My Head
Okay, I'm in a jam. I've been given a project to do that seems simple enough but I am lost. I need to read in a flat text file which includes a bunch of name=value pairs.

Here is an example of what it looks like.

Envent="blah Blah blah"
Time="Blah"
Descript="Blah Blah Blah"
Link="www.blah.com"

Envent="blah Blah blah"
Time="Blah"
Descript="Blah Blah Blah"
Link="www.blah.com"

Envent="blah Blah blah"
Time="Blah"
Descript="Blah Blah Blah"
Link="www.blah.com"

You get the idea.

Anyhow I need to figure out how to loop through the file one row
or record at a time so that I can build a flash movie based on the input.

I figure I could do some like:

while(textfile){
addMovieClip;
addText;
addUrl;
}

And build the whole thing.

But I suck at action script. I'm sort of ColdFusion/PHP guy
and I can't find a good way of doing this.

I've looked over loadVars and loadVariables but that needs a URL encoded string, which I may be able to use. But basic structure of the text file will still be the same.

HELP PLEASE !!!!

Any ideas?

Can I build an array for each record, or an object? how do I do this?

Please!!!!

Over My Head A Bit
A client requested that for an introduction to their site, they would like to have a map of europe come into focus and have a dot land on England then lines shoot from the dot to different countries throughout europe. how would i go about doin that. any help at all would be greatly appreciated.

Oh My God... IT BIT HIS HEAD OFF
...lol



Hey Fellow Tech Geeks ,

Ok some major problems since the last time we talked.


Does neone know alot about mouse trails and random movement.


1. I'm trying to create randomly moving objects that vibrate at the same time. This can be easily done by combining two of kirupa's tutorials together (i.e. Flash MX random movement and Vibration tutorials.)... but how, heh.


2. I need to create a mouse trail layer layer over this. But first i need to create the mouse trail.


Here's the code I have so far:


Code:

onClipEvent (mouseMove) {
i++;
this.duplicateMovieClip("PPointer"+i, i+6);
_root["Pointer"+i]._x = _root._xmouse;
_root["Pointer"+i]._y = _root._ymouse;
}
onClipEvent (enterFrame) {
if (this._name == "PPointer") {
_visible=0;
}else{
this._alpha -= 5;
this._rotation += 2;
this._xscale += 5;
this._yscale += 5;
if (this._alpha <= 5) {
removeMovieClip(this);
}
}
}
But it doesn't seem to be working all to well. I'm sure i'm missing stuff.

3. Also the biggest problem I'm having is combining scenes 1 and 2. And still mantaining the mouse and mouse trail over-layer.

Unforunatly, it is too big to attach here but i'd be happy to e-mail it to neone interested in helping out. I will attach the project that i have done so far, along with what scene 2 should look like (also immediatly after the flash movie ends (not suppose to loop like it does) it is suppose to initiate the main page)...

Again I'm sure i'm just missing alot of actionscript. Thx in advance for nebody who can assist in knocking out some of these minor bugs.

In Over My Head Again
Hi there,

Here is my issue...I created a map that zooms in and out as well as scrolling. My problem is that I have active buttons within the map which lead to separate html pages when hit. My problem is that I don't want the flash to reload when it goes to the next page, I want it to stay at the same zoom and scroll location as the previous page.

Is this even doable? (I know I can do it in frames but don't want to)

Any assistance would be wonderful, I just can't wrap my head around this to do it myself.

Thanks!!!

In Over My Head
I have taken my first "big" website job of creating an online store for a company. They are looking to mimic one of the two websites :www.demostores.com or www.drjays.com.

I have ALOT OF experience with creating websites through Flash, Dreamweaver and ImageReady and I want to figure out how to configure a shopping cart into a create Flash Website. I purchased the Shopping Cart at GoDaddy.com and was hoping to build with that.

Basically, if anyone can give me any advice as to how I should go about starting the process of a shopping cart website, that would be great. I just need a little jump start and can normally trial & error my way through the rest. Thanks.

Cant Get My Head Around This One...
Ok...I have two swf...a standard view and a "full screen" view...by default the standard view loads and there is a button to switch to full screen...when the standard view loads to begin with...the exhibitor list on the left works fine with the booths in the floorplan....meaning when you click an exhibitor, the corresponding booth lights up...however, when you load the second swf...which loads to _level0 using the following cose loadMovie("standard-0.48.xml", _level0); the exhibitor list does not work quite the same...when I click on an exhibitor now, the color for the whole floorplan changes, and does not change back...and if you click the standard view button, it goes back to the standard view, but again when you click an exhibitor, the color of the whole plan changes...any idea how to fix this?

you can see the results at www.expocadvr.com/temp/default.html

THanks,
Paul

Over My Head Presumably
Hi all

I am starting a new private projest and would like to have a 3d rotating cube ...
Wait i know i am likley to get a lot of swift tutorials here and i have looked at them and they all seem to be designed for people who know how to use it ...

I have also heard this can be done in as and have looked at some of the examples here, they would do excatly what i would want but i am unable to figure out how to remove the mouse control because each time i do that it just goes absolutly spasticated !!! and then disspears !!!
I would like to put everything in what i would like to do with the cube but I wish not to give you a headache from just reading the first post in this thread

Here is the code i am using from the example



Code:
// create a scene movieclip to contain all 3D elements
// and center it on the screen.
this.createEmptyMovieClip("theScene", 1);
theScene._x = 150;
theScene._y = 150;

// focal length to determine perspective scaling
focalLength = 300;

// here we set up a function to make an object with
// x, y and z properties to represent a 3D point.
make3DPoint = function(x,y,z){
var point = new Object();
point.x = x;
point.y = y;
point.z = z;
return point;
};

// here we set up a function to make an object with
// x and y properties to represent a 2D point.
make2DPoint = function(x,y){
var point = new Object();
point.x = x;
point.y = y;
return point;
};

// this is a function that will determine whether a triangle
// drawn between the 3 points a, b and c is supposed to be
// visible or not
isVisibleBetween = function(a,b,c){
if (((b.y-a.y)/(b.x-a.x)-(c.y-a.y)/(c.x-a.x)<0)^(a.x<=b.x == a.x>c.x)){
return true;
}else{
return false;
}
};

// here is a function that will draw a side of cube
// based on 4 passed points, first checking if it should
// be drawn using isVisibleBetween on the first 3 points
drawFilledSquare = function(a,b,c,d){
this.clear();
this.lineStyle(2,0,100);
if (isVisibleBetween(a,b,c)){
this.moveTo(a.x, a.y);
this.beginFill(this.col, 100);
this.lineTo(b.x, b.y);
this.lineTo(c.x, c.y);
this.lineTo(d.x, d.y);
this.lineTo(a.x, a.y);
this.endFill();
}
};

// conversion function for changing an array of 3D points to an
// array of 2D points which is to be returned.
Transform3DPointsTo2DPoints = function(points, axisRotations){
// the array to hold transformed 2D points - the 3D points
// from the point array which are here rotated and scaled
// to generate a point as it would appear on the screen
var TransformedPointsArray = [];
// Math calcs for angles - sin and cos for each (trig)
// this will be the only time sin or cos is used for the
// entire portion of calculating all rotations
var sx = Math.sin(axisRotations.x);
var cx = Math.cos(axisRotations.x);
var sy = Math.sin(axisRotations.y);
var cy = Math.cos(axisRotations.y);
var sz = Math.sin(axisRotations.z);
var cz = Math.cos(axisRotations.z);

// a couple of variables to be used in the looping
// of all the points in the transform process
var x,y,z, xy,xz, yx,yz, zx,zy, scaleRatio;

// 3... 2... 1... loop!
// loop through all the points in your object/scene/space
// whatever - those points passed - so each is transformed
var i = points.length;
while (i--){
// apply Math to making transformations
// based on rotations

// assign variables for the current x, y and z
x = points[i].x;
y = points[i].y;
z = points[i].z;

// perform the rotations around each axis
// rotation around x
xy = cx*y - sx*z;
xz = sx*y + cx*z;
// rotation around y
yz = cy*xz - sy*x;
yx = sy*xz + cy*x;
// rotation around z
zx = cz*yx - sz*xy;
zy = sz*yx + cz*xy;

// now determine perspective scaling factor
// yz was the last calculated z value so its the
// final value for z depth
scaleRatio = focalLength/(focalLength + yz);
// assign the new x, y and z
x = zx*scaleRatio;
y = zy*scaleRatio;
// create transformed 2D point with the calculated values
// adding it to the array holding all 2D points
TransformedPointsArray[i] = make2DPoint(x, y);
}
// after looping return the array of points as they
// exist after the rotation and scaling
return TransformedPointsArray;
};

// the points array contains all the points in the 3D
// scene. These 8 make a cube on the screen.
pointsArray = [
make3DPoint(-50,-50,-50),
make3DPoint(50,-50,-50),
make3DPoint(50,-50,50),
make3DPoint(-50,-50,50),
make3DPoint(-50,50,-50),
make3DPoint(50,50,-50),
make3DPoint(50,50,50),
make3DPoint(-50,50,50)
];

// each side will be in its own movieclip
// each movieclip will have button actions which
// will display text and change its color
// drawFilledSquare is also given to the clip so
// it can know how to draw itself. First the functions
// for handling the interaction will be defined, then
// added to each clip as its created.
rollOverFace = function(){
this.col = 0xff0000;
};
pressFace = function(){
display_txt.text = "You just pressed "+this._name;
};
rollOutFace = function(){
this.col = 0xdddddd;
};
for (i=0; i<6; i++){
emptyFace = theScene.createEmptyMovieClip("face"+i,i);
emptyFace.col = 0xdddddd;
emptyFace.onRollOver = emptyFace.onDragOver = rollOverFace;
emptyFace.onRollOut = emptyFace.onDragOut = rollOutFace;
emptyFace.onPress = pressFace;
emptyFace.draw = drawFilledSquare;
}

// an object to represent the 3 angles of rotation
cubeAxisRotations = make3DPoint(0,0,0);

rotateCube = function(){
cubeAxisRotations.y -= this._xmouse/3000;
cubeAxisRotations.x += this._ymouse/3000;
// create a new array to contain the _x and _y positions of the
// points in the pointsArray as they would exist on the screen
var pts2D = Transform3DPointsTo2DPoints(pointsArray, cubeAxisRotations);

// draw each side of the cube
this.face0.draw(pts2D[0], pts2D[3], pts2D[2], pts2D[1]);
this.face1.draw(pts2D[4], pts2D[5], pts2D[6], pts2D[7]);
this.face2.draw(pts2D[0], pts2D[4], pts2D[7], pts2D[3]);
this.face3.draw(pts2D[3], pts2D[7], pts2D[6], pts2D[2]);
this.face4.draw(pts2D[2], pts2D[6], pts2D[5], pts2D[1]);
this.face5.draw(pts2D[1], pts2D[5], pts2D[4], pts2D[0]);
};

// make rotateCube happen every frame for theScene
theScene.onEnterFrame = rotateCube;
the part i changed to stop the mouse control


Code:
rotateCube = function(){
cubeAxisRotations.y -= ".1";
cubeAxisRotations.x += ".1";
// create a new array to contain the _x and _y positions of the
// points in the pointsArray as they would exist on the screen
var pts2D = Transform3DPointsTo2DPoints(pointsArray, cubeAxisRotations);
Thank you

Oh My God... IT BIT HIS HEAD OFF
...lol



Hey Fellow Tech Geeks ,

Ok some major problems since the last time we talked.


Does neone know alot about mouse trails and random movement.


1. I'm trying to create randomly moving objects that vibrate at the same time. This can be easily done by combining two of kirupa's tutorials together (i.e. Flash MX random movement and Vibration tutorials.)... but how, heh.


2. I need to create a mouse trail layer layer over this. But first i need to create the mouse trail.


Here's the code I have so far:


Code:

onClipEvent (mouseMove) {
i++;
this.duplicateMovieClip("PPointer"+i, i+6);
_root["Pointer"+i]._x = _root._xmouse;
_root["Pointer"+i]._y = _root._ymouse;
}
onClipEvent (enterFrame) {
if (this._name == "PPointer") {
_visible=0;
}else{
this._alpha -= 5;
this._rotation += 2;
this._xscale += 5;
this._yscale += 5;
if (this._alpha <= 5) {
removeMovieClip(this);
}
}
}
But it doesn't seem to be working all to well. I'm sure i'm missing stuff.

3. Also the biggest problem I'm having is combining scenes 1 and 2. And still mantaining the mouse and mouse trail over-layer.

Unforunatly, it is too big to attach here but i'd be happy to e-mail it to neone interested in helping out. I will attach the project that i have done so far, along with what scene 2 should look like (also immediatly after the flash movie ends (not suppose to loop like it does) it is suppose to initiate the main page)...

Again I'm sure i'm just missing alot of actionscript. Thx in advance for nebody who can assist in knocking out some of these minor bugs.

In Over My Head Again
Hi there,

Here is my issue...I created a map that zooms in and out as well as scrolling. My problem is that I have active buttons within the map which lead to separate html pages when hit. My problem is that I don't want the flash to reload when it goes to the next page, I want it to stay at the same zoom and scroll location as the previous page.

Is this even doable? (I know I can do it in frames but don't want to)

Any assistance would be wonderful, I just can't wrap my head around this to do it myself.

Thanks!!!

Cant Get My Head Around This One
Im making an e-greetings card, i have an mc with a snowfall in it but i cant get it to work over a few frames, its fine if the movie is only 1 frame but as soon as you put another frame in the snow doesnt fall properly and i cant quite see which bit of script is doing it.

ive uploaded the fla in the hope someone can help me

cheers

Cant Get My Head Around This One...
Ok...I have two swf...a standard view and a "full screen" view...by default the standard view loads and there is a button to switch to full screen...when the standard view loads to begin with...the exhibitor list on the left works fine with the booths in the floorplan....meaning when you click an exhibitor, the corresponding booth lights up...however, when you load the second swf...which loads to _level0 using the following cose loadMovie("standard-0.48.xml", _level0); the exhibitor list does not work quite the same...when I click on an exhibitor now, the color for the whole floorplan changes, and does not change back...and if you click the standard view button, it goes back to the standard view, but again when you click an exhibitor, the color of the whole plan changes...any idea how to fix this?

you can see the results at www.expocadvr.com/temp/default.html

and i have attached a ZIP that contains all the files you would need to reproduce the app locally on your computer...please help...


THanks,
Paul

In WAY Over My Head Help
Im sure this is a bit over my head but I thought i would ask you guys how you might do it before i trash the idea. Im putting up my new flash site soon its almost ready. People will be able to download my dj mixes off the site. what i want to do is force people to sign the guest book BEFORE they can access the music! how do i do this? any ideas? to me it sounds like im gonna have to get into cgi scripts and what not. hopefully I wont and you guys know how to do it in flash!

TIA!

XML Href Targets
Hello, I am importing a .xml which basically just displays text with a hyperlink, can any of you tell me what syntax I use to specify targets like _top or a frame name.

I have this sort os syntax so far...

"<a href="+ link +">"

Im guessing the target reference goe's in that bit somewhere.

Thanks

David

Multiple Targets
is it possible to have multiple targets in the same set property script?

Scene Targets?
Hi guys

I've got multiple scenes. And the movie size is 700x3000px

I wanna connect scenes with buttons at the bottom each scene.
But I want to go to the top of the page in the scene -of course.

Can anyone help please.

Tell Targets Not Working Together
Here is my main script:

function ship1MineSelfExplode () {
if (_root.ship.hitTest(mineDrop)) {
tellTarget ("_root.mineDrop") {
gotoAndPlay("explode");
}
tellTarget ("_root.ship") {
gotoAndPlay("boom");
}
_root.player2++;
}

in the ship script, after "boom" I have this:

tellTarget (_root) {
gotoAndStop ("Scene 1", "levelchoose");
}

OK. Now in the Mine script I have this:

stop ();
tellTarget (_root) {
minedropped = false;
}
removeMovieClip (_root.mineDrop);

What happens is when the ship hits the mine, the ship explodes and the mine explodes. After a certain point, the script should send you back
to the level choose frame label. If only one tell target is used in the script, it works. if they are together, as they are in the script above, they
both blow up, but won't go back to the levelchoose frame. Any clue why? Thanks,

Andy

P.S. The mine script is set so if after a certain amount of time the ship doesn't hit the mine, it explodes itself, allowing you to drop another
mine.

Two Tell Targets Together Not Working
This is a part of my script:


function ship1MineSelfExplode () {
if (_root.ship.hitTest(mineDrop)) {
tellTarget (_root.ship) {
gotoAndPlay ("boom");
}
tellTarget (_root.mineDrop) {
gotoAndPlay ("explode");
}
}
_root.player2++;
}
What happens is if a ship hits a mine, it explodes. The problem is, when both tell targets are used, they go to the first frame of the mc that they are suppossed to, then stop.
I have tried not using tell target, placing them in different functions that are called at the same time, etc... If I take one tell target out (it doesn't matter which one) it will work. Any clue why? Thanks.

Assigning Targets But...HELP
ok so i have 2 movie clips...one of the movies clips contains a graphic which contains a button inside of it...i want that button to control the other movie clip (the one that it is not inside of) it is named "pictures"...so i added this code to the button:

on (release) {
tellTarget ("pictures") {
gotoAndStop (2);
}
}

so i run the movie in the flash preview and click on the button and a little window comes up telling me this:

Target not found: Target="pictures" Base="_level0.instance20"

...am i doing something wrong...please help me out, i've been trying to figure this out for hours...

thanks,

james

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