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




Define Hit Area?



hei,

how can i achieve the following:

the grey rectangle should start fading in when i reach the red square (hit area), not already when you cross the edges of the grey square.... this seems to be a easy one - if one knows (sofar about the status of my flash-knowledge!)

the "button" is a movieclip with three layers:
first layer has the button-coding (see below)
second + third layer contain the motion-tweened rectangle/square.

thanks for helping

coding in the first layer:

stop();

this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}

this.onRollOver = function(){
rewind = false;
play();
}

this.onRollOut = function(){
rewind = true;
}

this.onRelease = function(){
_root.gotoAndPlay(34);
}



FlashKit > Flash Help > Flash MX
Posted on: 05-10-2005, 12:23 PM


View Complete Forum Thread with Replies

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

Define Hit Area?
hei,

how can i achieve the following: see swf-file

the grey rectangle should start fading in when i reach the red square (hit area), not already when you cross the edges of the grey square....

the "button" is a movieclip.

see also pdf:
first layer (layer 3) has the button-coding
second + third layer contain the motion-tweened rectangle/square.

thanks for helping

Define Hit Area
hei,

how can i achieve the following: see swf-file

the grey rectangle should start fading in when i reach the red square (hit area), not already when you cross the edges of the grey square.... this seems to be a easy one - if one knows (sofar about the status of my flash-knowledge!)

the "button" is a movieclip.

see also pdf:
first layer has the button-coding (see below)
second + third layer contain the motion-tweened rectangle/square.

thanks for helping

coding in the first layer:

stop();

this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}

this.onRollOver = function(){
rewind = false;
play();
}

this.onRollOut = function(){
rewind = true;
}

this.onRelease = function(){
_root.gotoAndPlay(34);
}

Define Hit Area
hei,

how can i achieve the following: see swf-file

the grey rectangle should start fading in when i reach the red square (hit area), not already when you cross the edges of the grey square.... this seems to be a easy one - if one knows (sofar about the status of my flash-knowledge!)

the "button" is a movieclip.

see also pdf:
first layer has the button-coding (see below)
second + third layer contain the motion-tweened rectangle/square.

thanks for helping

coding in the first layer:

stop();

this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}

this.onRollOver = function(){
rewind = false;
play();
}

this.onRollOut = function(){
rewind = true;
}

this.onRelease = function(){
_root.gotoAndPlay(34);
}

Define Drag Area
Hi guys me again

Right this should be simple,

I have several dragable windows in my flash site. they all drag just fine but i am having problems defineing the drag area.

this is the code from the drag button:

Code:
on (press) {
startDrag(this, false, 0, 0, _root.avai_wdth-_root.win1._width, _root.avai_heig-_root.win1._height);

}


_root.avai_heig and _root.avai_wdth are got when the movie is first loaded.

I also thought that maybe it would be easier to create a function that all the drag buttons would call to. I trinkered about with functions yesterday but with no luck

So if anyone has any suggestions in were i am going wrong i would really appreciate the help.

cheers

Define Scroll Area
Hi,

i really want to avoid using a mask to define my scroll area, is there a way to do it in AS??

cheers,
G

How To Define An OnMouseDown Area?
I'm creating an animated menu that I'd like to 'stow away' when the user clicks anywhere but the Menu button.

I know this involves adding a mouse listener for an onMouseDown event, but I'm not sure what or how to define this...

Is it possible to define an entire area (my site) minus a specific area (the menu button) for an onMouseDown event?

If someone would please help me with this script I would really appreciate it!

thanks!

How Do I Define A Mouse Area?
Hi there,
I made a scroller script, but now I am trying to figure out how to define the area in which the scroller responds to the mouse? Currently it responds to the mouse position no matter where the mouse is on the page, but I want it to just respond when the mouse rolls over a small portion of the page. Any ideas?
Thanks.


Code:
function scrolling() {
_root.scroller.handler.onEnterFrame = function() {
this._parent._y += Math.cos(((_root.text_mask._ymouse)/_root.text_mask._height)*Math.PI)*5;
if (this._parent._y>_root.text_mask._y) {
this._parent._y = _root.text_mask._y;
}
if (this._parent._y<(_root.text_mask._y-(this._parent._height-_root.text_mask._height))) {
this._parent._y = _root.text_mask._y-(this._parent._height-_root.text_mask._height);
}
};

}

