Obi-Won Is The Man. But, He Refuses To Help
I have an overhedd view of a robot that you can steer around using the arrows, i want to add tracks to follow where ever he goes, and kinda fade out after a couple secs..
http://www.monkeyclean.com/flash/thatsmyrobot3.html
ok see how the trail follows behind, then fades out. thats what i want, but i want it scripted. and i want it to follow the robot around, and when the robot stops, the trail follows up to him then fades out.. like the trail is constantly fading. when i say the trail is constantly fading i mean that, i have each one of those rectangles (actually 2, one for each wheel), fade to 0% alpha after a second of 2. it would be nice if i could get each individual trail rectangle behind each wheel to stay in that spot in the ground..while its fadin..does that help?
SO 2 QUESTIONS.. 1.) how do i make a 'countdown-to-fade' so after, say 2 secs, the trail rectangle fades to 0%? 2.)How do I make a MC follow another MC?
FlashKit > Flash Help > Flash ActionScript
Posted on: 08-19-2001, 01:22 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
SetInterval Refuses To Die... Sometimes.
Hi all,
I've got some code that seems to work.. but then it won't. Are there any hidden pitfalls to using setInterval()? I'm so close I can taste it, but it doesn't seem stable. clearInterval doesn't always seem to work!
PHP Code:
QuickCheck.prototype.startTimer = function() {
trace("startTimer called!!");
count = 0;
timer = setInterval(this.countdown, 2000);
};
QuickCheck.prototype.stopTimer = function() {
trace("stopTimer called!!");
clearInterval(timer);
};
QuickCheck.prototype.countdown = function() {
if (count < 3) {
trace("countdown called!!");
count++;
_level0.setClock(count);
trace(count);
} else {
count = 0;
trace("sequence ended");
clearInterval(timer);
trace(count);
this.stopTimer();
}
};
SWF Refuses To Unload
I've tried a couple different ways to try and get my swf to unload and it just will not do it.
I've got a swf that loads another swf into it fine.
I then have an image on that loaded in swf that is a movie clip; that just shows a bigger sized image of the previous thumbnail that was on the main swf.
I made the movieclip into button mode and wanted it to just upon click remove the child so it goes back to the thumbnails view of the main swf.
I've tried simply adding it as a child then just using the removeChild() and that wouldn't work.
I also tried making the actual image in the loaded swf into a button to see if it was just me using it as a movie clip and that wouldn't work.
I then tried to just put a seperate button on the loaded in swf to control the function of removing the child and that won't work either.
Now i've tried making a container and adding the swf into the container so i can use the container.removeChild(); and that doesn't work either.
Any ideas?
Here is my main swf that loads the external swf. (which loads it fine)
I'm using this in conjunction with papervision3d 2.0 if anyone is wondering what face refers to. It's apart of my geometry for one of my primitives.
Code:
//Set Variables
var face1Request:URLRequest = new URLRequest("big.swf");
var face1Loader:Loader = new Loader();
var container:Sprite = new Sprite();
//Upon clicking on the face(s) let them respond accordingly
face.addEventListener(MouseEvent.CLICK, face1);
function face1(event:MouseEvent):void {
addChild(container);
face1Loader.load(face1Request);
container.addChild(face1Loader);
face1Loader.x = 0;
face1Loader.y = 0;
}
Here is external swf code. I changed it back to the movieclip being able to unload the child. And yet it won't trace the click out and doesn't seem to become active as in button mode with removeChild added in the function.
But once i remove that code in the fuction, it becomes active and lets me click the movie clip in button mode and will trace out click ... ?? What the hell am i doing wrong; i feel it's something simple and it's driving me nutts!
Code:
big_mc.buttonMode = true;
big_mc.addEventListener(MouseEvent.CLICK, getOut);
function getOut(event:MouseEvent):void
{
trace ("Click!")
container.removeChild(face1Loader);
}
Refuses To Submit A Colon?
I have a simple form... it's a one line text box and a submit button. It normally works fine, except when a user types the ":" character. When this happens, it's like Flash ignores the submit button. Anyone know why, or have a workaround?
Thanks!!
Refuses To Transfer To Next Scene
I am making a game (for english class) and anyways its just a simple trivia question type game where you click on something and it goes to the next scene etc etc you get the idea.
It was going along fairly well untill on one scene it refuses to let buttons work, but it will just go over on its own (except I want the user to hit accept).
The file is NOT attached because this website happens to have an extremly small file attachment restriction and I can't get th file down...plz try to help from my description...
P.S. There may be a working file at www.itsmysite.com/capwork
It would be the first one you see.
Sound Refuses To Sync
Hello everyone!
I'll jump right to the point.
I'm making a fairly simple cartoon for a client's upcoming website. I'm still a bit new to Flash MX. Right now I've completed all my scenes with characters, speach bubbles and the such. However, as soon as I reach my fourth scene, the sounds goes out of sync. I am not using one long wav file either. I have quite a few that I insert at designated frames. I set them all to Stream. I've tried setting them to Start, Event and even Stop. But nothing.
I've done a smaller cartoon before where I have a sound begin at any point I want. And it manages to play just fine. However, this is no longer the case. The SWF file just insists that it plays the sounds even two to three scenes AHEAD of where I set it to play.
I've become very lost, confused and a little frusterated since my deadline is approaching and I did not expect to encounter this problem. If anyone knows, please, let me know.
Thank you kindly,
Rob
Edit: Two other things. I am working off a PC, not a Mac, if that actually matters. The other, I just tried exporting as an AVI. That does work, but it also makes the file 250+mb. Unpractical. I need it as an SWF.
[CS3] Flash CS3 Refuses To Export SWF :(
I have a fairly odd bug where Flash refuses to export a file as SWF.
I have the FLA, and I've made some changes to it, but as soon as I try either Control > Test Movie or File > Export > Movie > SWF, it pretends to work, the progress bar goes as usual. But the end file never appears.
Thanks in advance to any and all help.
My Flight Refuses To Explode..
Hi all,
im trying to make a small game in which the flight wants to explode if the missile ( bullet) hits. But it doesn't happen so?. I spent a couple of days to achieve the same. But i cant. any one pls help me to finish this simple game.
And also it has some other errors such as
after the time elaps the game over page was displayed, but the seconds continues. etc.
Actually this is my very first trial for building games.
Lastly,
What are things needed to build a very attractive games?.
Any suggestions ideas, tutorials are welcome.
pls have a look at my .fla.
My adv thx to everyone.
Jsam...
Flash Refuses To Load
keep trying to load flash. Get a download successful message but it refuses to work. Any suggestions appreciated.
Flash 8 Refuses To Load
I am on a PC using XP. I downloaded a trial version of Flash 8. It worked the first couple of times but now refuses to load at all. Occasionally it gets as far as the little start page, says copying files then initializing fonts then it disappears and that's it. I read somewhere that you need to disable the start page because it is searching the internet for something???? But how on earth can you disable your start page if you can't get in to the program in the first place
I have tried this on two different PCs and it still won't launch. Why do Macromedia always manage to mess things up in the end?
MC Refuses To Fade In With Tween
this happened twice in 2 different instances this weekend. i've got a really straight forward loading indicator with this code on it:
Code:
onClipEvent(enterFrame){
this._xscale = (_root.getBytesLoaded()/_root.getBytesTotal())*100
}
the loading works fine.
I'd like it to fade in & out on the timeline though it refuses. It just gets stuck at 10% alpha.
is this a bug or am i missing somethinig really simple?
check my FLA: www.triggermotion.com/misc/loader.zip
$@#%@ Movieclip Refuses To Be Visible
check out:
my flash listing thing
the blue square is a flash vector shape on the same layer (not being masked or anything) as a green rectangle converted to a movieclip symbol. the moviclip symbol has one frame with the contents being the green square.
i'm trying to load images into it but the @#%# thing won't show up when i publish!
the @#$of it is that it does show up as a shape until I convert it to a movieclip symbol...
I can email my .fla to anyone who wants to take a gander.
this has got me stumped! anyone experienced anything like this???
Textbox Refuses To Become Transparent In Animation.
Hello to the Flashkit community, it's my first time visiting this forum. I'm hoping for somebody in this community to help me with my issue.
For my Flash assignment, I am to create a Flash website about something. In my case, I'm creating a Flash website based on my own RPG (Computer game).
Here is the link to the source:
http://cp1.myhostdns.org/~hellfusi/u.../blaaaaah5.fla
Once you've downloaded this file, view the Index Page scene. As you can see, I've set it up so that each button goes to a certain frame as labelled within the timeline.
For example, in frame 10 it goes to Features. So if you click features, the graphic of the character fades out as well as the textbox. The problem lies within the textbox. It fades out but if you actually play the movie, it refuses to fade out. (And apparantely scrollbars as well).
What's the problem here? Can text fields or scrollbars fade out at all?
Your help is very much appreciated. Thanks.
Button To Open URL Refuses To Work
Hello everyone...
I'm trying to get my 'home' button to open weblog/index.php when it's clicked into IFRAME (a iframe i made, called it IFRAME) but when I click the button it doesn't work. It doesn't change the IFRAME at all.. any ideas? I'll upload and post the link of the website if you need that..
look at the attachment...
-lieb39
Email Form Just Refuses To Work
Dear all,
Now, after 2 days of searching through every possible solution on all forums, changing all the coding as advised by someone etc., contacting my ISP's etc. the form is just NOT working. Whatever I do, the info doesn't get sent to me. The temp status area works (saying that it's" sending, 1, 2 sometimes slow but".... etc.) and depending on the server that's also where it stops. One site gives me a send confirmation but that's all. No email is sent.
First of all, the .php file looks like this:
<?php
// A revised version of the old snowMailPHP.php from Flash-db.
// edit (12-3-2003) - changed $HTTP_POST_VARS to $_POST
$Email = $_POST["Email"];
$FirstName = $_POST["FirstName"];
$ToEmail = $_POST["ToEmail"];
$ToName = $_POST["ToName"];
$Company = $_POST["Company"];
$ToComments = $_POST["ToComments"];
$HearAbout = $_POST["HearAbout"];
// The subject of your email.
$ToSubject = "Example Mail from SendMail Tutorial";
// This is a sample message. The
's are line breaks. You can alter this message anyway you want. It will be the main body of your email.
$Message = "Sent By: $FirstName
Senders Email: $Email
Senders Company: $Company
Message Sent:
$ToComments
Sender Heard About Site From:
$HearAbout
";
// This line actually sends the mail. For more information on this please visit:
// www.php.net/manual/en/function.mail.php
mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FirstName." <".$Email.">");
// Make sure to surround Name/Value pairs sent back to flash with &'s. This is how flash seperates different, Name/Value pairs from text/scripts into Flash
variables.
Print "&_root.Mail.EmailStatus=Complete - Your mail has been sent&";
?>
The SEND button has the following coding:
on (release) {
if (!Email.length || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
EmailStatus = "Please enter a valid E-mail address";
}
else if (!FirstName.length) {
EmailStatus = "Please Enter your name before Sending";
}
else if (!ToComments.length) {
EmailStatus = "Please enter some text in you message";
}
else {
loadVariablesNum ("snowMailPHP.php", "0", "Post");
EmailStatus = "Sending... one Moment .. or two.. sometimes it's faster then other times";
}
}
and it doesn't work.... :-( It's all in the same directory, I haven't renamed the .php file etc. Nothing out of the ordinary.
Please check three different test sites (all on different servers): www.pure-lounge.com/test/SendMail.html (confirmation works but email is not sent) and www.villadasarata.com/test/SendMail.html (confirmation doesn't work and email is NOT sent either) and www.yogaray.com/test/SendMail.html (same problem as latter one, nothing happens).
Does anyone know what this could be??
Thanks for helping me out. I'm about to faint ;-)
Movieclip Text Refuses To Change
I am trying to change the text in a MovieClip in my .fla file. Despite changing, saving & republishing, the text keeps reverting back to its previous value. I've been all over the actionscript code and Movie Browser but so far no clue what's happening here. Can anyone help please?
Thanks!
- Michael
Flash MX 2004 Pro Refuses To Publish
Hey all.
I can work in flash but when it comes to testing or publishing the movie the status bar gets to about 1/4 way accross and the *pop* disapears. This is holding back the development somewhat
I have removed all my scripting just incase that is the problem. I have installed the latest update. I have unistalled Flash, restarted windows, reinstalled and still no luck. I have uninstalled the flash player, restarted, reinstalled and still no luck.
Has anyone had a similar problem? How did you fix it?
Thanks,
johnalpi
Flash 8 Refuses Itself After Director 10 Installation
hi all together :)
i'm despairing: Flash 8 ran for months without problems, then i imagined myself to try out Director 10. Since that Flash does not works any longer - it starts but freezes after the splashscreen, some tool-windows are opening, that's it, afterwards nothing can be made except a forcibly terminating ;(
after deinstalling Director and x-times reinstalling Flash i'm already going mad…
HELP!!!
--
Flash 8 refuses itself after Director 10 installation
Flash Player Refuses To Install
I have a G5 PowerPC Mac and am trying to install Flash Player 9. I have turned off my browser to avoid that problem. However, when I ask it to install, it finishes installing the first 8 items but never finishes the last 4. I would appreciate any help or advice.
AS3 Collision Detection Refuses To Work :S
Hi,
I'm working on a project and it involves randomly animating some dots within boxes. So I have a box movieclip which contains dots (balls) and they animated within the boundaries of the box. I first created a test animation mimicking one of the boxes and it worked fine but one I port this code to my movie I start getting problems. Heres my code.
What am I doing wrong? I'm especially confused as it works in the test script!!! Sorry for the long code, I've included the both classes...
Attach Code
/**
* Box.as
*
* @package abstract
* @author Ebi Atawodi
* @copyright © 2007 inDEN and Ebi Atawodi.
**/
package view.abstract
{
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.utils.*;
import locations.*;
import flash.events.*;
import view.StatsPanel;
public class Box extends MovieClip
{
//track number of boxes
static private var box_count:Number = 0;
static private var curr_box;
private var _id:Number;
private var _my_location:Location;
private var _dots:Array;
private var statsPanel:StatsPanel;
private var date:Date;
private var _bounce:Number = -0.5;
private var _spring:Number = 0.05;
private var _gravity:Number = 0.5;
public function Box(_x:int,_y:int)
{
date = new Date();
_id = Box.box_count;
Box.box_count += 1;
x = _x;
y = _y;
//trace("Created location " + box_count + " at x:" +x+ " y:"+y);
init();
}
public function init():void
{
_dots = new Array();
this.buttonMode = true;
graphics.lineStyle(1,0x333333);
graphics.beginFill(0x222222);
graphics.drawRect(1, 1, Config.BOX_WIDTH, Config.BOX_HEIGHT);
graphics.endFill();
//create hit area
var square:Sprite = new Sprite();
square.graphics.beginFill(0x222222);
square.graphics.drawRect(1, 1, Config.BOX_WIDTH, Config.BOX_HEIGHT);
square.alpha = 0;
hitArea = square;
square.mouseEnabled = false;
addChild(square);
this.addEventListener(MouseEvent.ROLL_OVER, onMouseRollOver);
this.addEventListener(MouseEvent.ROLL_OUT, onMouseRollOut);
this.addEventListener(MouseEvent.CLICK, onMouseClickEvent);
addEventListener(Event.ENTER_FRAME, onEnterFrame);
trace("I am box "+ID()+" at x:"+x+" and y:"+y+" my width "+width+" and height:"+height);
}
public function ID():Number
{
return _id;
}
private function onEnterFrame(event:Event):void
{
testCollision();
}
public function onMouseRollOver(event:Event):void
{
if (curr_box != this._id)
{
activate();
}
}
public function onMouseRollOut(event:Event):void
{
if (curr_box != this._id)
{
deactivate();
}
}
public function onMouseClickEvent(event:Event):void
{
for each(var box:Box in Abstract._boxes)
{
box.deactivate();
}
Box.curr_box = this._id;
active();
}
private function activate():void
{
graphics.clear();
graphics.lineStyle(2,0x333333);
graphics.drawRect(1, 1, Config.BOX_WIDTH, Config.BOX_HEIGHT);
}
private function deactivate():void
{
graphics.clear();
graphics.lineStyle(1,0x333333);
graphics.drawRect(1, 1, Config.BOX_WIDTH, Config.BOX_HEIGHT);
}
private function active():void
{
graphics.lineStyle(2,0xCCCCCC);
graphics.drawRect(1, 1, Config.BOX_WIDTH, Config.BOX_HEIGHT);
statsPanel = StatsPanel.getInstance();
var statsString:String = _my_location.getName() + "
" + _my_location.time() + "
Temperature "+_my_location.temperature()+"
Light "+_my_location.light()+"
People "+_my_location.people()+"
Humidity "+_my_location.humidity()+"
Pressure "+_my_location.pressure()+"";
statsPanel.setStats(statsString);
}
public function getLocation():Location
{
return _my_location;
}
public function setLocation(location:Location):void
{
_my_location = location;
_my_location.setRelated(this);
}
public function load():void
{
var _x:int = 0;
var _y:int = 0;
var vacant:Boolean = false;
var occupancy:Number = _my_location.people();
if(_my_location.people() == 0)
{
vacant = true;
occupancy = 5;
}
while (occupancy > _dots.length)
{
if (_x > 3)
{
_x = 0;
_y += 1;
}
var temp_dot:Dot = new Dot(this,vacant);
_dots.push(temp_dot);
addChildAt(temp_dot,1);
_x += 1;
}
while (occupancy < _dots.length)
{
trace("Kill some dots");
}
}
public function testCollision():void
{
for(var i:uint = 0; i < _dots.length - 1; i++)
{
var dot0:Dot = _dots[i];
for(var j:uint = i + 1; j < _dots.length; j++)
{
var dot1:Dot = _dots[j];
var dx:Number = dot1.x - dot0.x;
var dy:Number = dot1.y - dot0.y;
var dist:Number = Math.sqrt(dx * dx + dy * dy);
var minDist:Number = dot0.radius + dot1.radius;
if(dist < minDist)
{
var angle:Number = Math.atan2(dy, dx);
var tx:Number = dot0.x + Math.cos(angle) * minDist;
var ty:Number = dot0.y +
Math.sin(angle) * minDist;
var ax:Number = (tx - dot1.x) * _spring;
var ay:Number = (ty - dot1.y) * _spring;
dot0._vx -= ax;
dot0._vy -= ay;
dot1._vx += ax;
dot1._vy += ay;
}
}
}
for(i = 0; i < _dots.length; i++)
{
_dots[i].move();
}
}
/*private function move(dot:Dot):void
{
dot._vy += gravity;
dot.x += dot._vx;
dot.y += dot._vy;
if(dot.x + dot.radius > (x + Config.BOX_WIDTH))
{
dot.x = (x + Config.BOX_WIDTH) - dot.radius;
dot._vx *= _bounce;
}
else if(dot.x - dot.radius < x)
{
dot.x = dot.radius;
dot._vx *= _bounce;
}
if(dot.y + dot.radius > (y + Config.BOX_HEIGHT))
{
dot.y = stage.stageHeight - dot.radius;
dot._vy *= _bounce;
}
else if(dot.y - dot.radius < y)
{
dot.y = dot.radius;
dot._vy *= _bounce;
}
}*/
/**
* Returns colour index relative to temperature
*
* @param void
* @return Number
**/
public function colourIndex():Number
{
return Math.random();
}
public function scaleIndex():Number
{
return 1 + (_my_location.humidity()/50);
}
public function bounce():Number
{
return _bounce;
}
public function spring():Number
{
return _spring;
}
public function gravity():Number
{
return _gravity;
}
}
}
/**
* Dot.as
*
* @package abstract
* @author Ebi Atawodi
* @copyright © 2007 inDEN and Ebi Atawodi.
**/
package view.abstract
{
import flash.display.MovieClip;
import flash.events.*;
public class Dot extends MovieClip
{
private var _size:Number;
private var _disperse:Number;
private var _parentBox; //reference to parent Box
private var _vacancy:Boolean;
private var angle:Number = 0;
private var centerScale:Number = 1;
private var range:Number = .5;
private var _speed:Number = .1;
public var _vx:uint = 0;
public var _vy:uint = 0;
public var _radius:uint;
private var colour:uint;
private var _spring:Boolean = false;
public function Dot (box:Box,vacancy:Boolean)
{
this.alpha = 0;
_radius = 2;
_parentBox = box;
x = Config.BOX_WIDTH / 2 + Math.random() * 100 - 50;
y = Config.BOX_HEIGHT / 2 + Math.random() * 100 - 50;
_vx = Math.random() * 6 - 3;
_vy = Math.random() * 6 - 3;
_vacancy = vacancy;
init();
}
public function setParent(aBox:Box)
{
_parentBox = aBox;
}
public function init():void
{
colour = 0xffffff * _parentBox.colourIndex();
if (_vacancy)
{
//graphics.lineStyle(1,0xcccccc);
}
graphics.beginFill(colour);
graphics.drawCircle(x, y, _radius);
graphics.endFill();
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(event:Event):void
{
this.wake();
//this.animate();
//this.scale();
}
public function scale():void
{
if (scaleX < _parentBox.scaleIndex())
{
scaleX += speed();
scaleY += speed();
}
if (scaleY > _parentBox.scaleIndex())
{
scaleX -= speed();
scaleY -= speed();
}
}
public function wake():void
{
if(alpha < 100)
{
alpha += speed();
}
}
public function kill():void
{
if(alpha > 0)
{
alpha -= speed();
}
}
public function speed():Number
{
return _speed;
}
public function radius():Number
{
return _radius * scaleX;
}
/**
* Moves object relative to velocity vx and vy
*
* @param void
* @return void
**/
public function move():void
{
trace("Dot x:"+x+" y:"+y);
_vy += _parentBox.gravity();
x += _vx;
y += _vy;
trace("Dot x:"+x+" y:"+y);
if(x + _radius > Config.BOX_WIDTH)
{
//trace("I have gone past the max width - at "+(x + _radius));
x = Config.BOX_WIDTH - _radius;
_vx *= _parentBox.bounce();
}
else if(x - _radius < 0)
{
//trace("I have gone past the min width - at "+(x - _radius));
x = _radius;
_vx *= _parentBox.bounce();
}
if(y + _radius > Config.BOX_HEIGHT)
{
//trace("I have gone past the max height - at "+(y + _radius));
y = Config.BOX_HEIGHT - _radius;
_vy *= _parentBox.bounce();
}
else if(y - _radius < 0)
{
//trace("I have gone past the min height - at "+(y - _radius));
y = _radius;
_vy *= _parentBox.bounce();
}
}
}
}
Edited: 08/24/2007 at 02:10:44 PM by qleyo
Sound Loads But Refuses To Play
simple:
var my_sound:Sound = new Sound();
my_sound.loadSound("music/" + mix, true);
of course, it's alot more complicated, but this won't even work. It loads the file, I know because I can see the duration, but refuses to play it. I've tried start(), (this), and onLoad() to get it started up, but none work. Th silly thing is that it works perfectly on my laptop, but not on my desktop or more importantly, my web page. I thought there might be some security issues involved (a grey area for me) but then why would the file load at all? As you can see, the songs are just in a subfolder, so I can't see why there would be a problem.
I even created a test.fla that was just a copy-paste job from the Sound class documentation, with no bells or whistles, and even that didn't work- again it would load all right, but not play. I would have just assumed some setting was amuk on my desktop, but it also doesnt work on my site. So I'm stuck sucking a gas pipe... anyone have some suggestions??
Site Refuses To Send Email
Hello
I have a site with a contact form on it and the usual static text labels: Name, Email, Country, and Message. I bought the site from a vendor and in the instance name I can see:
a1, a2, a3, and a4 for th Name, Email, Country, and Message fields respectively.
I have uploaded the file and completed the online form - sending a message to myself. I have tried different scripts, such as:
on (release) {
loadVariables("flashEmail.asp", "POST");
}
or
on (release) {
loadVariables("flashEmail.asp", POST);
}
or
formVars.send("flashEmail.asp", "_self", "POST");
and apart from the latter I have tried then all. The latest script I have tried (this morning) is this:
on (release) {
loadVariables ("file.asp", 0, "POST");
}
I do not want - at this stage - a 'Thank you' page or anything returned like that; all I wish to do is see my email from my Flash site in my inbox. I can work on the other issues later.
When I press 'submit' on the stage, I have inserted these various scripts (not all at the same time!) in the Acions Panel. But when I upload the file and try to send myself a message, nothing happens. I do not get an AS error message or an error message from the server.
I fear I am doing something fundamentally wrong, but can't think what.
The unfinished site is here: http://stevehigham59.7host.com/flash9/graphic9.html
Any advise, please?
Thanks.
Steve
Loader Component Refuses To Load
Hi all,
I have made a button which loads a swf file into a loader component. Works fine.
Then inside the swf are pictures which I 've converted to buttons and then added the following action onto:
on (release) {
container.contentPath = "img.jpg";
}
The file img.jpg is in the same dir as the rest of the site. Don't get a error messages just doesn't do anything.
What am I missing? I'm aware this is a newbie question. And I have googled and searched the forum. But I'm still perplexed why it doesn't do anything.
Cant you load buttons into a loader and then add action to these buttons within the loader?
Appreciate an answer.
Best regards
Vidir
Pls Help Movie Stubbornly Refuses To Unload.. :(
Can't seem to get my level 2 movie to unload.
I'm using Flash MX and exporting as flash6.
Base file is called Home.swf linking to the next level called Illustration.swf linking to Editorial.swf.
I made three button instances on these pages called illustration, editorial, home.
AS on Home.swf is:
_root.illustration.onPress = function()
{
loadMovie("illustration.swf", "_level1");
}
AS on Illustration.swf is:
_root.home.onPress = function()
{
loadMovie("home.swf", "_level0");
}
_root.editorial.onPress = function()
{
loadMovie("Editorial.swf", "_level2");
}
AS on Editorial.swf is:
_root.illustration.onPress = function()
{
unloadMovie (2);
}
This last bit (concerning Editorial.swf) just doesn't work and i don't know why..
I also tried:
_root.illustration.onPress = function()
{
unloadMovieNum (2);
}
Doesn't work..
Just for an experiment i tried to LOAD illustration.swf instead of unloading level2:
_root.illustration.onPress = function()
{
loadMovie("Illustration.swf", "_level1");
}
Weirdly, if i do this, it works fine (takes me back to the illustration.swf) with the first click then if i click back to editorial.swf and try again, the cursor gets stuck and the swf crashes!
I'm sure unloadmovie is the solution..
But in that case i don't understand why there is no problem with this:
_root.home.onPress = function()
{
loadMovie("home.swf", "_level0");
}
i can do it repeatedly with no crash, but should i be unloading the movie instead?
The AS on my problem fla is on frame 5 but there is a stop action on here.
The instance is named properly and it should be so simple.. :(
:( :(
pls help!
Flash Refuses To Run With More Than 3700 Lines Of Code.
As soon as i add one more line of code to my game flash will no longer run the movie. ): What can i do? I already tried putting the code into different places with no luck. I estimate that the final game will be somewhere in the 5000 line area.
Simulated Download Refuses To Display Content...
Hey guys, truly strange behavior here which is baffling me. I'll keep the backstory short and sweet. Initially I wrote some code to display a banner slideshow at the top of my flash website using a UILoader and a timer object. The UILoader would load an image and when the image was done loading I would start a timer. Once the timer was done (the image had been displayed as long as necessary) the UILoader would load the next image. As you can imagine this worked fine on my machine, but with a simulated download on a 56k modem setting I hit a snag. The minute the timer was up and it was time to load the next image, the image previously displayed would disappear as the new image was loading leaving the banner blank. Sure I could display a preloader progressbar here as filler but that seemed silly. "Surely there is a way to load an image, display it and immediately load another, but not display it unless the timer has finished..." I thought.
So here is my current code using a standard Loader object and the same timer, with a rewrite to make the display of the Loader dependent on the timer being completed. The entire code hinges on a boolean value timeUp which = true when the timer completes and is reset to false when the image is actually displayed. It works like a charm from my machine, but for some reason when I do a simulated download, despite the fact that the output seems fine, nothing is ever displayed.
Code
ActionScript Code:
var slideShowXml:String = "bannerSS.xml";
var slideLoader:Loader = new Loader();
var myTimer:Timer = new Timer(8000);
var timeUp:Boolean = true;
var slideCount:Number;
var curSlide:Number = 0;
var prevSlide:Number = 0;
var slideXml:XML;
var slideList:Array = new Array()
// Check timer progress
myTimer.addEventListener(TimerEvent.TIMER, onTimerFinished);
// Check image load progress
slideLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoadComplete);
function onTimerFinished(evt:Event):void {
timeUp = true;
myTimer.stop();
}
// Pull in image information from XML for slideshow
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, onSlideInfoLoaded);
xmlLoader.load(new URLRequest(slideShowXml));
function onSlideInfoLoaded(evt:Event):void {
slideXml = XML(evt.target.data);
slideCount = slideXml.slide.length() - 1;
for (var j:uint = 0; j <= slideCount; j++){
var slide:Object = {slideLabel:slideXml.slide[j].@label.toString(),
slideImage:slideXml.slide[j].@data.toString(),
slideCaption:slideXml.slide[j].@caption.toString()};
slideList.push(slide);
}
trace("LOADED list of images, preparing to display first slide");
showSlide(evt);
}
function randomRange(max:Number, min:Number = 0):Number
{
return Math.round(Math.random() * (max - min) + min);
}
function showSlide(evt:Event):void {
prevSlide = curSlide;
// Avoid displaying the same slide twice in a row
do {
curSlide = randomRange(0, slideCount);
} while (curSlide == prevSlide);
trace("Loading slide: " + curSlide.toString() + " - " + slideList[curSlide].slideImage.toString());
slideLoader.load(new URLRequest(slideList[curSlide].slideImage));
caption.htmlText = "<p class='content' align='right'>" + slideList[curSlide].slideCaption + "</p>";
}
function onImageLoadComplete(evt:Event):void {
//pb.visible = false;
trace("Loading of slide: " + curSlide.toString() + " complete!");
if (timeUp) {
trace("TIMER UP WHEN LOAD FINISHED - DISPLAYING IMAGE");
bannerSSContent.addChild(slideLoader);
slideLoader.x = -292.5;
slideLoader.y = -72.5;
trace("Banner now has " + bannerSSContent.numChildren + " children.");
//new Tween(bannerSSFader, "alpha", None.easeNone, 1, 0, 2, true);
timeUp = false;
myTimer.start();
showSlide(evt);
} else {
trace("TIMER NOT UP, WAITING...");
//The slide is loaded but the timer isn't ready so we wait
addEventListener(Event.ENTER_FRAME, onFrameTimerCheck);
}
}
function onFrameTimerCheck(evt:Event):void {
if(timeUp) {
trace("TIMER FINISHED, DISPLAYING NOW...");
removeEventListener(Event.ENTER_FRAME, onFrameTimerCheck);
bannerSSContent.addChild(slideLoader);
slideLoader.x = -292.5;
slideLoader.y = -72.5;
trace("Banner now has " + bannerSSContent.numChildren + " children.");
//new Tween(bannerSSFader, "alpha", None.easeNone, 1, 0, 2, true);
timeUp = false;
myTimer.start();
showSlide(evt);
}
}
My basic goal was to create the following logic:
Begin Load Image
When done...
if timer is up
display image
Begin Load new image
if timer is not up
wait on timer
when timer up...
display image
Begin Load new image
Noticing that the number of children never increases I'm guessing the source of my issue is in the way I'm actually trying to add my newly loaded images to the stage. I think each time a load completes I need to actually create a NEW object from the loader content and then add that new object to the stage. I haven't managed to figure out how to do that yet...
Output from standard run (not a simulated download)
Code:
LOADED list of images, preparing to display first slide
Loading slide: 12 - Beautiful Clouds
Loading of slide: 12 - Beautiful Clouds complete!
TIMER ALREADY EXPIRED - DISPLAYING IMAGE
Banner now has 2 children.
Make call to load next image
Loading slide: 6 - Whangarei Beach, New Zealand
Loading of slide: 6 - Whangarei Beach, New Zealand complete!
TIMER NOT UP, WAITING...
TIMER FINISHED, DISPLAYING NOW...
Banner now has 2 children.
Make call to load next image
Loading slide: 28 - Mount Victoria Hike
Loading of slide: 28 - Mount Victoria Hike complete!
TIMER NOT UP, WAITING...
TIMER FINISHED, DISPLAYING NOW...
Banner now has 2 children.
Make call to load next image
Loading slide: 35 - Black Water Rafting
Loading of slide: 35 - Black Water Rafting complete!
TIMER NOT UP, WAITING...
As usual any suggestions would be welcome! Thanks in advance!
EDIT: As a last attempt before bed I've also tried taking the loader content and casting it to a new bitmap object (since I'm loading a picture each time) and then adding that bitmap to the container bannerSSContent(which is a movieclip btw) but I get an error the very moment the loader tries to continue and load the second image.
Code Change
ActionScript Code:
var newImage:Bitmap = Bitmap(slideLoader.content);
bannerSSContent.addChild(newImage);
newImage.x = -292.5;
newImage.y = -72.5;
Error:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::Loader/unload()
at index4_fla::MainTimeline/showSlide()
at index4_fla::MainTimeline/onImageLoadComplete()
I Have A Quicktime PANO File That Refuses To Work.....HELP
It works on my desktop, but when I try to upload to the server, it shows up as a broken link.
The html page and the PANO file are in the same root folder. I've tried almost everything.
Do you have any experience with PANO files? I think something is happening to it when I upload it. Perhaps I'm not doing it in the correct way.
Any advice would be appreciated.
Thanks.
Localhost(apache) Refuses To Play Beyond 1st Frame
i have no idea why but most of my project refuse to go further than 1st frame. if 1st frame has some mc animation it is being played but nothing more. i have new versions of apache, flashplayer & still nothing. what's more curious when i upload same swfs to my lan server everything plays well from the beginning till the end.
any ideas? it's hard to test everything by uploading to server first...
Simple Stop Script Refuses To Work - Sometimes..
So I have a couple of flash banners that I'm making, they are different sizes of the exact same thing. I used this script to stop all the animation inside a movie clip called main_ufo on the main timeline:
_root.main_ufo.stop();
_root.main_ufo.door.gotoAndStop(89);
_root.main_ufo.outterlights.stop();
_root.main_ufo.lights.stop();
This works on one of the sizes, but will not work on another size. I checked and double checked the publish settings (both are set to player 6, actionscript 2.0), made sure all the movie clips were named correctly and present at the time of the script, and I went into every single movie clip to make sure there were no conflicting scripts inside them. Still nothing. I even copied the ufo clip directly from the working banner and pasted it into the non-working banner and replaced it in the library. I tried changing all the _root.'s to this.
I've run out of ideas. It works on my 120x600 banner and doesn't on the 728x90.
If I had hair I would officially be pulling it out. Open to any ideas/suggestions at all.
URGENT, GetURL Action Refuses To Cooperate
I am so frustrated I could scream. Why is it that I can't get ACTIONSCRIPT to load a link into the same window.
someButton.onRelease = function () {
getURL ("http://someurl",_top);
}
I have tried, _top, _self, etc. I have even tried explicitly naming an inline frame in FrontPage and loading the URL into the named frame and it doesn't work. In fact, some times, 2 or 3 windows pop open.
I know this is STOOOPID, BUT PLEASE HELP.
Thanks, Rowdy
Flash Movie Refuses To Load. Black Screen Only.
This is my first time using flash, and sure enough, I've already encountered a pretty gigantic problem. THE MOVIE WON'T LOAD! I've been stumbling with this for hours. At first I thought my flash was just tooooo big, so I compressed my audio files, and created a preloader. All done correctly, I assume- 98% positive!
Everything is uploaded into the same directory. Not exactly sure why this is happening. Some clarification would be dandy!
URL in question
http://geocities.com/captaindestr0y/
Flash AS3 Refuses To Load Https, Loads Http Fine
I'm trying to authenticate myself to google using this code snippet:
ActionScript Code:
var loader:URLLoader = new URLLoader();
function authenticate( username:String, password:String, service:String, source:String, accountType:String = "" ):void
{
var vars:URLVariables = new URLVariables();
vars.accountType = "HOSTED_OR_GOOGLE";
vars.Email = username;
vars.Passwd = password;
vars.service = service;
vars.source = source;
var request:URLRequest = new URLRequest();
request.method = URLRequestMethod.POST;
request.url = "https://www.google.com/accounts/ClientLogin";
request.data = vars;
loader.addEventListener( ProgressEvent.PROGRESS, trace);
loader.addEventListener( HTTPStatusEvent.HTTP_STATUS, trace );
loader.addEventListener( SecurityErrorEvent.SECURITY_ERROR, trace);
loader.addEventListener( IOErrorEvent.IO_ERROR, trace);
loader.addEventListener( Event.COMPLETE,hoge);
loader.load( request );
}
function hoge(event:Event){
trace(loader.data);
}
That doesn't quite work though.
I removed the error event listeners to get the full error message instead and this is what I get thrown at me:
Quote:
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: https://www.google.com/accounts/ClientLogin
The same error persists even after I've stripped every non-essential line of code as well - including variables, post method et cetera.
It's important to note I'm using the flash IDE for development. As such I can test the movie and don't have any issues with the sandbox - flash allows me to connect to outside resources when running the test swf from the flash IDE. For some odd reason however it fails on the https request.
I'm quite short on time really so any help would be greatly appreciated.
"hitTest" Refuses To Detect My Collisions
I beleive all of my code is 100% correct yet i'm still running into strange problems with collision detection, let me try to explain.
I have one character movieclip, that moves in 4 directions when arrowkeys are pressed.
One dynamic text box which acts as a simple scorecount
One other movieclip which acts as a coin/pickup for the main character (has two frames, one with the coin, and one without (so it gives the impression of the character collecting the coin once collision is detected.
Yet everytime I test the movie and run into the coin with my character, the character walks right through it, and no collision is detected, or so it seems, this the code I wrote into the coin's action panel.
onClipEvent (load) {
this.stop();
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.character)) { (if coin collides with char, coin goes to frame 2 + adds 1 to score count)
this.gotoAndStop(2);
_root.score +=1;
}
}
This alone should work am I right?
This +".jpg" Refuses To Load Properly (its Frustrating >.<:;)
Code:
lvLoader = new LoadVars();
var i:Number = 0;
lvLoader.onLoad = function(success) {
if (success) {
var avvy = lvLoader["reviewer"+i];
reviewer.text = lvLoader["reviewer"+i];
reviewmsg.htmlText = lvLoader["reviewmsg"+i];
movie.text = lvLoader["movie"+i];
rating.text = lvLoader["rating"+i];
avatar.loadMovie(avvy+".jpg");
} else {
reviewmsg.text = "loading review";
movie.text = "getting name";
rating.text = "getting Rating";
reviewer.text = "loading Reviewer";
avatar.loadMovie("loading.jpg");
}
};
lvLoader.load("moviereviews.txt");
this is what comes up..
Code:
Error opening URL "file:///C|/Documents%20and%20Settings/ruddiger2/Desktop/J.J%27S%20folder/Flash%20website%20template/FlashVillage%5FWorld%5FMap/World%5FMap/Revin
.jpg"
i'm trying to get it to load lvLoader["reviewer"+i] with a +".jpg"
but it adds a huge space between them two, causing an error to occur
could somebody help?
|