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




ActionScript - Objects _root And Relativity GURU?



Can you take a quick scan???

Sorry, I posted the whole stupid thing... but my problem lies in the pictureLoader and pictureFader function.

All the movieclips exist on the main stage, except for the thumbnails...
I pass all the movie clips paths to the PhotoAlbum which you can see in the creation of the object at the bottom of the page.

The problem is that the pictureLoader function doesn't work unless i use _root. It doesn't work with _parent, or with _level0.
In turn, I got _root to work, but when I try to make a pictureFader function so that after the preloader checks _root.animPar_mc.aHolder.getBytesLoaded, and it does all the preloading, it never calls the fade function... it's like.. sometimes I can say this.aHolder and it does what it should, and other times, it doesn't know what this.aHolder is at all. Please help.

this is the file in action...
http://www.variablemedium.com/dev/ph...aToggleTry.swf



ActionScript Code:
stop();//---------PROTOTYPE CODE------------------//written in flash 6//Create the global photo album function_global.PhotoAlbum = function(animPar_mc, aHolder_mc, loadBar_mc, thumbNav_mc, thumbMask_mc, photos_arr, thumbs_arr) {    this.animPar = animPar_mc;    this.aHolder = aHolder_mc;    this.photos = photos_arr;    this.thumbs = thumbs_arr;    this.loadBar = loadBar_mc;    this.thumbNav = thumbNav_mc;    this.thumbMask = thumbMask_mc;    this.thumbNav.setMask(this.thumbMask);    this.yMove = 30;    this.yPlus = 40;    this.xMove = 14;    this.createThumbnails();    this.showPhotoAt(0);};//set index so that it loops through array//show the photo at provided n valuePhotoAlbum.prototype.showPhotoAt = function(n) {    var lastIndex = this.photos.length-1;    if (n>lastIndex) {        n = 0;    } else if (n<0) {        n = lastIndex;    }    this.index = n;    this.aHolder.loadMovie(this.photos[this.index]);    pictureLoader = setInterval(this.pictureLoader, 1000/30);};//the callback function for the preloader in the showPhotoAt functionPhotoAlbum.prototype.pictureLoader = function() {    this.animPar._alpha = 10;    this.loadBar._alpha = 100;    var percent = (_root.animPar_mc.aHolder_mc.getBytesLoaded()/_root.animPar_mc.aHolder_mc.getBytesTotal())*100;    _root.animPar_mc.loadBar_mc._xscale = Math.floor(percent);    if (percent>=99) {        this.loadBar._alpha = 0;        clearInterval(pictureLoader);        pictureFader = setInterval(this.pictureFader, 1000/30);    }};//call back function to fade in preloaded imagePhotoAlbum.prototype.pictureFader = function() {    this.animPar._alpha +=10;    if(this.animPar._alpha>=100){        clearInterval(pictureFader);    }};//createThumnailMenuPhotoAlbum.prototype.createThumbnails = function() {    for (i=0; i<this.thumbs.length; i++) {        this.thumbNav.createEmptyMovieClip("outer"+i, i);        this.thumbNav["outer"+i]._y = this.yMove;        this.thumbNav["outer"+i]._x = this.xMove;        this.thumbNav["outer"+i].myNum = i;        this.thumbNav["outer"+i]._alpha = 99;        this.thumbNav["outer"+i].onRollOver = function() {            this._alpha -= 20;        };        this.thumbNav["outer"+i].onRollOut = thumbNav["outer"+i].onReleaseOutside=function () {            this._alpha += 20;        };        this.thumbNav["outer"+i].onRelease = function() {            album.showPhotoAt(this.myNum);        };        this.thumbNav["outer"+i].createEmptyMovieClip("inner"+i, i);        this.thumbNav["outer"+i]["inner"+i].loadMovie(this.thumbs[i]);        this.yMove += this.yPlus;    }};//--------END PROTOTYPE CODE---------------//--------INITIAL VALUES--------------------_global.loadFrom = "local";//-- END INITIAL VALUES//----LOAD FROM WEB OR LOCAL CONDITIONAL SATEMENT--------if (loadFrom == "web") {    loadVariablesNum("getPhotoNames.php", 0);}this.onData = function() {    if (loadFrom == "web") {        photos_arr = fileNames.split(" ");        thumbs_arr = thumbNames.split(" ");        photos_arr = photos_arr.sort();        thumbs_arr = thumbs_arr.sort();    } else {        dir = "images/";        thu = "thumbs/";        photos_arr = [dir+"pic1.jpg", dir+"pic2.jpg", dir+"pic3.jpg", dir+"pic4.jpg", dir+"pic5.jpg", dir+"pic6.jpg", dir+"pic7.jpg", dir+"pic8.jpg", dir+"pic9.jpg", dir+"pic0.jpg"];        thumbs_arr = [thu+"pic1.jpg", thu+"pic2.jpg", thu+"pic3.jpg", thu+"pic4.jpg", thu+"pic5.jpg", thu+"pic6.jpg", thu+"pic7.jpg", thu+"pic8.jpg", thu+"pic9.jpg", thu+"pic0.jpg"];    }    album = new PhotoAlbum(animPar_mc, animPar_mc.aHolder_mc, animPar_mc.loadBar_mc, thumbNav_mc, thumbNav_mc.thumbMask_mc, photos_arr, thumbs_arr);};



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 03-18-2004, 08:23 PM


View Complete Forum Thread with Replies

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

ActionScript - Objects _root And Relativity GURU?
Can you take a quick scan???

Sorry, I posted the whole stupid thing... but my problem lies in the pictureLoader and pictureFader function.

All the movieclips exist on the main stage, except for the thumbnails...
I pass all the movie clips paths to the PhotoAlbum which you can see in the creation of the object at the bottom of the page.

The problem is that the pictureLoader function doesn't work unless i use _root. It doesn't work with _parent, or with _level0.
In turn, I got _root to work, but when I try to make a pictureFader function so that after the preloader checks _root.animPar_mc.aHolder.getBytesLoaded, and it does all the preloading, it never calls the fade function... it's like.. sometimes I can say this.aHolder and it does what it should, and other times, it doesn't know what this.aHolder is at all. Please help.

this is the file in action...
http://www.variablemedium.com/dev/ph...aToggleTry.swf