Define Crop Area
G'day

Does anyone know how define a crop area whithin the stage.????

thanx

How To Define An OnMouseDown Area?
I'm creating an animated menu that I'd like to 'stow away' when the user clicks anywhere but the Menu button.

I know this involves adding a mouse listener for an onMouseDown event, but I'm not sure what or how to define this...

Is it possible to define an entire area (my site) minus a specific area (the menu button) for an onMouseDown event?

If someone would please help me with this script I would really appreciate it!

How Do I Define A Mouse Area?
Hi there,
I made a scroller script, but now I am trying to figure out how to define the area in which the scroller responds to the mouse? Currently it responds to the mouse position no matter where the mouse is on the page, but I want it to just respond when the mouse rolls over a small portion of the page. Any ideas?
Thanks.


Code:
function scrolling() {
_root.scroller.handler.onEnterFrame = function() {
this._parent._y += Math.cos(((_root.text_mask._ymouse)/_root.text_mask._height)*Math.PI)*5;
if (this._parent._y>_root.text_mask._y) {
this._parent._y = _root.text_mask._y;
}
if (this._parent._y<(_root.text_mask._y-(this._parent._height-_root.text_mask._height))) {
this._parent._y = _root.text_mask._y-(this._parent._height-_root.text_mask._height);
}
};

}

Define Drag Area
Hi guys me again

Right this should be simple,

I have several dragable windows in my flash site. they all drag just fine but i am having problems defineing the drag area.

this is the code from the drag button:

Code:
on (press) {
startDrag(this, false, 0, 0, _root.avai_wdth-_root.win1._width, _root.avai_heig-_root.win1._height);

}
_root.avai_heig and _root.avai_wdth are got when the movie is first loaded.

I also thought that maybe it would be easier to create a function that all the drag buttons would call to. I trinkered about with functions yesterday but with no luck

So if anyone has any suggestions in were i am going wrong i would really appreciate the help.

cheers

Define Print Area
anyone know how to define the print area on a scrolling text box so that all of the text prints...including that which is not shown?

Define Xmouse Movement To A Certain Area?
Hi guys...

I have an MC with the following action on the instance:
onClipEvent (enterFrame) {
mx=_root._xmouse;
if (mx<_x) {
dx=_x-mx;
}
else {
dx=mx-_x;
}

moveSpeedx=dx/5;
if (mx<_x) {
_x=_x-moveSpeedx;
}
else {
_x=_x+moveSpeedx;
}
}

How can I define this movement to a certain area of flash movie? As of now, just with this script, when I place the flash movie on an html page, the object will move no matter where the mouse is on the page, I want the object to move only when it's over a specific area of the flash movie.

thanks a ton for your help
tony

Can I Define The StartDrag Clickable Area?
I have a zoom button on a navigation panel that loads a larger photo into my movie. When the photo is zoomed users are able to drag the large photo around and see greater detail. The photo extends beyond the border of the movie and under the navigation panel.

The thing is, users also can also click in the margin areas on the navigation panel and start dragging the photo as well. The other buttons on the navigation panel still work since they are layered on top of the draggable movie. But how can I make the panel margins non-clickable?

Thanks,
DAN

Want To Define Area (size) For My_mc
I have a movie clip, which I want to move inside my stage.
can anybody give the code?

thanks & regards
ashu

Urgent : How Can I Define The Scrolling Area For A Movie Clip?
i am using the scrollbar component provided with flash. I used it with a textbox and it worked perfectly.

But when it comes using it with a movie clip how can i define that it must show only items from point A to point B and the rest must be scrolled?

tnx a lot

Load External Swf Into A Specific Area And Confine Interactivity To That Area... ?
Hello again,

I have a problem I've been trying to solve below.


I have a file that loads external swf files onto the screen, but I need these swfs to load into a specific 1024x644 area in the main movie.

