Simple ROLL_OVER Question.
Hey i'm sure this is a simple question for someone, I have a header im working on thats is flash, and is basically images with a rollover and rollout using a class. Most the time it works without a hitch but sometimes it gets stuck between the rollover and rollout and pulsates. Should i apply the rollout when the tween is finished? Thanks! Any help appreciated.Code: package{ import flash.events.*; import flash.net.*; import flash.display.*; import caurina.transitions.Tweener; import flash.filters.DropShadowFilter; public class PARTYPURPOSE extends MovieClip { public function PARTYPURPOSE() { addEventListener(MouseEvent.ROLL_OVER, onOver); addEventListener(MouseEvent.ROLL_OUT, onOut); } public function onOver(event:MouseEvent):void { Tweener.addTween(event.target, { scaleX:.75, scaleY:.75, time:.5 } ); event.target.filters = [new DropShadowFilter(0,0,0x000000,90,20,20,.8,3)]; stage.addChild(this); } public function onOut(event:MouseEvent):void { Tweener.addTween(event.target, { scaleX:.5, scaleY:.5, time:1 } ); event.target.filters = []; } } //ends class} // ends packageand here you can see the actual application:http://www.pawspetplace.com/nick
Actionscript 3.0
Posted on: Mon Jul 28, 2008 8:29 pm
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
- Roll_over & Roll_out
- ROLL_OVER, ROLL_OUT Looping
- ROLL_OVER Behavior Inconsistent
- ROLL_OVER & ROLL_OUT Problems
- ROLL_OVER / ROLL_OUT Issue
- Roll_over & Roll_out Problems
- ROLL_OVER, ROLL_OUT Problem
- Image Is Replaced On ROLL_OVER?
- ROLL_OVER Behavior Inconsistent
- AS3 Sound On Mouse Roll_over
- ROLL_OVER, ROLL_OUT Interfering With Each Other?
- AS3 - Stage Listener For ROLL_OVER
- ROLL_OVER/ ROLL_OUT? Tween Problem?
- AddEventListener To MouseEvent.Roll_Over Not Working
- ? ROLL_OVER Not Working Over Whole Object Area ?
- Dynamic MC Has Multiple Hotspots On ROLL_OVER?
- AS3 - Event Handling With ROLL_OVER And ROLL_OUT
- ActionScript 3 XML Basics - SelectedItem On ROLL_OVER?
- Event Handling And MOUSE.ROLL_OVER And MOUSE_OVER
- Loading Multiple Text Files On ROLL_OVER
- Event Handling And MOUSE.ROLL_OVER And MOUSE_OVER
- ROLL_OVER Button State "jumpy"?
- ROLL_OVER Button State "jumpy"?
- ROLL_OVER Plays A MC And ON_CLICK Plays A MC?
- LoadMovie SIMPLE Question For Simple Minded Graphic Artist
- Can You Help Me Fix Simple Javascript Code On Button Inside My Very Simple Component?
- [F8] Very Simple Question, Very Simple Answer, I Hope. (Flash 8, Collisions)
- Can You Help Me Fix Simple Javascript Code On Button Inside My Very Simple Component?
- Simple Problem. Simple Answer? Arranging Windows W/flash
- Random Tweens - Simple Question, Simple Answer?
- HELP SIMPLE, SIMPLE XML-FLASH Load Into Movie Clip
- Simple Problem Neeeds Simple Answer
- Simple Question, Probable Simple Answer
- Simple Button Mouseover Effect - I Know It's Simple, Just Don't Know How To Do It
- Simple Button, Needs Simple Action Script
- Simple Question - Simple Answer FLASH MX
- Simple, Simple... Input Field Question
- Simple Question *(I Hope) From A Simple Newbie...
- Simple Questions...mean Simple Answers....right?
- Simple Question.....any Simple Answers?
- Simple Problem Simple Solution?
- Simple Problem, Simple Movie
- Simple Question - Simple Answer?
- Need A Simple Script For A Simple Button
- Simple Question With Hopefully A Simple Answer.
- Simple Problem In Need Of A Simple Solution
- Simple Or Not So Simple GetURL() Problem
- SIMPLE Simple Actionscript Question
- Simple Loadvariables Task Not So Simple... Why?
Roll_over & Roll_out
Hello,
I have a navigation section that i want to fade in whenever the entire navsection has an active cursor over it. The navsection also includes a series of button_mc's that allow the user to navigate.
I have the Nav Section (instance named bg) animating properly, but whenever i move from 1 button to the next, it replays the alpha fade in.
Here's my code:
Code:
package {
import flash.display.*;
import flash.net.*;
import flash.events.*;
import flash.text.*;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
public class Sfgdc extends MovieClip {
public var sfStat:Boolean = false;
// create a new LocalConnection instance used to send
// calls to a LocalConnection instance in another movie
var outgoing_lc:LocalConnection = new LocalConnection();
public function Sfgdc() {
visitors.addEventListener(MouseEvent.ROLL_OVER, myOver);
visitors.addEventListener(MouseEvent.ROLL_OUT, myOff);
visitors.addEventListener(MouseEvent.CLICK, linkVisitors);
visitors.buttonMode = true;
online.addEventListener(MouseEvent.ROLL_OVER, myOver);
online.addEventListener(MouseEvent.ROLL_OUT, myOff);
online.addEventListener(MouseEvent.CLICK, linkOnline);
online.buttonMode = true;
help.addEventListener(MouseEvent.ROLL_OVER, myOver);
help.addEventListener(MouseEvent.ROLL_OUT, myOff);
help.addEventListener(MouseEvent.CLICK, linkHelp);
help.buttonMode = true;
textv.addEventListener(MouseEvent.ROLL_OVER, myOver);
textv.addEventListener(MouseEvent.ROLL_OUT, myOff);
textv.addEventListener(MouseEvent.CLICK, loadError);
textv.buttonMode = true;
}
function myTrace(event:MouseEvent):void {
trace("Home --> Click");
}
function myOver(event:MouseEvent):void {
var myTween:Tween = new Tween(bg.cover_mc, "alpha", Strong.easeIn, 0, 1, .15, true);
}
function myOff(event:MouseEvent):void {
var myTween:Tween = new Tween(bg.cover_mc, "alpha", Strong.easeIn, 1, 0, .15, true);
}
function linkVisitors(event:MouseEvent):void {
trace("Home --> linkVisitors");
outgoing_lc.send("Channel", "linkVisitors");
}
function linkOnline(event:MouseEvent):void {
trace("Home --> linkOnline");
outgoing_lc.send("Channel", "linkOnline");
}
function linkHelp(event:MouseEvent):void {
trace("Home --> linkHelp");
outgoing_lc.send("Channel", "linkHelp");
}
function linkTextv(event:MouseEvent):void {
trace("Home --> linkText");
outgoing_lc.send("Channel", "linkText");
}
function loadError(event:MouseEvent):void {
trace("Home --> Error");
outgoing_lc.send("Channel", "myError");
}
}
}
So in other words, when i go from 1 button to the next, it plays the ROLL_OUT and creates a flash effect. I'd prefer it that if it was within the main Nav Section it just stayed opaque.
ROLL_OVER, ROLL_OUT Looping
Hi all, I am working on a small file and am having a very frustrating time dealing with uncontrollable looping of a an actionscripted animation. Basically I have a series of pins and a series of labels. When you mouse over the pin a a label appears. If I set it up to only appear and not disappear it works fine. When I have the ROLL_OVER set to have the label appear and the ROLL_OUT set to have it disappear it loops like crazy. I can't figure out how to get it to do each operation once only and then reset itself once the mouse is off of the pin location. I have included my code for any pointers. I have tried calling button operations as functions and directly embedding it in the button script. I included my FLA as well. Thanks so much!
ActionScript Code:
stop();
import flash.events.MouseEvent;
import fl.transitions.Tween;
import fl.transitions.easing.*;
var pinMiamiTween:Tween = new Tween(pinMiami, "y", Strong.easeIn, -50, 151, 1, true);
var pinWeymouthTween:Tween = new Tween(pinWeymouth, "y", Strong.easeIn, -50, 106, 1.5, true);
var pinScotlandTween:Tween = new Tween(pinScotland, "y", Strong.easeIn, -50, 96, 1.25, true);
var i:int = 1;
sailMiami.alpha = 0;
pinMiami.addEventListener(MouseEvent.ROLL_OVER,miamiOver);
function miamiOver(MouseEvent) {
if (i==1) {
var pinMiamiTweenIn:Tween = new Tween(sailMiami, "x", Strong.easeOut, 200, 287, 1, true);
var pinMiamiAlphaIn:Tween = new Tween(sailMiami, "alpha", Strong.easeOut, 0, 1, 3, true);
i = 2;
}
}
pinMiami.addEventListener(MouseEvent.ROLL_OUT,miamiOut);
function miamiOut(MouseEvent) {
if (i==2) {
var pinMiamiAlphaOut:Tween = new Tween(sailMiami, "alpha", Strong.easeOut, 1, 0, 1, true);
i=1;
}
}
ROLL_OVER Behavior Inconsistent
I am working on a series of puzzle games.
Each piece is a movie clip. When the mouse rolls over a piece, its child object movie clip, called the "rotation mark", appears on the piece. (This is to allow the user to rotate the piece by clicking on it). When the mouse leaves the piece the rotation mark disappears.
I accomplish this by way of ROLL_OVER and ROL_OUT event handlers on the piece movie clip. On ROLL_OVER I simply set the rotation mark movie clip's visible property to true, and on ROLL_OUT I set it to true.
Here is what it looks like. (The mouse cursor doesn't get captured when you take a screen shot in Windows.)
When the mouse is moved over the rotation mark, inconsistent behaviour results:
1) When I try it with Control -> Test Movie in Flash it still seems to be considered "over" the piece.
2) However when I run the SWF embedded in an HTML file, moving the mouse over the rotation mark results in the piece dispatching a ROLL_OUT event.
(This causes the rotation mark to blink because when it's gone the piece fires ROLL_OVER, causing it to reappear, which causes the piece to fire ROLL_OUT again, ad infinitum.)
3) When I try it with Debug -> Debug Movie in Flash I get the same result as 2 above.
Why are these different? What is the expected behaviour.
One thing you may note is that all the MCs here (pieces as well as rotation mark) are loaded assets from external library SWFs. Before, when I had them all in a single SWF that was running I was getting the same results as 1 above in all cases. It was after I changed my design to have use a shell SWF and external libraries that this inconsistent behaviour began.
Any thoughts or ideas?
ROLL_OVER & ROLL_OUT Problems
Hello everyone,
I'm new to AS 3.0 and I'm trying to make a set of simple thumbnails with roll over and roll out effect. When I roll over one thumbnail in a row it has to scale up, and other thumbnails have to move to left and right respectively, and when I roll out everything has to go to it's original place. Problem is, when I roll out from one thumbnail and roll over the other one directly, other thumbnails don't go to their original position. I'm using Tween class for thumbnail motion and I suppose that I need to use TweenEvent.MOTION_FINISH but don't know how exactly...
I attached .fla and .as file, so if anyone can help I would appreciate it!
Sorry for my English...
ROLL_OVER / ROLL_OUT Issue
I'm in the process of writing a 'elastic' tooltip class, where the tooltip follows the mouse with a small delay, making it look like an 'elastic' effect.
You can se an example here:
http://www.2xmedie.dk/develop/tooltip/
(Try to touch the tooltip with the mouse)
Sourcefiles here:
http://www.2xmedie.dk/develop/tooltip/source.rar
There's one issue though: When the mousepointer touches the tooltip it self, it causes an MouseEvent.ROLL_OUT on the target movieclip
This is causing the tooltip movieclip to 'flicker' since ROLL.OVER and ROLL.OUT are called constantly.
Can I some how, make sure, that the MouseEvent.ROLL_OUT is NOT called, when the mousepointer touches the tooltip movieclip?
I was looking at the method preventDefault() - but I'm not sure how to implement it.
Can someone please advice?
Roll_over & Roll_out Problems
Hello, I'm a newbie to the max. First off, I'm thankful that there are forums like this to help me out, it's very challenging but since I'm just beginning and I need all the help I can get.
Code:
stop();
btnGroup.addEventListener(MouseEvent.ROLL_OVER, target, false, 0, true);
btnGroup.addEventListener(MouseEvent.ROLL_OUT, out, false, 0, true);
btnGroup.mouseEnabled = true;
btnGroup.buttonMode = true;
var btnName:String = "";
function target(evt:MouseEvent):void {
btnName = evt.target.name;
gotoAndStop(btnName);
}
function out(evt:MouseEvent):void {
gotoAndPlay('first');
}
I've created all the movieclip buttons, and I put them all on stage to create a btnGroup. I'm not quite sure if they (btn1, btn2, etc.) have instance names EACH, so that might be a problem. The btnGroup is the one on stage, none of the btns are. The btnGroup has an instance name, and I've created empty frame labels. The problem, when I Test Movie, is that it just plays through the movie and does not stop anywhere, nor is there a "hand" to click any of the buttons. btn1 is the only one prepared for the roll over effect as of now, and thats why there are no more keyframes in the text1 layer.
When there is a rollover, I want static text to appear and the rollout is to start over, empty on stage.
ROLL_OVER, ROLL_OUT Problem
Any ideas what could cause a ROLL_OVER & ROLL_OUT displayObject repeat the listener functions over and over again, as if you were rolling out and in over and over again, but you're not?
There's no way I can show all the code, it's part of a large & complicated app.
Image Is Replaced On ROLL_OVER?
How can I display a still image on the stage that loads on the first
frame and when the user rolls over a button, the button plays a movie
clip in place of the still image? So the image is temporarily swapped
with the movie clip.
I am currently using the following code provided in another thread to
make the movie clip play onrollover:
function showGraphic(event:MouseEvent):void {
mSymbol.visible = true;
}
function hideGraphic(event:MouseEvent):void {
mSymbol.visible = false;
}
btn.addEventListener(MouseEvent.ROLL_OVER, showGraphic);
btn.addEventListener(MouseEvent.ROLL_OUT, hideGraphic);
I am also using the following code to hide the movie clip on load:
mSymbol.visible = false;
Thanks!!!
ROLL_OVER Behavior Inconsistent
I am working on a series of puzzle games.
Each piece is a movie clip. When the mouse rolls over a piece, its child object movie clip, called the "rotation mark", appears on the piece. (This is to allow the user to rotate the piece by clicking on it). When the mouse leaves the piece the rotation mark disappears.
I accomplish this by way of ROLL_OVER and ROL_OUT event handlers on the piece movie clip. On ROLL_OVER I simply set the rotation mark movie clip's visible property to true, and on ROLL_OUT I set it to true.
Here is what it looks like. (The mouse cursor doesn't get captured when you take a screen shot in Windows.)
When the mouse is moved over the rotation mark, inconsistent behaviour results:
1) When I try it with Control -> Test Movie in Flash it still seems to be considered "over" the piece.
2) However when I run the SWF embedded in an HTML file, moving the mouse over the rotation mark results in the piece dispatching a ROLL_OUT event.
(This causes the rotation mark to blink because when it's gone the piece fires ROLL_OVER, causing it to reappear, which causes the piece to fire ROLL_OUT again, ad infinitum.)
3) When I try it with Debug -> Debug Movie in Flash I get the same result as 2 above.
Why are these different? What is the expected behaviour.
One thing you may note is that all the MCs here (pieces as well as rotation mark) are loaded assets from external library SWFs. Before, when I had them all in a single SWF that was running I was getting the same results as 1 above in all cases. It was after I changed my design to have use a shell SWF and external libraries that this inconsistent behaviour began.
Any thoughts or ideas?
AS3 Sound On Mouse Roll_over
hi... i've been experimenting with some buttons in AS3 and sounds... actually the buttons are movie clips and i'm trying to attach a sound to the ROLL_OVER action...
i used this code:
Code:
var buttonSound:Sound = new Sound();
var buttonSoundControl:SoundChannel = new SoundChannel();
buttonSound.load(new URLRequest("buttonsound.mp3"));
button_mc.addEventListener(MouseEvent.ROLL_OVER, RollOverListener);
function RollOverListener(e:MouseEvent):void
{
e.currentTarget.gotoAndStop(2)
e.currentTarget.buttonMode = true;
buttonSoundControl = buttonSound.play();
e.currentTarget.addEventListener(MouseEvent.CLICK, ClickListener);
}
so this code works.. but it loads the sound externally... and after a few minutes of browsing through the website the roll_over sound becomes laggy... i'm guessing it's because it loads over and over in the memory when hovering the buttons.. btw here is the website so you can try it for yourself:http://www.test.bvbusinessconsulting.ro/
my idea is to attach the sound to the swf file... i know that in AS2 there was a function attachSound() but this one is missing in AS3 and has now equivalent...
so if someone could help me on this one i would be really greateful!!
thanks in advanced!
ROLL_OVER, ROLL_OUT Interfering With Each Other?
I made a few movieclip buttons and when I when I roll my mouse over them they work just fine. They have an Over and an Out animation.
However, if I move my mouse around somewhat quickly over them all, the Over state for the button will stay on. They're only supposed to be active one at a time. I can move the pointer all around and the buttons won't always ROLL_OUT as I roll out and the ROLL_OVER state will stay on.
This isn't the first time I've had this happen. What can make these buttons work more efficiently when moving your mouse quickly over them?
Here is my AS3.
Actionscript Code:
but3.addEventListener(MouseEvent.ROLL_OVER, onButOver);but3.addEventListener(MouseEvent.ROLL_OUT, onButOut);but2.addEventListener(MouseEvent.ROLL_OVER, onButOver);but2.addEventListener(MouseEvent.ROLL_OUT, onButOut);but1.addEventListener(MouseEvent.ROLL_OVER, onButOver);but1.addEventListener(MouseEvent.ROLL_OUT, onButOut);
function onButOver (event:MouseEvent) { event.currentTarget.gotoAndPlay("over");}function onButOut (event:MouseEvent) { event.currentTarget.gotoAndPlay("out");}
There has to be a way to do this. I have been to sites where I can roll over as fast as I want and the states will change. I can roll in and out of one button really quick and leave it in the ON state without it rolling out.
EDIT: This seems to only happen when the buttons are closer together. So picture 3 circles (100x100) about 15 pixels apart. Any help would be appreciated!!!
AS3 - Stage Listener For ROLL_OVER
Hi!
When I add an event listener that listens for ROLL_OVER on the stage, it doesn't work. I know MOUSE_OVER works but that fire:s on every enterframe and that's not what I want. So, how come ROLL_OVER doesnt work and how does one create this kind of listener for the stage? I just want to know if the mouse is somewhere within the stage, adding some kind of old school "clickArea" MC or something like that just doesn't seem to be the best solution...
Ideas anyone?
ROLL_OVER/ ROLL_OUT? Tween Problem?
Hi, i'm working on a gallery made from 8 squares which move when i roll over anyone of them, and on roll out it have to go back to its original position.
I have a strange problem. It all began when i was trying to remove non smooth movement on roll out. It was becouse of the same time in tween on roll over and roll out but when user rolls out before the square will come to the final position, the square will have to move just ie. 10 pixels, in time, ie 2s. So its not smooth. So i calculate the time, so the movement would be smooth.
Everything ok but when i changed the time its not working like it should.
The code is simple. And i thought it should work. But when i roll out before end position, strange thing is happening. The square jumps to the end position. Anyone could help? :/
Code:
var moveTween:Tween;
test_mc.addEventListener(MouseEvent.ROLL_OVER, in1);
test_mc.addEventListener(MouseEvent.ROLL_OUT, out1);
var time:Number = 2;
function in1(e:MouseEvent):void {
moveTween = new Tween(test_mc, "y", None.easeNone, test_mc.y, 260, time, true);
moveTween.start();
}
function out1(e:MouseEvent):void {
moveTween = new Tween(test_mc, "y", None.easeNone, test_mc.y, 222.5, ((time*(test_mc.y-222.5))/37.5), true);
moveTween.start();
}
As attachment i include example file with one square made this way i made it in the gallery. And with the same error.
Btw. Strange thing is that the same error is when i use Caurina Tweener class...
Well, sorry for my english:/
AddEventListener To MouseEvent.Roll_Over Not Working
Alright, so I'm an intermediate with flash but really new to AS 3.0. I've recently started using Flash 9 with CS3 and am having a bear of a time with this one small issue.
Here is the file in use
http://www.cyan-studios.net/hpe2/
It's the left side of the header. So far, I've only made the first drop down menu, under "about us" work. Sort of. If you hover over "Locations", the flyout menu appears. Then if you hover over "Clients", that flyout then appears. Now try going back to the "Locations" button. No flyout.
The drop down from "About Us" is a movie clip called "About us" and it appears in frame 2 of the main scene. Clicking or hovering over the "About Us" button drives us over to frame 2. Not an issue there.
In the "About Us" movie clip, we have a similar setup. Frame 2 shows the flyout menu from locations. Frame 3 shows the flyout menu for "Clients". Frame two is labeled "locationstier2" and frame three is "clientstier2" in this movie clip.
My issue is, why doesn't the flyout reappear next to "Locations" after you've moved on to "Clients" unless you reset it by mousing away?
Here is the action script on the top layer as it spans across the three frames.
Code:
locationsclick.addEventListener(MouseEvent.MOUSE_OVER,locationsover);
clientsclick.addEventListener(MouseEvent.MOUSE_OVER,clientsover);
function locationsover(event:MouseEvent): void {
gotoAndPlay("locationstier2");
}
function clientsover(event:MouseEvent):void {
gotoAndPlay("clientstier2");
}
? ROLL_OVER Not Working Over Whole Object Area ?
Hi,
Now I am experiencing some weirdness on my roll-overs. I have a movieClip called "illustration". Illustration contains three children: "IllustrationText", "IllustrationTextRed", and a square vector graphic (distorted in illustrator) to sit below those two text objects.
My code:
PHP Code:
illustration.addEventListener(MouseEvent.ROLL_OVER, onIllustrationOver);
illustration.addEventListener(MouseEvent.ROLL_OUT, onIllustrationOut);
function onIllustrationOver(event:MouseEvent):void
{
illustration.swapChildren(illustration.illustrationText, illustration.illustrationTextRed);
}
function onIllustrationOut(event:MouseEvent):void
{
illustration.swapChildren(illustration.illustrationText, illustration.illustrationTextRed);
}
The roll-over doesn't appear to be triggered by the square vector graphic (I want it to be triggered by this)
The roll over appears to be triggered by the text outline in some areas but in others it appears to be triggered by the square vector graphic.
Anybody ever seen this happen??
Thanks for your help!
-Brian
Dynamic MC Has Multiple Hotspots On ROLL_OVER?
Hello all,
I have tight deadline on commercial project done in as3, so forgive the brief post.
has anyone ever seen a dynamic button have multiple hotspots?
Objects inside my nav are triggering the rollOver rather than the entire nav.
a menu tab is created dynamically from a MC exported as a Class.
there is dynamic text and an image populating it from xml.
Behind those is a panel made in flash.
when I roll over the menu tab, both the text and the image trigger the rollOver function. Why the panel in the background doesn't I have no idea.
Its almost like the panel isn't there and it sees the image and text as two seperate targets.
Of course I can post my code, but I was wondering if anyone has experience with this.
Thanks in advance.
AS3 - Event Handling With ROLL_OVER And ROLL_OUT
Hello everyone,
I have been a bit confused about the right or proper way of implementing the following mouse events that i want to handle.
For example, lets say there are 3 seperate display objects on the Stage called btn1, btn2, and btn3.
All 3 buttons have ROLL_OVER and ROLL_OUT events. The current code works in a way that when a user rolls over a button then ROLL_OVER listener for that button is removed and ROLL_OUT listener is added for that button. And vice versa when roll out.
I want to be able to control when a user clicks on the Stage directly (MOUSE_DOWN) and then rolls over any button on the Stage while still MOUSE_DOWN and no roll over events should be triggered. I have implemented this simply by removing event listeners for each button when MOUSE_DOWN event is triggered on Stage. So far everything works fine.
When MOUSE_UP is triggred directly on the Stage i check whether e.target == e.currentTarget and if so then i know that the MOUSE_UP was directly on Stage and then I add all roll over listeners for the buttons on stage.
However, to add to all this, i want to be able now: when MOUSE_UP on any of the buttons from MOUSE_DOWN on the Stage to trigger that particular button's roll over event??????
So far i have not been able to figure out the right way how to do it. I have been able to accomplish the above with one button when i call the button's roll over functions when MOUSE_UP is triggered but that only works with one button.
When there are more that one button involved then i have to check to see which object has triggered the event and then dispatch the right event whether roll over or roll out.
I have been looking into creating a custom events dispatching class where i would dispatch events with paramaters specifying the status of the buttons etc, but i am confused which is the simples and most efficient way.
I am just a newbie with AS3.
Any help with this would be appreciated.
Thanks in advance.
janis
ActionScript 3 XML Basics - SelectedItem On ROLL_OVER?
Is there a way to modify this tutorial to execute selectedItem on ROLL_OVER instead of click?
I changed
lb.addEventListener(Event.CHANGE,itemChange);
to
lb.addEventListener(MouseEvent.ROLL_OVER, itemChange);
but when I rollover a list item I get:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at as3xml_finished_fla::MainTimeline/itemChange()
Thanks!
Event Handling And MOUSE.ROLL_OVER And MOUSE_OVER
hello everyone,
i have been learning AS3 for couple of weeks now and been getting with creating my website. however, i have gotten to the point where interactivity needs to be implemented.
basically what i want is this:
i want to have for example two buttons or sprites on the stage not nested and have RollOver and RollOut events triggered accordingly. However, when MouseDown on Stage and then RollOver on btn1 or btn2 I dont want any events triggered. RollOver should be triggered only when directly RollOver or when MouseUp from Stage or other object.
Bellow is the code i have been writing and it does what i want to some extent:
what this code below does is this:
when MouseDown on Stage listener for RollOver on btn1 is removed
when MouseUp directly on Stage listener for RollOver on btn1 is added
when MouseDown on Stage and MouseUp on btn1 RollOver on btn1 is called (exactly what i needed when i add tweens)
???? the question still remains now, what about if i have more then one button and when you MouseDown on Stage and MouseUp on respective button all RollOver events will be triggered.
Any ideas on how to implement this better, anyone?
What about using some custom events and dispatch them accordingly? I am still learning AS3 therefore i do not have enough overall knowledge about the best implementation and how to go about things.
Here is the code:
stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown_stage);
trace("Added MouseDown on Stage");
btn1.addEventListener(MouseEvent.ROLL_OVER, onRollOver_btn1);
trace("Added RollOver on btn1");
private function onRollOver_btn1(e:MouseEvent):void {
trace("RollOver btn1" + e.target + e.currentTarget + e.eventPhase);
btn1.removeEventListener(MouseEvent.ROLL_OVER, onRollOver_btn1);
trace("-removed RollOver btn1");
btn1.addEventListener(MouseEvent.ROLL_OUT, onRollOut_btn1);
trace("+added RollOut btn1");
trace("-removed MouseDown Stage" + e.target + e.currentTarget + e.eventPhase);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown_stage);
trace("-removed MouseUp Stage" + e.target + e.currentTarget + e.eventPhase);
stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp_stage);
}
private function onRollOut_btn1(e:MouseEvent):void {
trace("RollOut btn1 " + e.target + e.currentTarget + e.eventPhase);
btn1.removeEventListener(MouseEvent.ROLL_OUT, onRollOut_btn1);
trace("-removed RollOut btn1");
btn1.addEventListener(MouseEvent.ROLL_OVER, onRollOver_btn1);
trace("+added RollOver btn1");
stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown_stage);
trace("+added MouseDown Stage");
}
private function onMouseDown_stage(e:MouseEvent):void {
if(e.target == e.currentTarget){
trace("MouseDown directly Stage" + e.target + e.currentTarget + e.eventPhase);
stage.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown_stage);
trace("-removed MouseDown Stage");
stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp_stage);
trace("+added MouseUp Stage");
btn1.removeEventListener(MouseEvent.ROLL_OVER, onRollOver_btn1);
trace("-removed RollOver btn1");
}
}
private function onMouseUp_stage(e:MouseEvent):void {
if(e.target == e.currentTarget){
trace("MouseUp direclty Stage" + e.target + e.currentTarget + e.eventPhase);
stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp_stage);
trace("-removed MouseUp Stage");
stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown_stage);
trace("+added MouseDown Stage");
btn1.addEventListener(MouseEvent.ROLL_OVER, onRollOver_btn1);
trace("+added RollOver btn1");
}else{
trace("MouseUp somewhere else but Stage" + e.target + e.currentTarget + e.eventPhase);
onRollOver_btn1(e);
}
}
cheers,
janis
Loading Multiple Text Files On ROLL_OVER
ok.. I have many button.. they all need to load different external text files when user does a ROLL_OVER. I have managed to get it to not error with fairly cludgy code (I know I can make this much nicer, as I am resuseing so much code.. I just dont know how). However when I run the as file.. it doesnt load the external text, but also doesnt error..
Note the dynamic text box "brand_txt_box1(and 2)" is inside a movie clip, but I put test_txt_box1 (and 2) on th main stage just to be sure it wasnt a child issue.
ActionScript Code:
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.text.TextField;
import flash.display.SimpleButton;
public class market_process extends MovieClip {
public function market_process() {
trace("this is working");
//brand_box1.brand_txt_box1.visible = false;
//brand_box2.brand_txt_box2.visible = false;
brand_btn.addEventListener(MouseEvent.ROLL_OVER, beginButtonOver);
brand_btn.addEventListener(MouseEvent.ROLL_OUT, beginButtonOut);
targetComp_btn.addEventListener(MouseEvent.ROLL_OVER, targetCompButtonOver);
targetComp_btn.addEventListener(MouseEvent.ROLL_OUT, targetCompButtonOut);
//Many More Buttons (total 14)
}
private function textLoadvaribles() {
// I included only 2 of each, though I have 14 of each.. 2 textboxes for each button
var brand_txt1_req:URLRequest = new URLRequest("textfiles/1.txt");
var brand_txt2_req:URLRequest = new URLRequest("textfiles/2.txt");
var brand_txt1_2_req:URLRequest = new URLRequest("textfiles/1_2.txt");
var brand_txt2_2_req:URLRequest = new URLRequest("textfiles/2_2.txt");
var brand_txt1_load:URLLoader = new URLLoader();
var brand_txt2_load:URLLoader = new URLLoader();
var brand_txt1_2_load:URLLoader = new URLLoader();
var brand_txt2_2_load:URLLoader = new URLLoader();
brand_txt1_load.load(brand_txt1_req);
brand_txt2_load.load(brand_txt2_req);
brand_txt1_2_load.load(brand_txt1_2_req);
brand_txt2_2_load.load(brand_txt2_2_req);
brand_txt1_load.addEventListener(Event.COMPLETE, brand_txtReady1);
brand_txt2_load.addEventListener(Event.COMPLETE, brand_txtReady2);
brand_txt1_2_load.addEventListener(Event.COMPLETE, brand_txtReady1_2);
brand_txt2_2_load.addEventListener(Event.COMPLETE, brand_txtReady2_2);
}
private function brand_txtReady1(event:Event):void {
brand_box1.brand_txt_box1.text = event.target.data;
test_txt_box1.text = event.target.data;
}
private function brand_txtReady2(event:Event):void {
test_txt_box2.text = event.target.data;
}
private function brand_txtReady1_2(event:Event):void {
brand_box2.brand_txt_box2.text = event.target.data;
test_txt_box2.text = event.target.data;
}
private function brand_txtReady2_2(event:Event):void {
test_txt_box2.text = event.target.data;
}
//End Text Loader
}
}
Event Handling And MOUSE.ROLL_OVER And MOUSE_OVER
Hello everyone,
For quite some time I have been trying to figure out ways how make the proper interactivity for my sprites.
The sample scenario is this basically:
------One container sprite lets call it (CONT) on the Stage holding two seperate sprites (BTN1) and (BTN2)
------CONT, BTN1, and BTN2 sprites have MOUSE_OVER, MOUSE_OUT, MOUSE_DOWN, and MOUSE_UP event listeners
Now, I also tried this with ROLL_OVER and ROLL_OUT events since they do not bubble but I cant get the outcome what i am looking for.
What i am trying to achieve is this:
///////// When mouse_over BTN1, then mouse_down on BTN1 and do mouse_up outside BTN1 and CONT meaning mouse_up on Stage then what should happen is this: mouse_out on BTN1, mouse_out on CONT and that's it.
Also, when mouse_down on Stage and mouse_over CONT and then BTN1 or BTN2 nothing should happen but it does with the code that i have been writing.
Your help or suggestions would be appreciated.
I have tried to check on mouse_up events whether e.target == e.currentTarget and if so then I know that mouse_down comes from the same sprite that mouse_up is triggered. But if i have two sprites like in the example above with BTN1 and BTN2, and i check for e.target and e.currentTarget then if mouse_down on BTN1 and mouse_up on BTN2 i still get the event triggered because e.target and e.currentTarget is of object Sprite.
Any ideas???
Thanks,
Janis
ROLL_OVER Button State "jumpy"?
I have created a circle where each sector (piece of pie) is a button which has a rollover state. All works fine as long as I move into a pice of the pie from the outside and leave via this path. As soon as I move from one piece to the next, everything becomes jumpy and in fact I can turn on several rollovers at the same time.
This happens regardless of me using a stop for the tweening.
See:
http://www.spallek.com/flash/freevis_menu.html
Here is the code for one piece of the pie (I also noticed that the hit area is not "solid" meaning its not over the whole sector despite the fact that the mc is exactly the shape of the sector--maybe related?):
Code:
var Ablauflink:URLRequest = new URLRequest("http://www.spallek.com");
Ablauf_hit_mc.alpha = 0;
Ablauf_sel_mc.alpha = 0;
Ablauf_txt_sel_mc.alpha = 0;
Ablauf_exp_mc.alpha = 0;
Ablauf_hit_mc.addEventListener(MouseEvent.CLICK, onAblClick);
Ablauf_hit_mc.addEventListener(MouseEvent.ROLL_OVER, AblOver);
Ablauf_hit_mc.addEventListener(MouseEvent.ROLL_OUT, AblOut);
function AblOver(event:MouseEvent):void
{
var myTweenAlphaOverAblaufBtn:Tween = new Tween(Ablauf_sel_mc, "alpha", Strong.easeOut, 0, 1, 2, true);
var myTweenAlphaOverAblaufTxt:Tween = new Tween(Ablauf_txt_sel_mc, "alpha", Strong.easeOut, 0, 1, 2, true);
var myTweenAlphaOverAblaufExp:Tween = new Tween(Ablauf_exp_mc, "alpha", Strong.easeOut, 0, 1, 2, true);
Waehlen_sel_mc.alpha = 0;
Waehlen_exp_mc.alpha = 0;
Waehlen_mc.alpha = 1;
Waehlen_txt_sel_mc.alpha = 0;
Ablauf_txt_mc.alpha = 0;
Technologie_sel_mc.alpha = 0;
Technologie_txt_sel_mc.alpha = 0;
Technologie_exp_mc.alpha = 0;
Vorteile_txt_sel_mc.alpha = 0;
Vorteile_sel_mc.alpha = 0;
Vorteile_exp_mc.alpha = 0
Indikationen_txt_sel_mc.alpha = 0;
Indikationen_sel_mc.alpha = 0;
Indikationen_exp_mc.alpha = 0;
Zentren_txt_sel_mc.alpha = 0;
Zentren_sel_mc.alpha = 0;
Zentren_exp_mc.alpha = 0
FAQ_txt_sel_mc.alpha = 0;
FAQ_sel_mc.alpha = 0;
FAQ_exp_mc.alpha = 0;
}
function AblOut(event:MouseEvent):void
{
if (myTweenAlphaOverAblaufTxt != null)
{
myTweenAlphaOverAblaufTxt.stop();
myTweenAlphaOverAblaufExp.stop();
}
var myTweenAlphaOverAblaufBtn:Tween = new Tween(Ablauf_sel_mc, "alpha", Strong.easeOut, 1, 0, 1, true);
var myTweenAlphaOverAblaufTxt:Tween = new Tween(Ablauf_txt_sel_mc, "alpha", Strong.easeOut, 1, 0, 1, true);
var myTweenAlphaOverAblaufExp:Tween = new Tween(Ablauf_exp_mc, "alpha", Strong.easeOut, 1, 0, 1, true);
Waehlen_sel_mc.alpha = 1;
Waehlen_exp_mc.alpha = 1;
Waehlen_txt_sel_mc.alpha = 1;
Waehlen_mc.alpha = 0;
Ablauf_txt_mc.alpha = 1;
}
function onAblClick(event:MouseEvent):void
{
navigateToURL(Ablauflink);
}
Ablauf_hit_mc.buttonMode = true;
ROLL_OVER Button State "jumpy"?
I have created a circle where each sector (piece of pie) is a button which has a rollover state. All works fine as long as I move into a pice of the pie from the outside and leave via this path. As soon as I move from one piece to the next, everything becomes jumpy and in fact I can turn on several rollovers at the same time.
This happens regardless of me using a stop for the tweening.
See:
http://www.spallek.com/flash/freevis_menu.html
Here is the code for one piece of the pie (I also noticed that the hit area is not "solid" meaning its not over the whole sector despite the fact that the mc is exactly the shape of the sector--maybe related?):
Attach Code
var Ablauflink:URLRequest = new URLRequest("http://www.spallek.com");
Ablauf_hit_mc.alpha = 0;
Ablauf_sel_mc.alpha = 0;
Ablauf_txt_sel_mc.alpha = 0;
Ablauf_exp_mc.alpha = 0;
Ablauf_hit_mc.addEventListener(MouseEvent.CLICK, onAblClick);
Ablauf_hit_mc.addEventListener(MouseEvent.ROLL_OVER, AblOver);
Ablauf_hit_mc.addEventListener(MouseEvent.ROLL_OUT, AblOut);
function AblOver(event:MouseEvent):void
{
var myTweenAlphaOverAblaufBtn:Tween = new Tween(Ablauf_sel_mc, "alpha", Strong.easeOut, 0, 1, 2, true);
var myTweenAlphaOverAblaufTxt:Tween = new Tween(Ablauf_txt_sel_mc, "alpha", Strong.easeOut, 0, 1, 2, true);
var myTweenAlphaOverAblaufExp:Tween = new Tween(Ablauf_exp_mc, "alpha", Strong.easeOut, 0, 1, 2, true);
Waehlen_sel_mc.alpha = 0;
Waehlen_exp_mc.alpha = 0;
Waehlen_mc.alpha = 1;
Waehlen_txt_sel_mc.alpha = 0;
Ablauf_txt_mc.alpha = 0;
Technologie_sel_mc.alpha = 0;
Technologie_txt_sel_mc.alpha = 0;
Technologie_exp_mc.alpha = 0;
Vorteile_txt_sel_mc.alpha = 0;
Vorteile_sel_mc.alpha = 0;
Vorteile_exp_mc.alpha = 0
Indikationen_txt_sel_mc.alpha = 0;
Indikationen_sel_mc.alpha = 0;
Indikationen_exp_mc.alpha = 0;
Zentren_txt_sel_mc.alpha = 0;
Zentren_sel_mc.alpha = 0;
Zentren_exp_mc.alpha = 0
FAQ_txt_sel_mc.alpha = 0;
FAQ_sel_mc.alpha = 0;
FAQ_exp_mc.alpha = 0;
}
function AblOut(event:MouseEvent):void
{
if (myTweenAlphaOverAblaufTxt != null)
{
myTweenAlphaOverAblaufTxt.stop();
myTweenAlphaOverAblaufExp.stop();
}
var myTweenAlphaOverAblaufBtn:Tween = new Tween(Ablauf_sel_mc, "alpha", Strong.easeOut, 1, 0, 1, true);
var myTweenAlphaOverAblaufTxt:Tween = new Tween(Ablauf_txt_sel_mc, "alpha", Strong.easeOut, 1, 0, 1, true);
var myTweenAlphaOverAblaufExp:Tween = new Tween(Ablauf_exp_mc, "alpha", Strong.easeOut, 1, 0, 1, true);
Waehlen_sel_mc.alpha = 1;
Waehlen_exp_mc.alpha = 1;
Waehlen_txt_sel_mc.alpha = 1;
Waehlen_mc.alpha = 0;
Ablauf_txt_mc.alpha = 1;
}
function onAblClick(event:MouseEvent):void
{
navigateToURL(Ablauflink);
}
Ablauf_hit_mc.buttonMode = true;
ROLL_OVER Plays A MC And ON_CLICK Plays A MC?
I would like to have a series of buttons that onrollover play a MC on
stage and onclick play another MC on stage. I am currently using the
following code provided in another thread to make the movie clip play
onrollover:
function showGraphic(event:MouseEvent):void {
mSymbol.visible = true;
}
function hideGraphic(event:MouseEvent):void {
mSymbol.visible = false;
}
btn.addEventListener(MouseEvent.ROLL_OVER, showGraphic);
btn.addEventListener(MouseEvent.ROLL_OUT, hideGraphic);
I am also using the following code to hide the movie clip on load:
mSymbol.visible = false;
How can I modify this code to allow a user to also click on the button
and play a MC?
Thanks!!!!!
LoadMovie SIMPLE Question For Simple Minded Graphic Artist
OK! So this will be EASY EASY for all of you.
I need to load a seperate SWF file onto the stage on a level above the main swf.
the seperate SWF file is in the same folder as the original all located in the "flash" folder of the root directory.
How do I get th e outside SWF to load on top of the movie.
The original movie is called grid.swf the outside movie is called liquid-print.swf
If anyone can help me with giving me the code I'd appreciate it. I really am quite dense when it comes to coding.
Can You Help Me Fix Simple Javascript Code On Button Inside My Very Simple Component?
Flash MX 2004 (mac)
******************
Hi,
I have a custom component that consists of nothing more than two dynamic text feilds and a button. I want the button to open a popup window in the browser, and it does so using javascript (an extension i found).
I put the following function in the first (and only) frame of my actual component (and its also in the first frame of my entire movie, just in case):
callPopup = function() {
getURL(popup);
};
And then on the button in my component i have this:
on(press){
callPopup();
}
and then finally,there is a variable named 'popup' within my component (which would change in each instance) which is given a value in my test instance as :
"javascript:jspw3('../vwd_scripts/','popups/acroyoga.swf',',,0,Past%20Event,index,Past%20Event ,20,0,,0,450,550,0,0.001,0.001,,,1,0,,.0.0.');"
somewhere i am doing something wrong.. ..i am not sure if its the button code, or my link (variable 'popup') syntax. Or if its impossible to use javascript in this way.
I know my html page is set up correctly (correct info in the head of the page etc), since i am able to call the javascript from a regular html link (just for testings sake) which is on the same page as my swf.
Hmm..i hope i made some sense here.
I will be very gratefull for some help...i'm totally lost on this one...
thanks in advance
Cheska
[F8] Very Simple Question, Very Simple Answer, I Hope. (Flash 8, Collisions)
Alright, so I've got my ball that moves up and down; it has gravity too. There are two things I want to do:
1. I want it to 'jump' when the UP key is pressed, rather than just accumulatively move upward.
2. I only want gravity to be applied while the ball is in the air(In other words, I basically just don't want it falling through the floor; however, want the edges to be the collision, not the center, and I also still want to be able to jump afterwards.
Thanks for any help, I don't need an explanation, I can figure it out by looking at the code. I'm going to attach a basic file with what I already have, please add the coding to it, then send the file back. Thanks for any help, and I apologise if this is hard to understand, or if I sound any bit rude to be asking how to do something; I don't mean to.
Can You Help Me Fix Simple Javascript Code On Button Inside My Very Simple Component?
Flash MX 2004 (mac)
Hi,
I have a custom component that consists of nothing more than two dynamic text feilds and a button. I want the button to open a popup window in the browser, and it does so using javascript (an extension i found).
I put the following function in the first (and only) frame of my actual component (and its also in the first frame of my entire movie, just in case):
callPopup = function() {
getURL(popup);
};
And then on the button in my component i have this:
on(press){
callPopup();
}
and then finally,there is a variable named 'popup' within my component (which would change in each instance) which is given a value in my test instance as :
"javascript:jspw3('../vwd_scripts/','popups/acroyoga.swf',',,0,Past%20Event,index,Past%20Event ,20,0,,0,450,550,0,0.001,0.001,,,1,0,,.0.0.');"
somewhere i am doing something wrong.. ..i am not sure if its the button code, or my link (variable 'popup') syntax. Or if its impossible to use javascript in this way.
I know my html page is set up correctly (correct info in the head of the page etc), since i am able to call the javascript from a regular html link (just for testings sake) which is on the same page as my swf.
Hmm..i hope i made some sense here.
I will be very gratefull for some help...i'm totally lost on this one...
thanks in advance
Cheska
Simple Problem. Simple Answer? Arranging Windows W/flash
SIMPLE problem. | SIMPLE answer?
We're trying to have a Full screen CD presentation in flash that plays .avi's in windows media player, & opens up url's in a web-browser. The problem is the URLs AND the .AVIs show up underneath the flash, is there a way to have them open on top of the presentation?
Thank you.
Random Tweens - Simple Question, Simple Answer?
Hello, I have one swf with a few different motion tweens inside their own movie clips. I want to write some code to play only one of the tweens at random. I know how to use setInterval to get the process to repeat with a delay. But I just want a different/random tween to play with each repeat. I hope that makes sense.
I imagine this must be easy, but I'm having a tough time getting it to work. Random tweens, somebody please help.
HELP SIMPLE, SIMPLE XML-FLASH Load Into Movie Clip
This is so stupid, my first dive into XML, with a company project - a tutorial/training piece which will require mjultiple screens with questions, etc.
Anwyay- I can get the XML loaded into the root, and it works pefectly, but I'd like to put things INTO a movie clip, so that each new screen or slide is just he movie clip advancing.
How the HELL do I target the movie clip? I even tried setting a NEW variable in teh main timeline once the XML was loaded, but the best I get is not the value from the XML, but the path (e.g. "level0title1")
Any help? I imagine it's a really stupid, easy question, but I can't find anythign ANYWHERE to answer it.
Simple Problem Neeeds Simple Answer
hey i figured one of u geniuses here could help me figure this out much faster than me fiddling around so here goes.
All I'm trying to do is have a button (which is loaded in an MC in _level6) allow the user to switch between languages on the website. To do this I figured all I would do is have it 2 scenes...one in English and the other in Chinese. When the user clicked the toggle button I would have it go to the current frame in _level0 but switch to Chinese scene.
Get it? basically i want it to switch between frames but remain on the same frame number. Here is the last piece of code I tried using, but nothing seems to work (this code is connected to the release of the toggle button)
Code:
_level0.gotoandplay("Chinese", _level0._currentframe)
Anybody got any idea what i need to do??
Thanks for your help!
Brad
Simple Question, Probable Simple Answer
still in my quest for new flash knowledge and being a "noobie" in the world of flash i would like help.
whats the easiest way to create a Button that upon rollover creates a text discription in a text box. just so i can give a description of what the button is going to lead to....
ohh and i will have multiple bittons on 1 frame and 1 designated box for all descriptions
thanx in advance
Simple Button, Needs Simple Action Script
Hi there,
I have made button in flahs mx. The over state of this button contains a short movie clip. My prblem is that I would like the button to remain on the down state on release (ie. once the user has released the mous button)instead of just going back to the over state as it does at present. Ideally I would like the button to go back to the up state on a second click.
I have pulled most of my hair out trying to put together the right bits of action script that would help me do this but to no avail, and having no time to learn action script properly I don't think I'll get there anytime soon on my own. Can anyone help me, pretty, pretty please ~?
Simple Question - Simple Answer FLASH MX
hi you good people out there. hope you could help me too. using flash mx, not beyond beginner yet.
about finishing my homepage with it. one problem is there:
i have a premade flash and changed graphics, etc. all no problem, the menu is included as well - i have changed the text of the 9 menus already, works fine - only when i use the preview - the original text appears when going over with the mouse... i changed the text visible to me - but cannot locate and change the text for the mouse over.
for instance the first two of the menu named
start
gallery
i changed it to
home
pictures
in the prview it show again
start
gallery
upon mouseover.
so i need to locate where to change also that hidden text (only active upon mouseover) to the same word.
if anyone of you could help me - i would be going into learning faster and finally getting my homepage up and running. if needed please e-mail me at
harton@harton.at
thank you so much!
....................I have uploaded a screenshot of it - clearly you can see, I changed the text yet have to located the original text below of it (?) and write the same text so that it shows up correctly upon mouseover.....
Simple, Simple... Input Field Question
OK, I have two input text fields, one is var x1 and another is var x2
onRelease I`m trying to use this code
score = Math.sqrt (x1+1) - Math.sqrt (x2)
It`s not working, check out attached fla file
Thanks folks
Simple Question *(I Hope) From A Simple Newbie...
Hi All... well, since this is my first post, I'll be cordial by saying hey and how are ya and all that later (sorry) but I'm in a bit of a pickle, or at least a cucumber that's been sweatting his luck for a while. I'm trying to create a news ticker that autoscrolls events accross the bottom of a movie, and allows users to click the text to take them to the appropriate page / site / picture or what ever (just need the link. I'm running into issues with the xml connector loading data dynamicly, I can get the file loaded, but I can't move it accross the screen. Basicaly, I'm looking for a basic news ticker tut or else the appropriate google keywords. Anyone? Anyone? Bueler? Please?
Thanks in advance.
Rick
Simple Questions...mean Simple Answers....right?
I just have a question about the various ways to loop in Flash.
now I know the for, and the while, and the do while,etc. My question is I can never get any of these loops to work unless they are on the main timeline. If I put a for loop inside a movie clip, i get nothing, or errors of the script continually running.
Just wondered if and how to use a loop script inside a movieclip without generating errors, and not having to revert to making the movieclip continually play two frames to get what I want.
curious.........
dduck1934
Simple Question.....any Simple Answers?
Hi...
A simple question...
From a button in a standalone Projector ( Flash) file how do I open an external HTML file....called ...xxx.html??
Can anyone ease my pain??..
THX
Simple Problem Simple Solution?
Can someone who is smarter than me (plenty of you out there ) solve my problem. I have a button on the timeline that has a gotoAndPlay action. I have another action that advances the timeline to the nextframe to execute some actionscript then it returns to the previous frame where the button is. The button works the first time but after going to the nextframe and then coming back it loses its functionality. What can I do to restore functionality in my button. Oh i'm using MX but publishing in 5. Can someone please save the day?
million thanks
Simple Problem, Simple Movie
i have a simple movie (using MX) with one scene and a handful of movie clips on individual layers. i am using this to jump from clip to clip in main timeline
_root.MCmyclip.gotoAndPlay (1);
the movie plays fine the first time through. but when i need to return to the first MC again it plays but then stops and does not move on to the next clip? like this:
in the final MC i have:
_root.MCfirstclip.gotoAndPlay (1);
it goes to first clip and plays but does not moveon when encountering this action for the second time:
_root.MCsecondclip.gotoAndPlay (1);
i don't understand why this is happening. it should just loop continuously...right?
Simple Question - Simple Answer?
I'm looking to do something basic to start off with Flash - and I'm hoping this is the project. Basically, I'm looking to have a movie with an image (or images) that will fade in and out over a set period of time - as seen in this website.
http://www.westonfl.org (The pictures on the left - yes I know, this was done by 2advanced....)
Any help you can give, would be great. The more detailed the better.
Talk to me like I'm 5.
Need A Simple Script For A Simple Button
Hi,
I've got this simple button, that when I roll over it has a clip that fades in to orange, but it won't fade out when I roll off the button. How do I get the "orange" to fade out when I roll off the button?
I've attached the file.
Thanks for your help.
Blastbum
Simple Question With Hopefully A Simple Answer.
Ive only just started making games in flash and im wondering how i can make it so my little birds eye view character can be stopped from running into buildings... in other words i want to make my buildings so you CANT walk on em or under em!..
haha im hella nOOb i probably sound like a loser.. but if you could waste your time on me it would be greatly apreciated!
CHEERZ 1337 Hax0rz.
Simple Problem In Need Of A Simple Solution
I know this is long...grab the FLA and test it, and it will all make perfect sense. Thanks in advance for the help.
I have a vertical menu that has one arrow (A1) that eases to the selected section after you click on it, and another arrow (A2) that eases to each button when you rollover it. So you rollover a button, A2 eases to it, click it, and the A1 eases to that. I have A1 and A2 set to ease to the y value of the button onPress. Here's where I run into the problem...The menu items slide up and down to reveal the content, so when I click on a button that has moved down to the bottom, the button itself eases up back into it's orignial position, as each arrow does the same thing. The way the functions are written to control all the motion only controls movie clips by buttons...so the top item in my menu is a button and works fine, since it never moves down. But I had to creat invisible buttons to control the motion of the other "buttons" in the menu. So pretty much to keep the right actions with each button, after pressing it, the invisible button moves to the new position of the menu item. This is what causes the problem. A2 is set to ease back to the y value of A1 on rollout, pretty much moving it back to the current menu item. So after pressing the buttons, A2 wants to ease right to the y value of A1, not to the y value it was told, which means the arrows don't line up like they're supposed to. This can be fixed by using onPress and holding it down. The clips ease right into position, but obviously this can't be used realistically. In theory all that would need to be done is to have the invisible buttons wait until the arrow was in position to move up there, that way the clip wouldn't react to the OnRollout before the OnPress.
I know this was long and confusing...I appreciate all your help very much, this has been stumping me for a while now!
Simple Or Not So Simple GetURL() Problem
ok basically i am trying to link a button so that when pressed it will bring up a javascript window, i have tested it and it the button works fine when used with regular sites
i.e.
on (release) {
getURL ("http://www.watever.com");
}
but when i try to implement Javascript into the code it just does nothing here is what i am using :-
on (release) {
getURL ("Javascriptopupwindow(1)");
}
<head>
<script language="javascript">
function popupwindow(index)
{
if(index==1)
{
site="http://www.whatever.com"
}
window.open(site,"newwindow","toolbar=0,location=0 ,directories=0,status=0,menubar=1,scrollbars=0,res izeable=1,width=100,height=200")
}
</script>
</head>
any help would be greatly appreciated cause i'm stuck
Rich
SIMPLE Simple Actionscript Question
Hey guys this is an easy one, but I don't know it.
I want to create a dynamic text box that says page 1 (or just 1). And every time I click the next button (which also controls something else), it should add 1. The limit is 4 pages so, if it exceeds 4, it should back to 1.
Thanks for the help
Simple Loadvariables Task Not So Simple... Why?
So I've got a site that I've built (see it here: http://www.artinmusic.com) and it uses a function I've written called 'changer()' to swap out different events using a folder with textfiles inside. So I plug in the name of the folder and the function pulls the info from "folderName/title.txt" , "foldername/description.txt" etc. Nevermind that I probably should have done this (much easier and less painless) with XML, that'll have to wait for the next round.
So- I want to have a variable that selects which event to display first, and I've stored that variable in a text file called featured.txt. It reads: featured=20050916
I figured I could just go :
loadVariables("events/featured.txt",this);
changer(featured);
but not so. I got a string of errors, as changer tried to load 'undefined'. ( Error opening URL "C:/etc/etc/undefined/description.txt")
Here's the code:
function changer(changerVar) {
/* DESCRIPTION BOX */
descriptionVar = "events/"+changerVar+"/description.txt"
getDescription = new LoadVars();
getDescription.load(descriptionVar)
getDescription.onLoad = function (success) {
if (success) {
/*trace("description Loaded")*/
descriptionBox.htmlText = this.description;
descriptionBox.scroll = 0;
} else {
trace("not loaded")
}
}
/* NOW TITLE BOX */
titleVar = "events/"+changerVar+"/title.txt"
getTitle = new LoadVars();
getTitle.load(titleVar)
getTitle.onLoad = function (success) {
if (success) {
/*trace("title Loaded")*/
titleBox.htmlText = this.title;
/*titleBox.scroll = 0;*/
} else {
trace("title not loaded")
}
}
/*now Date box */
dateVar = "events/"+changerVar+"/date.txt"
getDate = new LoadVars();
getDate.load(dateVar)
getDate.onLoad = function (success) {
if (success) {
//trace("date Loaded")
dateBox.htmlText = this.date;
/*titleBox.scroll = 0;*/
} else {
trace("date not loaded")
}
}
arImageVar = "events/"+changerVar+"/arImage.txt"
getarImage = new LoadVars();
getarImage.load(arImageVar)
getarImage.onLoad = function (success) {
if (success) {
arImagebase.loadMovie(this.arImage);
} else {
//trace("not loaded")
}
}
image = "events/" + changerVar + "/" + changerVar + ".jpg"
loadMovie(image, imagebase);
}
loadVariables("events/featured.txt",this);
changer(featured);
A friend of mine said he got it to work by using the code I'm using to load these variables into text files and putting the featured variable into a dynamic text file in the _root level and then calling the function like this:
featVar = "events/featured.txt"
getFeat = new LoadVars();
getFeat.load(featVar)
getFeat.onLoad = function (success) {
if (success) {
trace("featured Loaded");
_root.featured = this.featured;
trace(_root.featured);
/*titleBox.scroll = 0;*/
} else {
trace("featured not loaded")
}
}
changer(_root.featured);
And it does load the variable in the dynamic text box, but it comes back with the same error, except instead of undefined it comes back with "cannot load URL C:/etc/etc/events/_level10.featured/description.txt"
Anybody have any idea? PLEASE somebody help me out...
|