ActionScript Code:
stop();//---------PROTOTYPE CODE------------------//written in flash 6//Create the global photo album function_global.PhotoAlbum = function(animPar_mc, aHolder_mc, loadBar_mc, thumbNav_mc, thumbMask_mc, photos_arr, thumbs_arr) {    this.animPar = animPar_mc;    this.aHolder = aHolder_mc;    this.photos = photos_arr;    this.thumbs = thumbs_arr;    this.loadBar = loadBar_mc;    this.thumbNav = thumbNav_mc;    this.thumbMask = thumbMask_mc;    this.thumbNav.setMask(this.thumbMask);    this.yMove = 30;    this.yPlus = 40;    this.xMove = 14;    this.createThumbnails();    this.showPhotoAt(0);};//set index so that it loops through array//show the photo at provided n valuePhotoAlbum.prototype.showPhotoAt = function(n) {    var lastIndex = this.photos.length-1;    if (n>lastIndex) {        n = 0;    } else if (n<0) {        n = lastIndex;    }    this.index = n;    this.aHolder.loadMovie(this.photos[this.index]);    pictureLoader = setInterval(this.pictureLoader, 1000/30);};//the callback function for the preloader in the showPhotoAt functionPhotoAlbum.prototype.pictureLoader = function() {    this.animPar._alpha = 10;    this.loadBar._alpha = 100;    var percent = (_root.animPar_mc.aHolder_mc.getBytesLoaded()/_root.animPar_mc.aHolder_mc.getBytesTotal())*100;    _root.animPar_mc.loadBar_mc._xscale = Math.floor(percent);    if (percent>=99) {        this.loadBar._alpha = 0;        clearInterval(pictureLoader);        pictureFader = setInterval(this.pictureFader, 1000/30);    }};//call back function to fade in preloaded imagePhotoAlbum.prototype.pictureFader = function() {    this.animPar._alpha +=10;    if(this.animPar._alpha>=100){        clearInterval(pictureFader);    }};//createThumnailMenuPhotoAlbum.prototype.createThumbnails = function() {    for (i=0; i<this.thumbs.length; i++) {        this.thumbNav.createEmptyMovieClip("outer"+i, i);        this.thumbNav["outer"+i]._y = this.yMove;        this.thumbNav["outer"+i]._x = this.xMove;        this.thumbNav["outer"+i].myNum = i;        this.thumbNav["outer"+i]._alpha = 99;        this.thumbNav["outer"+i].onRollOver = function() {            this._alpha -= 20;        };        this.thumbNav["outer"+i].onRollOut = thumbNav["outer"+i].onReleaseOutside=function () {            this._alpha += 20;        };        this.thumbNav["outer"+i].onRelease = function() {            album.showPhotoAt(this.myNum);        };        this.thumbNav["outer"+i].createEmptyMovieClip("inner"+i, i);        this.thumbNav["outer"+i]["inner"+i].loadMovie(this.thumbs[i]);        this.yMove += this.yPlus;    }};//--------END PROTOTYPE CODE---------------//--------INITIAL VALUES--------------------_global.loadFrom = "local";//-- END INITIAL VALUES//----LOAD FROM WEB OR LOCAL CONDITIONAL SATEMENT--------if (loadFrom == "web") {    loadVariablesNum("getPhotoNames.php", 0);}this.onData = function() {    if (loadFrom == "web") {        photos_arr = fileNames.split(" ");        thumbs_arr = thumbNames.split(" ");        photos_arr = photos_arr.sort();        thumbs_arr = thumbs_arr.sort();    } else {        dir = "images/";        thu = "thumbs/";        photos_arr = [dir+"pic1.jpg", dir+"pic2.jpg", dir+"pic3.jpg", dir+"pic4.jpg", dir+"pic5.jpg", dir+"pic6.jpg", dir+"pic7.jpg", dir+"pic8.jpg", dir+"pic9.jpg", dir+"pic0.jpg"];        thumbs_arr = [thu+"pic1.jpg", thu+"pic2.jpg", thu+"pic3.jpg", thu+"pic4.jpg", thu+"pic5.jpg", thu+"pic6.jpg", thu+"pic7.jpg", thu+"pic8.jpg", thu+"pic9.jpg", thu+"pic0.jpg"];    }    album = new PhotoAlbum(animPar_mc, animPar_mc.aHolder_mc, animPar_mc.loadBar_mc, thumbNav_mc, thumbNav_mc.thumbMask_mc, photos_arr, thumbs_arr);};

Actionscript Guru's Please Help Me
Can somebody please help me out here?

I've selected a few very cool FLASHtyper-effects in FLASH KIT.com for a multimedia presentation I'm doing. I've downloaded the original flash file, so that I could alter the scripts within the file and for optimal use for my presentation. (I've downloaded the original file, because the options are too limited when you use the FLASH-Kit application within this site, and then when you export this file, it's a flash-quicktime format, wich I can't use or import in my Flash file)
So, In the original file I've downloaded, I can alter the text-segment within the first Action used in scene 1, but what I can't seem to do, is manage to put BREAKS or something between the words so that the words and effects used on the words are show UNDERNEATH each other.
The script were I altered the text-segement looks like this:

text="Marketingcommunicatie";
i=1;
max=length(text);
kerning="20";
size="20";
setProperty=("chatr",_visible,"o")

Were it says 'text="Marketingcommunicatie" ' , I want the next word after "Marketingcommunicatie" to come out underneath it, and the next word underneath that word, etc etc.

How can I realize this in Flash5, 'cause were it says 'values' in the Frame actions-window, you can only type 'oneliners'
It has to be something simple, but for some reason I can't seem to figure it out. Please help me, FAST!!!!
My presentation has this killer deadline!!!

(Ps. I've uploaded the flash-file on http://www.looney2.nl/flashtest so you can see where the problem lies, it's called: rippled blur.fla)

Thanks
M

I Need An Actionscript Guru For This One
Howdy,

Here's what I am looking to do. I would like to move a MC across the screen using ActionScript. I've already done this. Easy enough. What I want is for the MC to get smaller the higher up on the screen it gets. Something like a quasi 3d feel to it. Is there some way to do this with x, y coordinates? Right now I have scripting in the MC to get smaller/bigger depending on the up/down key that is being pressed.

if (Key.isDown(Key.UP))
{
_width -= .5;
_height -= .5;
setProperty(_root.move, _y, _root.move._y-5);}

But this is giving me a few problems when I want to do some hittesting. I'm wondering if there is a script that utilizes the MC's x and y coordinates to tell what size the MC is.

Thanks in advance,

Vault

Need An Actionscript Guru For This One
Help!

I have used all the fscommands with my flash projector to
control the user's access but I cannot find a way to
prevent them from right clicking and gaining access to the
macromedia setting.
Is there a way to trap, stop, prevent or disable right clicking?

Thanks

YJ

Actionscript Guru's - Need Your Help
I'm trying to create the same slider pane as http://www.dvarchive.com/
I've got the slider working but can't seem to figure what actionscript I would put on the arrows - does anyone know?
One last question, the slider is composed of buttons(thumbnails) - What I want to happen is when the user mousesover or presses a thumbnail I want the slider to stop movie and an enlarged photo will appear in another area of the stage. I thought I could use On mouseOver; release Stop - but that doesn't work. Why? Can anyone help??

Actionscript used on slider:
onClipEvent (enterFrame) {
if (_root.mainVar == 0) {
homeX = (-_root._xmouse*.75)+400;
} else {
homeX = (-_root.mainVar*.75)+400;
}
thisX = _x;
diffX = homeX-thisX;
if (_root.mainVar == 0) {
moveX = diffX/30;
} else {
moveX = diffX/5;
}
_x = thisX+moveX;
}

Actionscript Guru... HELP PLEASE?
I have a problem I have never seen before. I always design sites that load swf externally into level 1. On the site Im working on Africanfootprints.net my main (root) scene loads only the navigation and at the first frame of the timeline in my nav movie clip, I have an action to:
loadMovieNum("mysite_home.swf", 1);
so to load it into level 1 on top of the main scene.
However, when I test the scene I get this error
"256 levels of recursion were exceeded in one action list.
This is probably an infinite loop.
Further execution of actions has been disabled in this movie."

the preloader just keeps flashing.
Please advise? Im going crazy here!