I need the external swfs to maintain their interactivity while the mouse is over their area, but not when the mouse is over other parts of the screen (I need other buttons to still be accessible outside the area of the loaded swf.

As it is now, the mouse properties of the loaded swf take over the entire movie and render the buttons useless.

Below is some code I'm using. Can anyone provide examples of code that positions an external swf into a specific area and contains its interactivity?

I'm still very new to AS, so it's difficult for me to understand how to do things without specific code examples to look at. Also, if my code is inefficient or sloppy, please let me know.

Thanks.


var loader:Loader = new Loader();

function buttonPush1(event:MouseEvent):void {
var url:URLRequest = new URLRequest("mousetrail_644.swf");
loader.load(url);
this.addChild(loader);
}

Btn1.addEventListener(MouseEvent.CLICK, buttonPush1);

function buttonPush2(event:MouseEvent):void {
var url:URLRequest = new URLRequest("magnify2.swf");
loader.load(url);
this.addChild(loader);
}

Btn2.addEventListener(MouseEvent.CLICK, buttonPush2);

function buttonPush3(event:MouseEvent):void {
var url:URLRequest = new URLRequest("mapcursor_644_2.swf");
loader.load(url);
this.addChild(loader);
}

Btn3.addEventListener(MouseEvent.CLICK, buttonPush3);

function accessDenied(event:MouseEvent):void {
gotoAndPlay("scanner_denied");
}

Btn4.addEventListener(MouseEvent.CLICK, accessDenied);

Menu Area's To Stay Expanded When You Rollout The Red Area ?
I am stuck here.

I want the different menu area's to stay expanded when you rollout the red area (see attached file: red line).

I think I need to use a flag variable, but I am stuck.

Any advice, suggestions??

X Y Define
hi!
how to define x or y into actionscript for the movie trajectory like
like...
if(x>200 && y<100) {
random();
}
any suggestion?
thanx in advance!!!

How To Define FPS From As
hi, i'm asking about one thing that i need in the past and i need now.

Set for different movieclips, different fps velocity, how i make that?


tks all

How To Define This...
This code works fine with 3 buttons. But what to do if I have more than 3 buttons, let's say 5 of 'em?

// code begins

_root.picnumber=0;

this.btn1.onRelease = function () {
if (_root.picnumber == 2) {
pic2.gotoAndPlay (12);
} else if (_root.picnumber == 3) {
pic3.gotoAndPlay (12);
}
_root.picnumber = 1;
pic1.gotoAndPlay (2);
}

this.btn2.onRelease = function () {
if (_root.picnumber == 1) {
pic1.gotoAndPlay (12);
} else if (_root.picnumber == 3) {
pic3.gotoAndPlay (12);
}
_root.picnumber = 2;
pic2.gotoAndPlay (2);
}

this.btn3.onRelease = function () {
if (_root.picnumber == 2) {
pic2.gotoAndPlay (12);
} else if (_root.picnumber == 1) {
pic1.gotoAndPlay (12);
}
_root.picnumber = 3;
pic3.gotoAndPlay (2);
}

Define A Var In XML?
I want to be able to get my var from my XML file. But when I add another node in my XML file, let's say its called <picNum>3</picNum> I can't seem to get it into my flash file? Any clues on this? I only want one number under each <subnumber> node if thats possible?

I have this var in my .fla.

Code:
var picNum:Number = 3; // could be any number
and I load my XML like this:

Code:
var pArray = new Array();
var tArray = new Array();

var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (success:Boolean):Void {
if (success) {
var xmlData = this.firstChild.childNodes[0].childNodes[0];
for (var i = 0; i<xmlData.childNodes.length; i++) {
pArray.push(xmlData.childNodes[i].childNodes[0].firstChild.nodeValue);
tArray.push(xmlData.childNodes[i].childNodes[1].firstChild.nodeValue);
}
containerMC.loadPic(0);
picInfo.alphaTo(100, speed_fadeIn, tweentype_fadeIn, speed_fadeIn);
} else {
picInfo.text = "Unable to load external file.";
}
}
myXML.load("xml/XMLdata.xml")
And my XML file looks like this:

PHP Code:



<?xml version="1.0" encoding="iso-8859-1" ?>

<xmlData>
    <main>
        <subnumber>
            <subinfo>
                <path>main1/images1/01.jpg</path>
                <info><![CDATA[<p>main1, sub1</p>]]></info>
            </subinfo>
            <subinfo>
                <path>main1/images1/02.jpg</path>
                <info></info>
            </subinfo>
            <subinfo>
                <path>main1/images1/03.jpg</path>
                <info></info>
            </subinfo>
        </subnumber>
        <subnumber>
            <subinfo>
                <path>main1/images2/01.jpg</path>
                <info><![CDATA[<p>main1, sub2</p>]]></info>
            </subinfo>
            <subinfo>
                <path>main1/images2/02.jpg</path>
                <info></info>
            </subinfo>
        </subnumber>
    </main>
</xmlData>

Is There Something Like #define ?
Hi guys,

Is there something in AS3 that's like a #define in C(++) ?

Like this:

#define HORIZONTAL 1
#define VERTICAL 2

var direction:int=HORIZONTAL;

I know I can just declare variables and name them accordingly but that seems like a waste of memory.

Thanks.

How To Define This...
This code works fine with 3 buttons. But what to do if I have more than 3 buttons, let's say 5 of 'em?

// code begins

_root.picnumber=0;

this.btn1.onRelease = function () {
if (_root.picnumber == 2) {
pic2.gotoAndPlay (12);
} else if (_root.picnumber == 3) {
pic3.gotoAndPlay (12);
}
_root.picnumber = 1;
pic1.gotoAndPlay (2);
}

this.btn2.onRelease = function () {
if (_root.picnumber == 1) {
pic1.gotoAndPlay (12);
} else if (_root.picnumber == 3) {
pic3.gotoAndPlay (12);
}
_root.picnumber = 2;
pic2.gotoAndPlay (2);
}

this.btn3.onRelease = function () {
if (_root.picnumber == 2) {
pic2.gotoAndPlay (12);
} else if (_root.picnumber == 1) {
pic1.gotoAndPlay (12);
}
_root.picnumber = 3;
pic3.gotoAndPlay (2);
}

Define This Var?
How can I make this work? I'm trying to define a var of my textdoc in order to just have to change it in one place. The textdocs reside in a folder called "_textdocs". Here's what I'm trying to do:

Code:

var myDoc = textdoc.txt;
lv.load ("_textdocs/" -- what to write here? --);

Define Label In AS
Hi,
i try to define a lable in ActionScript. Is this possible? Or can i get a lable with AS like "foo = lable at framenumber"?

thx

necro

How 2 Define A Swf Loaded Into MC?
I am loading external swfs into an invisible MC on root timeline. I want to tell this swf to unload after the movie has completed - and return to 1st frame root in prep for another movie. I have tried several action script strings of unload movie, tell target stop, go to new frame, etc. I think that my problem is defining the swf within the movie clip. . . .
Last attempt was:
on swf - last frame:
stop
tell target _root.InvisMCName
unload movie name.swf
This did not work - help help help help
Go see http://www.blackdiamondproductions.com
screening room page for visual
Much thanx-d

Define Matrix
please help me with a *.fla example, to know how to define, then to compute a inverse of a matrix

Define ContainerMC Plz
hey all!

dumb question: im looking at this script, and this guy keeps referring to the "containerMC". can anyone explain this to me?

thanks in advance!

- nick

How Can I Define Another Popup?
i followed the steps for the new popup window and it worked http://www.flashkit.com/tutorials/Ac...-708/index.php

but how can i do this with 3 different buttons,whose open all a different popup window.

Where To Define Function
I have several scenes that use the same movie, this movie contains a logout button and i want to place all the logout commands in a function somewhere. the logout button exists on several movies as well. I want to place the function in a place where i only have to modify it once so that it is accessible to all scenes at any time. Where should this function be placed that that it is basically global to all scenes and movie

Thanks

Please Someone Help Me Define What An Object Is.
ok I have been writing/scripting actionscript and all the documents books etc dress up what they are, with explanations of chocolate boxes, simple boxes.

But when i scripting for example "taken from a book"

mycolor = newcolor(shirt);
mycolor.setRGB (OxFF3300);

My understanding is that an object contains lots of others scripts that are pre-made that tell actionscript how to change the definitions of the properties of the movieclips/sounds etc all you do is enter the properties into the parentheses to alter these properties...

Am I correct or is there a better way of explaining this, or is my question badly phrased???

Please help as I really want to nail this concept

tanks

stef

Define Object
You were right that the Object was not properly defined. Could you explain what this actually means/does?


this["testData"+c] = {};

POST Or GET: How To Define?
Can I pick and choose which var to send? or Flash just sends them all?

How To Define Two Or Three Variables As A One In The End?
Hello,
I need a help.
I am working on a small form where there are three fiedls with variable names assigned. In the end, I need to send all three variable as one variable to the server. It something like phone numbers fields - 111 222 3333.
Is that possible to create a script which will pass all three variables from those fields to the one hidden field which will actually have all numbers in one. It is like - 1112223333.
Also, I am using radio buttons and wondering how to assign in this situation a variable which be possible to get after clicking a radio button.
Just in case, I am sending a test.fla file which describes everything.
Any advise is highly appreciated.
Many thanks in advance!!!

Define Levels
as being a newbie in flash world i am getting confused in scripting the flash as i wanted to load external swf in flash
a member helped me i do so that i have understood the that how can i load but dont know how should i adjust the dimensions of the swf through my MAIN movie in whih in want to load he gave FLA exactly of what kind i want but i m not able to understand the actionspirit key words i m pasting the code here plzz interpret this piece of code like the key word _level and much more in this code here it is


this.onEnterFrame=function(){
//trace the percentage of the movie that has loaded
percent=(_root.containerMC.getBytesLoaded()/_root.containerMC.getBytesTotal())*100;

if(!isNan(percent)){
// The following only concern the preloader's displays...
if (percent == 0) {
percent_display = "";
} else {
percent_display = Math.ceil(percent) + "% LOADED.";
}
this.loadbar._visible = true;
this.loadbar._xscale = percent;
if (percent > 1) {
this.reelmc._visible = true;
}
// End of preloader's displays...
_root.containerMC.stop();
}
if(percent == 100){
// this sends this preloader clip back to frame 1
// where it awaits the next call to it...
this.gotoAndStop(1);
// this deletes this onEnterFrame event...
// so that the movie clip stops looping...
delete this.onEnterFrame;
// preloader's displays handling...
this.reelmc._visible = false;
percent_display = "";
this.loadbar._visible = false;
// end of preloader's displays handling...
_root.containerMC.play();
}
}
stop();


as i came to know the above code is of preloader simply
and the mc which is to be laod contains an other code here
i think its better to upload the fla
please explain the function of the coding above also i m loading the FLA and swf if any one examines that fla and tell me the beckend procedure of fla and preloader i ll b very i ll be very obliged
GOD BLESS U ALL

Define A Rule
Hi there
I want to set a rule that makes a particular movie to be invisible when the mouse is within zone x=0-100 and y=0-100 and visible when its not.

(Im using MX)

I know its not good policy to cross postings, but.. as i dont get replys in the newbies forum..

Thanks in advance

Define Object
Hi,

i am trying to define a dynamic object name.. here my code, but i guess it is wrong. any ideas?


PHP Code:



i = 0
var knobListen = "knob"+i;
var knobListen:Object = new Object();
};
//add the event listener to the knob
myKnob_mc.addEventListener("onRotate", knobListen)

Can Someone Define These Terms For Me?
I want to know what a string, boolean, array, and class are? I get confused when I am learning tutorials and they are given values but I am not sure what they stand for?

Define Operator
Hi all!
Just a quick question (I hope hehe)... How do I define operators in actionscript? For instance, if I have my own data type and want to use for example + on it?

Define The Name Of The Clip
have some clips on the stage dynamicaly attached like this
_root.attachMovieClip('clip', 'clip'+i, i, {_x:_xmouse, _y:_ymouse}
need to remove any clip by clicking on it, but i don't now how to define the name of the clip eval('clip'+i), how can I get i?

Define Root
What is the syntax for defining, locking or setting a new _root for a movie?
I am calling movies into movies and it would help with the pathing.

Is It Possible To Define A Tween Without Using It?
Hello, I have some problems with stopping my tweens when rolling in/out on objects. When I trace them it says undefined but I found out that it works if i write the tween outside the rollover/out function but I dont want to trigger the tween before they should get triggered.
So im wondering if theres any way I can write the tween without using it and then later use tween.start(); and tween.stop();?

at the moment the tween looks like this:
var tw9:Tween = new Tween(mc,"_alpha",Strong.easeOut,0,50,1,true);

App Define Problem
I apologize, but I'm a Flash Communication Newb. I'm pro with plain actionscript - php - mysql. I'm sure I'm missing something here that's right infront of my face.

I bought a book about flashcom server. my first app worked perfectly. it used the UI components simple connect, peoplelist, connectionLight, userColor, and chat. This program worked perfectly and I was able to communicate over my network at my house. But now when I went on to the next chapter, my second app isnt working so great.. in fact its not working at all

I think that i didn't define it properly, because when i open Communication App Inspector, and try to manually start up mySecondApp/myInstance then it doesn't load in. I have no problems manually loading in myFirstApp/myInstance.

i have the main.asc with this code in it


Code:
load("components.asc");
the second application is located in www/flashcom/applications/mySecondApp

and it contains the main.asc file, the the mySecondApp.swf and the html file to embed it. (that one doesn't need to be there, i can embed the file from anywhere)

here's the actionscript inside mySecondApp.swf


Code:
// Include the Debug Class file
#include "NetDebug.as"

// create a new instance of the NetConnection object
myConnection_nc = new NetConnection();

myConnection_nc.onStatus = function(info){
trace("LEVEL: " add info.level add " CODE: " add info.code);
}

myConnection_nc.connect("rtmp:/mySecondApp/myInstance", "Bryan Colvin");

connectLight_mc.connect(myConnection_nc);
peopleList_mc.connect(myConnection_nc);
when i test this it traces this to me

LEVEL: error CODE: NetConnection.Connect.Rejected
LEVEL: status CODE: NetConnection.Connect.Closed

All i have in the stage is the connectionList and peopleList components.

ive tried changing rtmp:/ to rtmp:// my book says if you're connecting to localhost that you only use one slash (it worked for myFirstApp)

I'm missing something small here i know it

any ideas?

If/else, How To Define The Condition
Hi--

I am wondering how to define the condition of an if statement. I have an animation of two rectangles:


PHP Code:



onEnterFrame = function(){
rectangle01.slideTo(0, 0, 1.8);
rectangle02.slideTo(360, 0, 1.8);







Would I use an if statement to find out if the animation is finished? If so, would the condition be the x,y pos of the mc's?

Any help would be appreciated.

Thanks.

Define Swf - Pixels
If I define a swf through pixels and no scale how do I than get it to stay centered both up and down and full screen in the browser window?

I can not seem to get this pixel thing to work for me - I am trying to have the swf auto resize back to 800x650 no matter what the persons screen resolution may be!

Can anyone maybe write me a full proof code or guide me the right direction - I work best in steps format (1, 2, 3, 4, ect . . .)

Define Keycode
How can I define keyCode (ESC button) in the following example to make the movie play:

inv_btn.addEventListener(KeyboardEvent.KEY_DOWN,buttonESC);
function buttonESC(Event:KeyboardEvent):void {
play();
}

How Do I Define A Character?
Hi, I'm getting a warning because there's no type declaration in the following line
Code:
var startChar = k.substring(0,1);

What should I declare this as?? A String? I couldn't find a character type....
The next line is
Code:
if(startChar == 'o'){
Do SOmething....
}

Any ideas?

Can Anyone Define Targets. And Tell Me What They Do
hi. can anyone define all the targets? like "_blank" --- what does that make it do



_blank
_parent
_self
_top



can you define those for me. thanks

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