Actionscript Guru's...
Is it possible to stop this effect using actionscript in the middle of a movie.

For example If I inserted this in frame one of my movie, how would I stop this effect using action script in frame 20?

Thanks in advanced

I Need An Actionscript Guru
I recently developed this menu to load different swf files. It works great but now im trying to change those links to targets which are stated below

Im having nothing but trouble with it... Its driving me crazy. Is there anyone out there who sort this..

i need to connect to targets

eg...

links[21] = _level0.main0.p28.goldencode(); !!!


download fla


I know this is a bit brief.. Let me know if you need more info

Thanks

Actionscript Guru Challenge
I'm trying to figure out the best way to go about creating the following effect.

I want to be able to create a mouse reflection effect for a "mirror".
The mirror is a mid screen graphic.

See http://members.home.net/webthred to get a better idea of the effect I'm struggling with. I'd like to see the mouse pointer be reflected as its passes over only the mirror (preferably the user's system mouse cursor choice).


Psuedocode if it makes request clearer: All suggestions welcomed

IF (MouseCusor is hovered over the MirrorGraphic) = TRUE
THEN
Show a movie of a dimmed reflection that follows MouseCursor on top of only the MirrorGraphic
ELSE
Return the mouse pointer to user's system setting because I know how annoying it is when the user looses his/her control of the cursor.

I've (so far) used a mask to do the reflection movie (with standard pointer graphic), but struggling with what to do next. Haven't yet dabbled in the action script area and I feel that action script is where its at. This one lesson I would find interesting because its something I can't do on my level. If anyone can come up with a solution, I would be interested in dissecting it and learning as an example.

NOTE: new personal - work in progress as always - I know the nav/font/windows have a long way to go... just started this a few days ago and as usual get hung up on a puzzle that grinds me to a halt.

See http://members.home.net/webthred/portfTEST to see a (crude) rough example of what I have so far.

The question is :

How do I release the MouseCursor movie within the graphic boundaries and return user control?
Or better yet, how would I reflect the user's MouseCursor choice?

Anyone curious? I don't doubt there may be a simple technique I'm not aware of. Any discussion about it is welcomed.

Actionscript Guru Needed Here Help
I made promotional CD with Flash MX, and it works fine, but I want it ot be published in windows projector. I did that also, and it also works, but...when movie is resized beyond normal mesaurments (750*550 is normal, if you resize window to 850*550 for example)i can see things that normally shouldn't be generated, stuf that is drawn outside of canvas.
I tried to find some code to prevent flash animation to be resizeable, I know ti exist but I just cannot find it. How to make it not resizeable nad not to show menu on top of animation, and also can I make flash movie that will be run in full window.
Pls help me, I looked in Actionscript Bible but cannot find anything...

Reward For Actionscript Guru
OK, before I go too far, I should say that I can't pay anything for this, but I can offer you a copy of a strictly-limited (run of 250) design book that is not "officially" out yet. Very collectable.

The project I need help with is 90% done, but due to time (and skill!) restrictions, I am not able to finish it.

It is a site for a London-based photographer, featuring 3 galleries of 12 photos. All photos are loaded in as external JPG files.

The main problems are as follows...

* Preloading external images and showing progress in a text field.
* Ironing out some minor problems with the movement of the movie clips
* Fine-tuning a time-out script that fades a movie clip when the mouse is inactive

I am not going to post the movie clip (the external files it needs are too large for this forum), but I can email files to anyone who is interested. I am thinking that it will take a skilled coder only a couple of hours to complete.

Interested parties should email me - nick at triplezero dot com dot au.

(Sorry about the lack of link, I get enough spam as it is!)

Thanks.

Nick

Help Of An Actionscript Guru Needed :)
I am in the process of making an eGreeting card with a baby's face on it. To add a bit of interactivity the baby's eyes follow the cursor around the page. However, to make it uber slick it would be great if, when the cursor landed on the baby's nose, its eyes went squint...
Ive figured out the script for the two eyes (they move together in the direction of the cursor) but the squinting bit is vexing me!

Any ideas would be greatly appreciated

Quick One For Actionscript Guru
found this script to load a textbox with scroller dynamicly but the scroller doesnt display. can anybody tell me whats wrong with the add scroller part.


Code:
script:
on(release){
tmp = new LoadVars();
tmp.load("test.txt");
tmp.onLoad = function() {
createTextField("display",1,5,5,370,200);
display.multiline = true;
display.wordWrap = true;
display.html = true;
display.border = true;
display.borderColor=0xFFBE00;
display.background = true;
display.backgroundColor = 0xeeeeee;
_root.display.htmlText = _root.tmp.blah;
// add scrollbar component, this part does seem to work
_root.attachMovie("FScrollBarSymbol","scroller",this.getNextHighestDepth());
scroller._x = 370;
scroller._y = 5;
scroller.setSize(201);
scroller.setScrollTarget(display);
scrollColors = {lightest:0xFFBE00, medium:0xeeeeee, darker:0xb7770d, darkest:0};
scroller.setStyleProperty("arrow", scrollColors.darkest);
scroller.setStyleProperty("face", scrollColors.medium);
scroller.setStyleProperty("shadow", scrollColors.darker);
scroller.setStyleProperty("darkshadow", scrollColors.darkest);
scroller.setStyleProperty("highlight", scrollColors.lightest);
scroller.setStyleProperty("highlight3d", scrollColors.medium);
scroller.setStyleProperty("scrollTrack", scrollColors.lightest);
};
}
im using flash8 pro if that makes any difference

thanks in advance
john.

ActionScript Guru Needed
Issue is inside of a Class file i have created.
I have created several private members and all can be seen except for the variables that are being referenced by event handlers for onload events.

What gives? If i use a _global var i can see it but i am baffled as to why i can not see my class members from within the event handler functions.

Please response asap.

Actionscript And Xml Guru For Hire
I would outsource this section of a Flash site to someone who understands
actionscript and xml.
The section that needs to be created is a project title directory.
The project title list or directory:
1. needs to be created from an existing XML file.
2. be displayed in Flash as 3 columns with a scroll when necessary. Each
column lists all Proj_title's for that Category.
3. Clicking on a Proj_title from the list would open up that project in the
existing allprojects.fla.

The All Projects page is already done and pulls its data from the same XML
file.
It displays scrolling images of products. When an image is clicked, a
detailed section opens with other images and text all coming from the same
xml file. This section is completed. Now with a Directory List, the same
happens when clicking on a Proj_title from the list.
The directory list is what needs to be done.
The XML file contains: Image, Category, Proj_title, Thumbnail, Summary,
Description, Picture1, Pic1Desc, Picture2, Pic2Desc, Picture3, Pic3Desc,
Use, Builder, Builder etc.....
The XML file used for the directory is the same used for the rest of this
allprojects.fla..
Please find link to see the xml file: www.filecondo.com/allimages.xml
If you are interested in this freelance job please respond to this post.

Actionscript 2 Guru Needed
Hey Guys;
Seems like you guys are the actionscript gurus round here...
Ive got this flash movie that imports an xml file and then draws out a navigable grid
based on this data.It was working but now Im getting errors within the classes when I try to compile/publish it.
Its probably something simple as Im new to the whole MX 2004 /AS 2.0 scenario....

If you could have a look at the code and see what little mistake im making itd be great!

Cheers

Johnny.

[F5]Arg For Actionscript Guru Beginner Needs Help
Hi,

I need open external application in MAC OS9 flash projector.

video.mpg --> call quicktime
music.mp3 --> call itunes
Adobeacrobatreader.dmg .

I try fscommand, but not work...
I try use applescript to call the file, but don´t work.

Thanks anyway..

[F5]Arg For Actionscript Guru Beginner Needs Help
hi...
I developed a project where the user click with the left button of mouse and advances a frame (nextFrame)end to click with the right button comes back a frame (prevFrame).
The problem is that if your button is pressured by much time, the film advances many frames of a time.
I would like that somebody I could help to me indicating me some code or tutorial where I can control this button´s sensitivity.

Actionscript 3.0 Guru Needed
SnapPages.com is at the forefront of technology by making the web so easy for even the casual user that they can look like a HTML and Flash guru. Become a foundational partner of this small team and help lay the groundwork for incredible success in the near future. Your accomplishments will not go unnoticed and will directly impact the entire company.

We are seeking an all-star Senior Flash Developer to join our team – not just another web designer. If you are all about Flash, and you are accustomed to using the most current technology available, then we would like to speak with you.

Required Skills:Proficient in Action Script 3 (2 is not an option)
Strong organizational skills
History of working on large projects successfully
Project leadership experience
Experience with PHP and My SQL (LAMP)
Working with object-oriented projects
Resourceful / Independent worker / Driven
An eye for design
No less than 5 strong years of Flash
This is your opportunity to be recognized for your amazing work. This is just too good to pass up!

Please contact me at ddouglas@novotus.com for more information or go to www.novotus.com and apply to this position directly.

RecruiterDoug

[F5]Arg For Actionscript Guru Beginner Needs Help
So, I hate when people just randomly jump on a forum and ask for help, and then never come back after their problem has been solved. But, I'm begging for help. I have a website that I'm working on, and my brain is done! Can someone help me code this so that the photos are scaled down to the size of "big image holder" (instance name "imagesHolder_mc")

I would attach the fla. But, it is too large.

Job For Flash OOP/ActionScript Guru
Flash Programmer

Company Overview

Kesser Technical Group is a small but rapidly growing research laboratory working on exciting, collaborative, nomadic wireless software applications. We have a government contract to create a multimedia wireless PDA-based collaboration tool with exciting applications in gaming, training, and simulation. We are located in Brighton, MA. Candidates should be located (or relocate) within commute-range of central Boston.


Position

We are looking for a person who knows Flash ActionScript inside and out. The candidate should be at home with Object-Oriented AS programming and have the discipline to produce a project that has several thousand lines of AS code and is well structured and compartmentalized. In addition, the person should be exceptionally gifted and interested in creating new forms of gesture-based interactive controls for PDA-based devices.

Essential Skills

• A minimum of three years of experience with Flash ActionScript
•A portfolio including several multi-hundred line FlashMX component-based projects, personally created
• Knowledge of how to use FlashMX’s ActionScript to dynamically create graphic objects
•Extensive experience with OOP programming in ActionScript
•Excellent code documentation skills
•A high degree of comfort with asynchronous XML socket programming

Highly Desirable Skills

•Proficient in C# and DotNet Framework programming
•Creation of client/server based applications
• Flash XML experience
•Prior experience working in an R&D lab
•Experience with rapid prototype generation and Agile (e.g. XP) programming skills
• Experience with 2D GIS mapping software
•Experience with 3D virtual world creation software

Compensation

The pay range for this position depends on experience and reflects standard pay levels for this type of work.

Contact

Send resume to sgutfreund@hotmail.com subject: Job: FLASH-GURU

Finding Objects In _root
Is there a way to find via Actionscript a list of objects that reside in the root timeline?

I'm think there must be a way to find out say what movieclips or textfields exist in a movie or the root timeline.

Vars And _root Objects
Does any one know why an if on press == true would not work?
Basically inside ["row"+i] (which is a movie clip) there are three x but(1,2,3)
and one instance of ticker if but1 is pressed then ticker will move to.

The reason why it is set up this was is because ["row"+i] is a movie clip that occurs 19 times.



Code:

var question:Number = 19;
for (var i = 1; i<=question; i++) {
_root["row"+i].onPress = function() {

if(but1.onPress == true){
trace("button 1 is pressed");
this.ticker._x = 50;

}else if(but2.onPress == true){
trace("button 2 is pressed");
this.ticker._x = 100;

}else if(but3.onPress == true){
trace("button 2 is pressed");
this.ticker._x = 150;
};
}
}

Function And _root Objects
Im having trouble using a function to change a value of a text field on the stage.

Here's a simplified version of what im doing


ActionScript Code:
function ChangeTxt (NewTxt, Location){
    Location = NewTxt
}
 
ChangeTxt ("MyNewText", _root.TextArea1)


I want to update the variable TextArea1 with NewTxt using the above function but it doesn't seem to be working

I think its because its not accepting _root.TextArea1 as the function variable

Can any one help?

Actionscript Guru Needed _flash 5
hi,

I have a scrollbar to scrolltext that works great except it makes my scrollbar shrink like crazy if I add tons of text. can someone look at the code and let me know if there are ways I can change it so the scrollbar is not affected by the text? here is the code. I'd be forever grateful. any suggestions would be great.
the code is basically from

http://www.actionscripts.org/tutoria...II/index.shtml though I have changed the variable names.

onClipEvent (load){
this.loadVariables("text.txt");
scrolling = 0;
frameCounter = 1;
speedFactor = 3;
numLines = 7;
origHeight = scrollbar._height;
origX = scrollbar._x;
needInit = false;
function initScrollbar(){
var totalLines = numLines + textField.maxscroll - 1;
scrollbar._yscale = 100*(numLines)/totalLines;
deltaHeight = origHeight - scrollbar._height;
lineHeight = deltaHeight/(textField.maxScroll - 1);
}
function updateScrollBarPos(){
scrollbar._y = lineHeight*(textField.scroll - 1);
}

}
onClipEvent (enterFrame){
if( needInit ){
if(textField.maxscroll > 1){
initScrollbar();
needInit = false;
}
}
if( frameCounter % speedFactor == 0){
if( scrolling == "up" && textField.scroll > 1){
textField.scroll--;
updateScrollBarPos();
}
else if( scrolling == "down" && textField.scroll < textField.maxscroll){
textField.scroll++;
updateScrollBarPos();
}
frameCounter = 0;
}
frameCounter++;
}
onClipEvent (mouseDown){
if(up.hitTest(_root._xmouse,_root._ymouse)){
scrolling = "up";
frameCounter = speedFactor;
up.gotoAndStop(2);
}
if(down.hitTest(_root._xmouse,_root._ymouse)){
scrolling = "down";
frameCounter = speedFactor;
down.gotoAndStop(2);
}
if(scrollbar.hitTest(_root._xmouse,_root._ymouse)) {
scrollbar.startDrag(0,origX,deltaHeight,origX);
scrolling = "scrollbar";
}
updateAfterEvent();

}
onClipEvent (mouseUp){
scrolling = 0;
up.gotoAndStop(1);
down.gotoAndStop(1);
stopDrag();
updateAfterEvent();
}
onClipEvent (mouseMove){
if(scrolling == "scrollbar"){
textField.scroll = Math.round((scrollbar._y)/lineHeight + 1);
}
updateAfterEvent();
}

onClipEvent (data){
needInit = true;
}

Interactive Interface....Need An Actionscript Guru's Help...Please
Hi all....

I'm building an interface that has an animated dude that jumps across a series of blocks (9 in total....3x3). The problem is, I would like him to jump from block to block to get to a particular block. For example.....If he is currently on block(1) and I want him to go to block(9), he will have to goto block(4) to block(7) to block(8) then to block(9). My thoughts are that i need to track which block he is currently on, and which block he needs to goto (and this would need to be checked each time he jumps to a block). I have animated each jump along the main timeline, using frame labels to manage each jump (ie. 'block1_2_block4', block1_2_block4.....etc.

I have included the 'swf' file for now, and will add the 'fla' file if anyone is interested (its just that the 'fla' is about a meg)

cheers....pitsta

For Actionscript Guru FLVPlayer Need Buffer
Hi,

I´m using a FLVPlayer from..www.jeroenwijering.com

I need to make a video buffer and a movieclip that shows " Loading..."
I made a buffer video, and the carrega_mc that is "Loading.." but is not working...

This is the my changed code from www.jeroenwijering.com :
code:

//--------------------------------------------------------------------------
// initial variables that might be useful to change
//--------------------------------------------------------------------------
// toggle for which file to play if none was set in html
// you can change the 'test.flv' in your filename
!_root.file ? file="videos/aes-hi.flv" : file=_root.file;
// toggle for autostarting the video
// you can change the 'true' in 'false'
!_root.autoStart ? autoStart=false : autoStart=_root.autoStart;
// toggle for the width and height of the video
// you can change them to the width and height you want
w = Stage.width;
h = Stage.height;
//--------------------------------------------------------------------------
// stream setup and functions
//--------------------------------------------------------------------------
// create and set netstream
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
ns.setBufferTime(10);
nc.setBufferTime(10);
// create and set sound object
this.createEmptyMovieClip("snd", 0);
snd.attachAudio(ns);
audio = new Sound(snd);
audio.setVolume(80);
//attach videodisplay
videoDisplay.attachVideo(ns);
// Retrieve duration meta data from netstream
ns.onMetaData = function(obj) {
this.totalTime = obj.duration;
// these three lines were used for automatically sizing
// it is now done by sizing the video to stage dimensions
// if(obj.height > 0 && obj.height < Stage.height-20) {
// setDims(obj.width, obj.height);
// }
};
// retrieve status messages from netstream
ns.onStatus = function(object) {
if (object.code == "NetStream.Play.Stop") {
// rewind and pause on when movie is finished
ns.seek(0);
ns.pause();
playBut._visible = true;
pauseBut._visible = false;
videoDisplay._visible = false;
//playText.txt.text = "click to play";
playText.text = "click para iniciar";
}
};
//--------------------------------------------------------------------------
// controlbar functionality
//--------------------------------------------------------------------------
// play the movie and hide playbutton
function playMovie() {
if (!isStarted) {
//nc.setBufferTime(10);
//carrega.text = "Carregando ..";
carrega_mc._visible = true;
ns.play(file);
//playText.txt.text = "loading ..";
//carrega_mc._visible = true;
playText.text = " ";
isStarted = true;
} else {
ns.pause();
carrega_mc._visible = true;
}
pauseBut._visible = true;
playBut._visible = false;
videoDisplay._visible = true;
}
// pause the movie and hide pausebutton
function pauseMovie() {
ns.pause();
playBut._visible = true;
pauseBut._visible = false;
}
// video click action
videoBg.onPress = function() {
if (pauseBut._visible == false) {
carrega_mc._visible = true;
nc.setBufferTime(10);
//carrega.text = "Carregando ..";
playMovie();
//carrega_mc._visible = false;
playText.text._visible = false;
} else {
pauseMovie();
}
};
// pause button action
pauseBut.onPress = function() {
pauseMovie();
};
// play button action
playBut.onPress = function() {
carrega_mc._visible = true;
nc.setBufferTime(10);
//carrega.text = "Carregando ..";

playMovie();
//carrega_mc._visible = false;
playText.text._visible = false;
};
// file load progress
progressBar.onEnterFrame = function() {
loaded = this._parent.ns.bytesLoaded;
total = this._parent.ns.bytesTotal;
if (loaded == total && loaded>1000) {
this.loa._xscale = 100;
delete this.onEnterFrame;
} else {
this.loa._xscale = int(loaded/total*100);
}
};
// play progress function
progressBar.tme.onEnterFrame = function() {
this._xscale = ns.time/ns.totalTime*100;
};
// start playhead scrubbing
progressBar.loa.onPress = function() {
this.onEnterFrame = function() {
scl = (this._xmouse/this._width)*(this._xscale/100)*(this._xscale/100);
if (scl<0.02) {
scl = 0;
}
ns.seek(scl*ns.totalTime);
};
};
// stop playhead scrubbing
progressBar.loa.onRelease = progressBar.loa.onReleaseOutside=function () {
delete this.onEnterFrame;
pauseBut._visible == false ? videoDisplay.pause() : null;
};
// volume scrubbing
volumeBar.back.onPress = function() {
this.onEnterFrame = function() {
var xm = this._xmouse;
if (xm>=0 && xm<=20) {
this._parent.mask._width = this._xmouse;
this._parent._parent.audio.setVolume(this._xmouse* 5);
}
};
};
volumeBar.back.onRelease = volumeBar.back.onReleaseOutside=function () {
delete this.onEnterFrame;
};
//--------------------------------------------------------------------------
// resize and position all items
//--------------------------------------------------------------------------
function setDims(w, h) {
// set videodisplay dimensions
videoDisplay._width = videoBg._width=w;
videoDisplay._height = videoBg._height=h-20;
playText._x = w/2-120;
playText._y = h/2-20;
// resize the items on the left ..
playBut._y = pauseBut._y=progressBar._y=volumeBar._y=h-20;
progressBar._width = w-56;
volumeBar._x = w-38;
}
// here you can ovverride the dimensions of the video
setDims(w, h);
setDims(320, 213);
//--------------------------------------------------------------------------
// all done ? start the movie !
//--------------------------------------------------------------------------
// start playing the movie
// if no autoStart it searches for a placeholder jpg
// and hides the pauseBut
if (autoStart == true) {
carrega_mc._visible = true;
nc.setBufferTime(10);
playMovie();
//carrega_mc._visible = false;
playText.text._visible = false;
} else {
pauseBut._visible = false;
//imageStr = substring(file,0,file.length-3)+"jpg";
//imageClip.loadMovie(imageStr);
}

[FLASH 8] For Actionscript Guru Beginner Needs Help
I am working with softVNS (Max/MSP plug in) tracking software and would like to upload my dynamic x and y array cordinates of the tracked objects onto flash and use flash to generate dynamic voronoi diagrams around those cordinates.
I have got a flash script for generating the diagrams and also have a FLASHSEVER patch to link flash and Max. My problem is how do I upload this dynamic data onto flash and actually use it to affect the diagrams I am drawing..? At the moment adding points is controlled by:

function addDotAtMouse() {
addDot(_xmouse, _ymouse);

I have been thourgh the loadVars tutorials but I can't seem to figure out how it would work in this case.(I am a Flash_New_bee)
I will be really happy for any suggestions or tutorials that deals with such issues.

Thank you

Killion

Arg For Actionscript Guru Can't Load Swf File Please Help
Here s the code:


PHP Code:



var my_pb:mx.controls.ProgressBar;my_pb.mode = "manual";this.createEmptyMovieClip("img_mc",999);var my_mcl:MovieClipLoader = new MovieClipLoader();var mclListener:Object = new Object();mclListener.onLoadStart = function(target_mc:MovieClip):Void {    my_pb.label = "loading: " + target_mc._name;};mclListener.onLoadProgress = function(target_mc:MovieClip, numBytesLoaded:Number, numBytesTotal:Number):Void {    var pctLoaded:Number = Math.ceil(100 * (numBytesLoaded / numBytesTotal));    my_pb.setProgress(numBytesLoaded, numBytesTotal);};my_mcl.addListener(mclListener);my_mcl.loadClip("the_movie.swf", img_mc); 




When I m trying to load a pic the loading is succsessful but when I m trying to load a swf file I m getting nothing .

Simple Actionscript Guru Help For A Graphic
I have this header I am working on, and I would like it to have the "illusion" that the time of day is changing based on the color hues of 3 sections in the graphic - the "sky", the "mountains" and the "trees" - I was wondering if there was a way, that I could specify which colors (from a choice, of say, 3-4 colors), and in what order are "useable" then just say, after so many seconds, change the fill color of "graphic" to next color with a fading from one to the next. It is for a website header, so it's gotta be fairly simple, I'm just not sure where to start on it. I'm still really new at Actionscript. I have attached a copy of the header I'm working on. The colors are still just flat cause I've been trying to figure this out. But let me know if you need me to be more specific.
Thanks in advance!

Flash 3D CUBE Actionscript Guru's?
Hi
I am wondering if it is possible?

have a look at the good old ultrashock tutorial http://www.exile.com.au/cube/

and my question is :

Is is possible to have each side of the cube coloured in a different colour and have different words on each side of the cube and it still moves dianamically?

anyone know?

Returning The Name Of Objects On The _root Timeline
I know there is a loop you can do that outputs the names of all the objects on the _root timeline, but I can't remember what it is. Can anyone help?

Thanks in advance

Drop Down Menu Hassel For Actionscript Guru's
hi all, this is for flash 5

on my sites nav page i have 4 drop down menus, when the user holds mouse over menu it drops but...

the top two dd menus have a mash over their contents, while the menu does not drop down when the mouse is over the mask, the buttons under the mask can still be activated

here is my site URL

http://www.dguide.co.za

press enter and the popup will activate and you will see the nav menu called guide, the blue area above it hides its contents but hold your mouse over it and when you see it change to the button pointer click.

as you can see it activates a popup, this shouldn't happen so what can i do to combat this ???

thanks
MDT

Bounce ActionScript With A Twist - Simple For A Guru (which I Am Not)
I want to make a movie (ball) bounce once across the stage. The ball comes in from off the stage (top left), bounces once in the middle of the stage (bottom) and finally bounces off the stage (right).

I tried using motion tween with a motion guide, but it just does not seem like a natural bounce.

Anyone have any ActionScript to do this?

Thank you

Need Flash Actionscript 2.0 Guru/consultant In Montreal
we’re developing online game. can somebody recommend a flash actionscript 2.0 guru/consultant in montreal or surrounding area. cheers, adrian

Time=$money$ Easy $50 For Actionscript Guru.
i'm creating a fairly simple drop down menu (right now it's xml, eventually it'll be from a recordset object from coldfusion/mysql) so far so good. What i need is somebody who's more proficient with actionscripted movement than I am who can fill in the missing piece(s) to my code.

so far i've created the menu by attaching dyn clips, created a variable which counts the clips, calculates the height and positions the clip up the appropriate ammount so that initially you can't see it. I need a function for the button that'll make the menu drop down. it'll need to take into consideration the height of my dynamically created drop menu. the movement should be actionscripted (obviously) and should incorporate a little easing to make it look smooth.

I imagine you'll have to use setInterval or something to evaluate how far that menu drops down (the dynamic height) but that is quite honestly beyond my skillset at this point!

I'm sure somebody out there has dealt with this before and wouldn't mind making a fast $50.00. PM me if you're interested. I will start with whoever responds first and work my way down from there until somebody comes up with a working solution. I can only pay through paypal so if you can't use paypal sorry.

LoadMovie Relativity (header For Site)
The goal is to have a header that i can include in different flash movies.

I have created a header that loads its contents from an xml file and then displays everything. _root.loadMovie("header.swf") will load the movie into another flash movie, but nothing else on the stage shows up, so i try to load it into a mc called nav, and it screws up all of the paths and nothing draws out correctly. what do i do about this problem? the relative paths in flash confuse me enough, so i don't think it would be possible for me to change the paths, unless someone has a little instruction there.

Help is much appreciated!!!

Access Objects Inside A Loaded Movie From The _root Timeline
I used loadMovie to load head.swf.

ActionScript Code:
loadMovie("head.swf","_root.head_mc");

head.swf has three objects, head0, head1, head2.

I want to change color on all three objects. I tried the following but it did not work.

ActionScript Code:
for(var i = 0; i < 3; i++)
{
     objColor = new Color(_level0.head_mc["head"+[i]]);
     objColor.setRGB("0xFF0000");
}

I tried to trace and it gave me undefined. I can trace _root.head_mc.

ActionScript Code:
trace(_root.head_mc["head0"]);

Also, In the head.swf, I have a function. If I want to get an object through the function what kind of targeting will I use. I found out I cannot use _root because it goes to the loader.swf. I also tried this._parent but I am getting undefined.


ActionScript Code:
this._parent["head0"]

Thanks in advance for the help,
Shrini

Actionscript To Javascript ..any Actionscript Hero Or Javascript Guru?
Hi..everybody..

i just like to know..if anyone could tell me is it possible to pass a variable from actionscript to javascript ?
eg.
password = inputName
login = login
boolean gate == fales;

if (password == "temp" && login =="login"){
answer = "Access granted!" ;
getURL("temp.html",_self);

} else {
answer = "Access denied!" ;
}

because my login page was made in flash..however, after i found out that user could type in url direct access to the web, i made a redirect meta tag ,redirect that web to login page..however, its does work out..because those 2 pages are not passing login success to another...>__<
thanks you..

anythingokay

When Using The _root Actionscript, How Do I ...
stay in that scene without starting the whole movie over again?

I made a scrolling movie with buttons in it. on those buttons, I have this script attached:
-----------------------------------
on (release) {
_root.gotoAndPlay(17);
}
-----------------------------------

but the problem is that I don't want the whole movie to start over again...I just want it to go to a frame within that scene.

Any suggestions?

Thanks!
Furpants

_root In Actionscript 3
Im having some trouble with flash actionscript 3.. I have two movie clips, under one of them I have a button that should start the other movie clip. I cant find out how to tell the compiler to gotoAndPlay(2) on that specific movieclip. In actionscript 2 I would use _root.AboutPage.gotoAndPlay(2), but that doesn't work with actionscript 3.

Anyone know how to do this in actionscript 3?

_root Equivalent For This Actionscript
Howdy. I'm following a tutorial made in actionscript 2 and naturally the code is gelling well with my actionscript 3 document. I guess I have two questions. Is it easy to start a new document with what I've done non-code wise already in Flash 9 but using actionscript 2 instead of 3? Or would it be easier to redo the actionscript in 3 format?

Below is the original actionscript I'm using from the tutorial. It checks to see if a user has rolled their mouse over within 50 pixels of the left side of the screen. I just need the actionscript 3 equivalent since the whole _root issue has changed dramatically in from 2 to 3.

_root.onEnterFrame = function(){
if(_root._xmouse<50) {
imgBar.prevFrame();
}
}

Thanks in advance for any help you could offer!

- MythProd
(John David Hutton)

Using Variables From A Movie To _root In Actionscript
what i'm trying to do is:
I want to use some variables of a movieclip in actionscript _root, but i just can't do it!
If i use them directly in dynamic text i can see it, but i can't use it in actionscript.For exemple:

variable from movieclip:

movieclip_variable=_root.my_movieclip.variable;

_root actionscript:
(ex: if i wanted to add some text to it)
_root.variable1="This is my var"+_root.movieclip_variable;

output:
undefined

_root. Actionscript Button Issue, HELP
Alright. So Ive got this problem where when you click a button it goes back to play frame 18... this button is located in a seperate movieclip. It works just fine in preview mode. But the whole swf is being loaded from another one. when you view it from the original one, that button, no longer does anything. here is the actionscript im using on the button:

on (release) {
_root.gotoAndPlay(18);
}

ActionScript 3.0 Migration Code For _root.
Hello Friends
I am using AS2 and i have some doubts in AS3.
function zoomer(){
var x:Number = _root.xmouse; //storing some value and using that while movie onenterframe.
}

what is the code in AS3 for that.

Modifying _root Actionscript To Work As External Swf
i have a huge site im working on with lots of external swfs being loaded,
i customized thiis image gallery and when i load it as an external swf, it stops working. i know this is because of all the _root. stuiff going, so is there an easy way to remedy this?

thankyou

ian

ActionScript Dilemma: An Alternative To _root.createEmptyMovieClip ?
I've got some code for a Flash Panorama tool that I cannot figure out how to change. The problem is that it loads .swf files and movieClips using the _root method. I've figured out how to dump my pano .swf into an empty movieClip in my project, but this still means that once you import your panorama master .swf into a larger Flash project, that master .swf clip never goes away after you call it up.

Is there a way to replace all of the _root load instances in the script with something that you can control? Here's the code:

-------------------------

var radar_offset:Number=0;
var currentid:Number=0;
var topid:Number=1;
var hotspots:Array=new Array;

// Create container movieclip
var vr:MovieClip = _root.createEmptyMovieClip("vr", 1);
// prevent access to "real" root
vr._lockroot=true;

function clearHotspots() {
var mc:MovieClip;
var i:Number;
for (i=0;i<hotspots.length;i++) {
mc=hotspots[i];
mc.removeMovieClip();
}
hotspots=new Array();
}

function loadPanorama(id:Number) {
// Create a Movieclip loader
var myLoader = new MovieClipLoader();
var myListener = new Object();

// remove old Hotspots
clearHotspots();

myListener.onLoadStart = function () {
var filename:String;
// Set the dimentions and position of the pano
vr.window_width=500;
vr.window_height=398;
vr.window_x=364;
vr.window_y=0;
// change autorotation
vr.autorotate=0.5;
vr.autorotate_delay=20;

// add a preview bar...
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = true;
my_fmt.font = "Arial";
my_fmt.size = 12;
my_fmt.color = 0xffffff;
_root.createTextField("pretxt",10,170,40,200,20);
_root.pretxt.setNewTextFormat(my_fmt);
_root.pretxt.selectable = false;
_root.pretxt.text = "Loading...";
_root.createEmptyMovieClip("prebar",21);
};

myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
// update progress bar
var x1:Number,x2:Number,y1:Number,y2:Number;
_root.pretxt.text = "Loading... " + Math.floor(100*loadedBytes/totalBytes) + " %";
_root.prebar.clear();
_root.prebar.beginFill(0x0000FF, 30);
_root.prebar.lineStyle(2, 0x000080, 100);

x1=_root.pretxt._x;
x2=x1 + 180 * loadedBytes/totalBytes;
y1=_root.pretxt._y+20;
y2=y1+10;

_root.prebar.moveTo(x1, y1);
_root.prebar.lineTo(x2, y1);
_root.prebar.lineTo(x2, y2);
_root.prebar.lineTo(x1, y2);
_root.prebar.lineTo(x1, y1);
_root.prebar.endFill();

};

myListener.onLoadComplete = function () {
// remove progress bar
_root.pretxt.removeTextField();
_root.prebar.removeMovieClip();
};

myListener.onLoadInit = function () {
setupPanorama(currentid);
// Add another hotspot to position pan 0, tilt -90 (nadir) without rollover effect
var hs_p2q:MovieClip=_root.attachMovie("pano2qtvr_lib" ,"hs_textmc2",10200);
hs_p2q.onRelease=function() {
_root.getURL('http://www.pano2qtvr.com','_blank');
}
vr.pano.addHotspot('p2q',0,-90,hs_p2q);
// add hotspots to a list to clear them
hotspots.push(hs_p2q);
compass.fov._visible=true;
};

// add the Listener
myLoader.addListener(myListener);

// set the parameters for the different panoramas
if (id==1) {
filename="/support/StateFarm-Office.swf";
radar_offset=0;
compass._x=map._x+map.bt1._x;
compass._y=map._y+map.bt1._y;
}
if (id==2) {
filename="/support/StateFarm-Welcome.swf";
radar_offset=180;
compass._x=map._x+map.bt2._x;
compass._y=map._y+map.bt2._y;
}

// remove the radar during loading
compass.fov._xscale=0;
compass.fov._yscale=0;
compass.fov._visible=false;

// ... and finally load the pano!
myLoader.loadClip(filename, vr);
currentid=id;

}





// add the map
var map:MovieClip=_root.attachMovie("map","map",20005, {_x:230,_y:0});

// connect the buttons in the map
map.bt1.onPress=function () {
loadPanorama(1);
}
map.bt2.onPress=function () {
loadPanorama(2);
}


// ... and the rader is even higher...
var compass:MovieClip=_root.attachMovie("compass_lib", "compass",20010,{_x:60,_y:200,_alpha:50});

compass.fov._xscale=0;
compass.fov._yscale=0;
compass._visible=true;
compass.fov._visible=false;

// update the shape of the rader on each frame
_root.onEnterFrame=function() {
compass.fov._rotation=-(vr.pano.getPan()+radar_offset);
compass.fov._xscale=100*Math.tan(vr.pano.getFov()* Math.PI/360);
compass.fov._yscale=100*Math.cos(vr.pano.getTilt() *Math.PI/180);
}

// load the pavilion pano first
loadPanorama(2);


------------------------

Thanks

ActionScript Dilemma: An Alternative To _root.createEmptyMovieClip ?
I've got some code for a Flash Panorama tool that I cannot figure out how to change. The problem is that it loads .swf files and movieClips using the _root method. I've figured out how to dump my pano .swf into an empty movieClip in my project, but this still means that once you import your panorama master .swf into a larger Flash project, that master .swf clip never goes away after you call it up.

Is there a way to replace all of the _root load instances in the script with something that you can control? Here's the code:

-------------------------


Code:
var radar_offset:Number=0;
var currentid:Number=0;
var topid:Number=1;
var hotspots:Array=new Array;

// Create container movieclip
var vr:MovieClip = _root.createEmptyMovieClip("vr", 1);
// prevent access to "real" root
vr._lockroot=true;

function clearHotspots() {
var mc:MovieClip;
var i:Number;
for (i=0;i<hotspots.length;i++) {
mc=hotspots[i];
mc.removeMovieClip();
}
hotspots=new Array();
}

function loadPanorama(id:Number) {
// Create a Movieclip loader
var myLoader = new MovieClipLoader();
var myListener = new Object();

// remove old Hotspots
clearHotspots();

myListener.onLoadStart = function () {
var filename:String;
// Set the dimentions and position of the pano
vr.window_width=500;
vr.window_height=398;
vr.window_x=364;
vr.window_y=0;
// change autorotation
vr.autorotate=0.5;
vr.autorotate_delay=20;

// add a preview bar...
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = true;
my_fmt.font = "Arial";
my_fmt.size = 12;
my_fmt.color = 0xffffff;
_root.createTextField("pretxt",10,170,40,200,20);
_root.pretxt.setNewTextFormat(my_fmt);
_root.pretxt.selectable = false;
_root.pretxt.text = "Loading...";
_root.createEmptyMovieClip("prebar",21);
};

myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
// update progress bar
var x1:Number,x2:Number,y1:Number,y2:Number;
_root.pretxt.text = "Loading... " + Math.floor(100*loadedBytes/totalBytes) + " %";
_root.prebar.clear();
_root.prebar.beginFill(0x0000FF, 30);
_root.prebar.lineStyle(2, 0x000080, 100);

x1=_root.pretxt._x;
x2=x1 + 180 * loadedBytes/totalBytes;
y1=_root.pretxt._y+20;
y2=y1+10;

_root.prebar.moveTo(x1, y1);
_root.prebar.lineTo(x2, y1);
_root.prebar.lineTo(x2, y2);
_root.prebar.lineTo(x1, y2);
_root.prebar.lineTo(x1, y1);
_root.prebar.endFill();

};

myListener.onLoadComplete = function () {
// remove progress bar
_root.pretxt.removeTextField();
_root.prebar.removeMovieClip();
};

myListener.onLoadInit = function () {
setupPanorama(currentid);
// Add another hotspot to position pan 0, tilt -90 (nadir) without rollover effect
var hs_p2q:MovieClip=_root.attachMovie("pano2qtvr_lib","hs_textmc2",10200);
hs_p2q.onRelease=function() {
_root.getURL('http://www.pano2qtvr.com','_blank');
}
vr.pano.addHotspot('p2q',0,-90,hs_p2q);
// add hotspots to a list to clear them
hotspots.push(hs_p2q);
compass.fov._visible=true;
};

// add the Listener
myLoader.addListener(myListener);

// set the parameters for the different panoramas
if (id==1) {
filename="/support/StateFarm-Office.swf";
radar_offset=0;
compass._x=map._x+map.bt1._x;
compass._y=map._y+map.bt1._y;
}
if (id==2) {
filename="/support/StateFarm-Welcome.swf";
radar_offset=180;
compass._x=map._x+map.bt2._x;
compass._y=map._y+map.bt2._y;
}

// remove the radar during loading
compass.fov._xscale=0;
compass.fov._yscale=0;
compass.fov._visible=false;

// ... and finally load the pano!
myLoader.loadClip(filename, vr);
currentid=id;

}





// add the map
var map:MovieClip=_root.attachMovie("map","map",20005,{_x:230,_y:0});

// connect the buttons in the map
map.bt1.onPress=function () {
loadPanorama(1);
}
map.bt2.onPress=function () {
loadPanorama(2);
}


// ... and the rader is even higher...
var compass:MovieClip=_root.attachMovie("compass_lib","compass",20010,{_x:60,_y:200,_alpha:50});

compass.fov._xscale=0;
compass.fov._yscale=0;
compass._visible=true;
compass.fov._visible=false;

// update the shape of the rader on each frame
_root.onEnterFrame=function() {
compass.fov._rotation=-(vr.pano.getPan()+radar_offset);
compass.fov._xscale=100*Math.tan(vr.pano.getFov()* Math.PI/360);
compass.fov._yscale=100*Math.cos(vr.pano.getTilt() *Math.PI/180);
}

// load the pavilion pano first
loadPanorama(2);
------------------------

Thanks

_root Problem, How To Make Actionscript Work
Hi i dont usually need to post but i have run into trouble. I need to place this code into an externally loaded flash movie but when i try and change the _root paths it fails to work. Any help will be hugely appecriated!


ActionScript Code:
theNews = new XML();
theNews.ignoreWhite = true;
theNews.load('http://www.robpersaud.com/xml.php'+"?cK="+random(9999)+1);
function Scroll(){
    diff = menu._height / 264;
    Y = (dragger._y*-diff);
    newY = Math.floor(oldY + (Y - oldY)/8);
    menu._y = newY;
    oldY = newY;
}
scroll = setInterval(Scroll, 25);
onEnterFrame = function(){
}
scroll = setInterval(Scroll2, 25);
onEnterFrame = function(){
}
function Article( id, title, date, author, body){
    this.id = id;
    this.title = title;
    this.date = date;
    this.author = author;
    this.body = body;
};
Article.prototype.putOut = function(titletxt, datetxt, authortxt, bodytxt){
    _root[titletxt].text = this.title;
    _root[datetxt].text = "On: "+this.date;
    _root[authortxt].text = "By: "+this.author;
    _root[bodytxt].text = this.body;
};
function articleOut(xml){
    _global.numArts = xml.firstChild.childNodes.length-1;
    info = xml.firstChild.childNodes[at].attributes;
    body = xml.firstChild.childNodes[at].firstChild.firstChild.nodeValue;
    currArticle = new Article(info.id, info.title, info.date, info.author, body);
    currArticle.putOut("titletxt","datetxt","authortxt","bodytxt");
    delete currArticle;
    delete info;
}
trace(_root._width);
theNews.onLoad = function(){
    articleOut(this);
    at = numArts;
    articleOut(this);
    _root.createEmptyMovieClip("menu", _root.page);
    items = this.firstChild.childNodes;
    to = Number(items.length-1);
    for(a = 0; a>= -to; a--){
         _root.menu.attachMovie( "menuItem", "item"+a, a);
        _root.menu["item"+a].nametxt.text = items[to-(-a)].attributes.title;
        _root.menu["item"+a].nametxt2.text = items[to-(-a)].attributes.date;
        _root.menu["item"+a]._y = -22*a;
        _root.menu["item"+a]._y += 10;
        _root.menu["item"+a]._x = 455-63.5;
        _root.menu["item"+a].itemConst = Number(items[0].attributes.id)-1;
        _root.menu["item"+a].itemNum = to-(-a);
        _root.menu["item"+a].onRelease = function(){
            at = this.itemNum;
            _root.articleOut(theNews);
        }
    }
}
articleOut(theNews);

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