For Some Reason Doenst Work Help Plz....
flash mx AS not working going to mysql database using PHP......
// create a new loadVars object for the variables to send varsToSend = new LoadVars(); myData = new Array(); varsToSend.venueName = venueName.text; varsToSend.state = state.getSelectedItem().label; varsToSend.city = city.getSelectedItem().label; varsToSend.areaCode = areaCode.text; varsToSend.venueType = venueType.getSelectedItem().label; varsToSend.ageGroup = ageGroup.getSelectedItem().label; varsToSend.musicType = musicType.getSelectedItem().label; // include a variable to prevent cacheing - this forces the browser // to make a new call to the server varsToSend.clearCache = new Date().getTime(); // assign a variable to send - this will eventually come from the search box varsToSend.myVar = "new"; // create a new loadVars object for the variables to be received varsToReceive = new LoadVars(); // set up the onload caller varsToReceive.onLoad = processData; // set up the function to be called on onLoad function processData(success) { // split the results into arrays using the "|" delimiter - this creates three arrays //trace("first pipe = " + varsToReceive.venueName); venueNameArray = varsToReceive.venueName.split("|"); addressArray = varsToReceive.address.split("|"); cityArray = varsToReceive.city.split("|"); zipCodeArray = varsToReceive.zipCode.split("|"); areaCodeArray = varsToReceive.areaCode.split("|"); phoneNumberArray = varsToReceive.phoneNumber.split("|"); stateArray = varsToReceive.state.split("|"); // format the text for the output box for (i=0; i<venueNameArray.length; i++) { outputText.text += venueNameArray[i] + " " + addressArray[i] + " " + cityArray[i] + " " + stateArray[i] + " " + zipCodeArray[i] + " " + areaCodeArray[i] + " - " + phoneNumberArray[i] + ""; //trace(venueNameArray[i] + " " + addressArray[i] + "" + cityArray[i] + " " + zipCodeArray[i]+ " " + areaCodeArray[i] + " - " + phoneNumberArray[i]); } // tell the movie to go to the last frame label _level0.gotoAndStop("results"); } // do the send and load action - I put 127.0.0.1 (localhost) // you'll need to put your own domain name in varsToSend.sendAndLoad("search.php", varsToReceive, "GET"); stop();
DevShed > Flash Help
Posted on: December 14th, 2004, 03:22 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
For While Loop Doenst Work
Hello,
I've got a file which has to duplicate a MC as many times as there are linked txt-files. So I got I folder with 1.txt, 2.txt......x.txt. And the for while operator has to detect how many txt files there are, in order to duplicate that times the MC (because every MC has a dynamic txt fiels with an unique txt link).
This is the code in the 1st frame of the file:
-----------------------------------------
_root.basis._visible=false;
_root.basis.veld.embedFonts=true;
//
i=0;
q=1;
do {
txtPath = "import/"+q+".txt";
var txtVar = new LoadVars();
txtVar.load(txtPath);
q++;
i++;
duplicateMovieClip (_root.basis, i, i);
}
while (txtVar.loaded==true);
--------------------------------------------
He duplicates once, but then he stops. And I watched with debug movie: he returns the txtVar.loaded as a 'false', so probably theres the thing going mistake.
I've got a linked file on
www.autobahnontwerpers.nl/test.fla
Many thanks in advance
(I'm using flash MX)
GetURL Run In Localhost, Doenst Work
getURL run in localhost
I want to open a popup window from my index file. I see many example code about it here, and I test like this:
It works:
on (release) {
getURL("javascriptpenNewWindow('http://www.flashkit.com','thewin','height=400,width=400,t oolbar=no,scrollbars=yes') ");
}
But when I change the URL like this
It doesn't work:
on (release) {
getURL("javascriptpenNewWindow('http://localhost/swf/Mario.html','thewin','height=400,width=400,toolbar =no,scrollbars=yes') ");
}
And the path to the Mario.html : C:InetpubwwwrootswfMario.html
My local server work well.
I dont know while it doesn't work, please help me!
Thanks!
Does This Make Sense Because It Doenst Work
ActionScript Code:
on (release) {
if (_root.checker("home")) {
_root.checker.gotoAndStop("info");
} else {
_root.checker.gotoAndStop = "end";
}
}
I want a button to check weather a movie is on a certain frame (frame label) then act.
What code will do it?
Site Works Locally, But Doenst Work On The Net
ive got a flash site that works fine on my computer, but isnt working on the net.
the very first swf that loads up is a startup swf that loads the other movies into the proper levels using:
loadMovieNum("interface.swf", 3);
loadMovieNum("home.swf", 2);
interface.swf is supposed to stay on top throughout the entire site, while each different site is loaded into level 2
like i said, locally works fine
but on the net level 3 doesnt load up at all, only home.swf on level 2 loads
whats up wit that
[F8] Flash Scroll Bar Issue, Works Then Doenst Work?
I am using this very simple flash tutorial on installing a scroll bar http://www.lukamaras.com/tutorials/g...component.html
I am able to create this with no problem in a flash file with just this scroller. But once I insert this into a flash website I am using (a modified template) the text shows up but the arrows on the scroller do not show up. I am thinking there is a conflict somewhere ... maybe with the items in my library?? Im not sure and really frustrated. I have attached two images of what the file looks like when its just the scroller .. (as you can see it looks great .. and it does work too) .. the the other image is when I have inserted that same exact file .. into my already created flash website..... this scroller seems so simple .. it literally takes 30 seconds to make.. Im not sure why it works when its in a file by its self and then when I follow those same steps in my flash website it will not work ..
anyone that can help Id be very grateful for your help.
There Is No Reason For This Not To Work. =(
hitTest is working for one thing, but I can't get it to work for the other. I have an eskimo, and you can move him around with the arrow keys, and you can shoot his gun. And I made it so when you shoot this line the line turns red, that works. But then when I try to make it turn red whenever you move the eskimo on the line, but it doesn't work. Here is the actionscript:
//eskimo is the dude and line is..well the line
if(eskimo.hitTest(_root.line)){
with(_root.line){
gotoAndStop("blowup");
//blowup is where it turns red, which is inside the line mc.
}
}
And it doesn't say there are any errors or anything.
(I am using flash mx 2004 pro, and actionscript 2.0)
For Some Reason Wont Work
flash mx AS not working going to mysql database using PHP....i have 2 text boxes and 5 combo boxes.......
code:
// create a new loadVars object for the variables to send
varsToSend = new LoadVars();
myData = new Array();
varsToSend.venueName = venueName.text;
varsToSend.state = state.getSelectedItem().label;
varsToSend.city = city.getSelectedItem().label;
varsToSend.areaCode = areaCode.text;
varsToSend.venueType = venueType.getSelectedItem().label;
varsToSend.ageGroup = ageGroup.getSelectedItem().label;
varsToSend.musicType = musicType.getSelectedItem().label;
// include a variable to prevent cacheing - this forces the browser
// to make a new call to the server
varsToSend.clearCache = new Date().getTime();
// assign a variable to send - this will eventually come from the search box
varsToSend.myVar = "new";
// create a new loadVars object for the variables to be received
varsToReceive = new LoadVars();
// set up the onload caller
varsToReceive.onLoad = processData;
// set up the function to be called on onLoad
function processData(success) {
// split the results into arrays using the "|" delimiter - this creates three arrays
//trace("first pipe = " + varsToReceive.venueName);
venueNameArray = varsToReceive.venueName.split("|");
addressArray = varsToReceive.address.split("|");
cityArray = varsToReceive.city.split("|");
zipCodeArray = varsToReceive.zipCode.split("|");
areaCodeArray = varsToReceive.areaCode.split("|");
phoneNumberArray = varsToReceive.phoneNumber.split("|");
stateArray = varsToReceive.state.split("|");
// format the text for the output box
for (i=0; i<venueNameArray.length; i++) {
outputText.text += venueNameArray[i] + " " + addressArray[i] + " " + cityArray[i] + " " + stateArray[i] + " " + zipCodeArray[i] + " " + areaCodeArray[i] + " - " + phoneNumberArray[i] + "
";
//trace(venueNameArray[i] + " " + addressArray[i] + "" + cityArray[i] + " " + zipCodeArray[i]+ " " + areaCodeArray[i] + " - " + phoneNumberArray[i]);
}
// tell the movie to go to the last frame label
_level0.gotoAndStop("results");
}
// do the send and load action - I put 127.0.0.1 (localhost)
// you'll need to put your own domain name in
varsToSend.sendAndLoad("search.php", varsToReceive, "GET");
stop();
EDIT: added [ as ] tags - jbum
Please Help Some Reason This Doesn't Work...
I've spent all fu*king day on this! someone PLEASE help before i really go insane! I'm in a band, and I want to create a SWF flash file that auto loads (pop up) our PureVolume.com page.
Here's an example of what I want to happen, exactly.
http://www.thirdfloorview.com/problem/ddc.swf
That's from another bands site, I decompiled that code, and put it in my Flash movie.. and it just doesn't work, I've tried everything! Check it out
http://www.thirdfloorview.com/problem/problem.swf
http://www.thirdfloorview.com/problem/problem.fla
The first keyframe (around 50) is the script to load the page
The second key frame (right after the last one) is just a stop() command. I know this is a simple resolution, can someone please help me?!!?
For Some Reason Doesnt Work.....help Plz
flash mx AS not working going to mysql database using PHP......
// create a new loadVars object for the variables to send
varsToSend = new LoadVars();
myData = new Array();
varsToSend.venueName = venueName.text;
varsToSend.state = state.getSelectedItem().label;
varsToSend.city = city.getSelectedItem().label;
varsToSend.areaCode = areaCode.text;
varsToSend.venueType = venueType.getSelectedItem().label;
varsToSend.ageGroup = ageGroup.getSelectedItem().label;
varsToSend.musicType = musicType.getSelectedItem().label;
// include a variable to prevent cacheing - this forces the browser
// to make a new call to the server
varsToSend.clearCache = new Date().getTime();
// assign a variable to send - this will eventually come from the search box
varsToSend.myVar = "new";
// create a new loadVars object for the variables to be received
varsToReceive = new LoadVars();
// set up the onload caller
varsToReceive.onLoad = processData;
// set up the function to be called on onLoad
function processData(success) {
// split the results into arrays using the "|" delimiter - this creates three arrays
//trace("first pipe = " + varsToReceive.venueName);
venueNameArray = varsToReceive.venueName.split("|");
addressArray = varsToReceive.address.split("|");
cityArray = varsToReceive.city.split("|");
zipCodeArray = varsToReceive.zipCode.split("|");
areaCodeArray = varsToReceive.areaCode.split("|");
phoneNumberArray = varsToReceive.phoneNumber.split("|");
stateArray = varsToReceive.state.split("|");
// format the text for the output box
for (i=0; i<venueNameArray.length; i++) {
outputText.text += venueNameArray[i] + " " + addressArray[i] + " " + cityArray[i] + " " + stateArray[i] + " " + zipCodeArray[i] + " " + areaCodeArray[i] + " - " + phoneNumberArray[i] + "
";
//trace(venueNameArray[i] + " " + addressArray[i] + "" + cityArray[i] + " " + zipCodeArray[i]+ " " + areaCodeArray[i] + " - " + phoneNumberArray[i]);
}
// tell the movie to go to the last frame label
_level0.gotoAndStop("results");
}
// do the send and load action - I put 127.0.0.1 (localhost)
// you'll need to put your own domain name in
varsToSend.sendAndLoad("search.php", varsToReceive, "GET");
stop();
Is There Any Reason This Shouldn't Work?
ActionScript Code:
if (itemType == "file") { trace("Is File"); mc_File._visible = true; trace("mc_File vis: "+mc_File._visible); }
It is tracing "Is File" and then "mc_File vis: undefined";
This code is inside a ContentItem.as class script and it works the first time but not the second?
[Flash 8 Pro] Any Reason This Won't Work?
Is there any reason why this shouldn't work?
Code:
stop();
// Forward Functions
// 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8
//
enterFwd.onRelease = function(){
gotoAndStop(2);
};
twoFwd.onRelease = function(){
gotoAndStop(3);
};
threeFwd.onRelease = function(){
gotoAndStop(4);
};
fourFwd.onRelease = function(){
gotoAndStop(5);
};
fiveFwd.onRelease = function(){
gotoAndStop(6);
};
sixFwd.onRelease = function(){
gotoAndStop(7);
};
sevenFwd.onRelease = function(){
gotoAndStop(8);
};
I can click on the first button with an instance name enterFwd and it takes me to the 2nd frame. When I click on the button with instance name twoFwd on frame 2, it doesn't do anything. This swf is so simple, intentionally, to ensure that its blunt functionality works. I'm driving myself crazy with why it doesn't work.
Also, i changed it so the first button instance onRelease goes to other frames besides 2, and it takes you there, but then the action for the movieclip on that stage doesn't work either. It's like the script only works once then its done.
it's as if it can't read the actionscript once it changes frames. I'm thinking I need a loop or something to make it read the script no matter what frame you're on?
For Some Reason Doesnt Work.....help Plz
flash mx AS not working going to mysql database using PHP......
// create a new loadVars object for the variables to send
varsToSend = new LoadVars();
myData = new Array();
varsToSend.venueName = venueName.text;
varsToSend.state = state.getSelectedItem().label;
varsToSend.city = city.getSelectedItem().label;
varsToSend.areaCode = areaCode.text;
varsToSend.venueType = venueType.getSelectedItem().label;
varsToSend.ageGroup = ageGroup.getSelectedItem().label;
varsToSend.musicType = musicType.getSelectedItem().label;
// include a variable to prevent cacheing - this forces the browser
// to make a new call to the server
varsToSend.clearCache = new Date().getTime();
// assign a variable to send - this will eventually come from the search box
varsToSend.myVar = "new";
// create a new loadVars object for the variables to be received
varsToReceive = new LoadVars();
// set up the onload caller
varsToReceive.onLoad = processData;
// set up the function to be called on onLoad
function processData(success) {
// split the results into arrays using the "|" delimiter - this creates three arrays
//trace("first pipe = " + varsToReceive.venueName);
venueNameArray = varsToReceive.venueName.split("|");
addressArray = varsToReceive.address.split("|");
cityArray = varsToReceive.city.split("|");
zipCodeArray = varsToReceive.zipCode.split("|");
areaCodeArray = varsToReceive.areaCode.split("|");
phoneNumberArray = varsToReceive.phoneNumber.split("|");
stateArray = varsToReceive.state.split("|");
// format the text for the output box
for (i=0; i<venueNameArray.length; i++) {
outputText.text += venueNameArray[i] + " " + addressArray[i] + " " + cityArray[i] + " " + stateArray[i] + " " + zipCodeArray[i] + " " + areaCodeArray[i] + " - " + phoneNumberArray[i] + "
";
//trace(venueNameArray[i] + " " + addressArray[i] + "" + cityArray[i] + " " + zipCodeArray[i]+ " " + areaCodeArray[i] + " - " + phoneNumberArray[i]);
}
// tell the movie to go to the last frame label
_level0.gotoAndStop("results");
}
// do the send and load action - I put 127.0.0.1 (localhost)
// you'll need to put your own domain name in
varsToSend.sendAndLoad("search.php", varsToReceive, "GET");
stop();
UI Compomemts Wont Work For Some Reason :( ?
Not sure what the story is here, havn't really used components.
I am building a simple search form. I thought to save some time and use the UI components set, dropdown menu, radio buttons etc. For some reason when i publish the movie the components dont appear. All i see is a black squared outline where the component should be.
Publishing: player 6 AS1
Anyone
Cheers
Paul
[CS3] Any Reason My Flash Background Will Not Work In IE?
I am using this code for fullscreen flash with horizontally centered content. The code I am using is working pretty well in Firefox (every once in a blue moon the background jpg won't load in firefox3) but my biggest issue is it pretty much never loads in IE (the image is just a standard jpg). Does anyone see any problems with how I am handling this that it would be having issues in IE? Please let me know as this is pretty much driving me crazy!
Here is a sample of my AS2 code:
Code:
stop();
Stage.scaleMode = "noscale";
Stage.align = "TL";
import mx.transitions.Tween;
import mx.transitions.easing.*;
//Center movieClip reusable function
function centerMC(mc:MovieClip):Void {
mc._x = Math.floor((Stage.width - mc._width) / 2);
//mc._y = Math.floor((Stage.height - mc._height) / 2);
}
//Fade in or out reusable function
function fadeMc(mc:MovieClip, newAlpha:Number, duration:Number):Void {
var mcAlpha:Number = mc._alpha;
var fade:Tween = new Tween(mc, "_alpha", Regular.easeOut, mcAlpha, newAlpha, duration, false);
}
//Reposition elements
function reposition():Void {
centerMC(mcholder);
bkgScale();
};
Stage.addListener({onResize:reposition});
//Scale Background
function bkgScale():Void {
// This is the proportion (width/height) of the image
var imageScale:Number = bkgHolder._width/bkgHolder._height;
// This is the proportion (width/height) of the stage
var stageScale:Number = Stage.width/Stage.height;
// If the stage scale is bigger than the image scale the images width resizes to the stage
// width and the image height takes the stage proportion
if (stageScale>=imageScale) {
bkgHolder._width = Stage.width;
bkgHolder._height = Stage.width/imageScale;
// If the stage scale is smaller than the image scale the images height resizes to the stage
// height and the image width takes the stage proportion
} else {
bkgHolder._height = Stage.height;
bkgHolder._width = Stage.height*imageScale;
}
}
/////////////Loader//////////////////////
var loaderListener:Object = new Object();
//When loading starts turn the loaded clip alpha to 0
loaderListener.onLoadStart = function(mc:MovieClip):Void {
mc._alpha = 0;
};
//When the first frame of the loaded clip have been executed
loaderListener.onLoadInit = function(mc:MovieClip):Void {
//if it is the background
//scale background
//and load the external mc with a 1000 miliseconds delay
// so the appearing of the elements seem more smooth
if (mc == bkgHolder) {
bkgScale();
setTimeout(loadMc, 1300);
}
//if it is the external mc
//center it
else if (mc == mcholder) {
centerMC(mc);
}
//Tween the loaded alpha to 100
fadeMc(mc, 100, 28);
};
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(loaderListener);
//Load external MC
function loadMc():Void {
loader.loadClip("sgcore.swf", mcholder);
}
//Load background image
function loadBKG():Void {
loader.loadClip("background.jpg", bkgHolder);
}
//Start Loading
loadBKG();
Any Reason Why Embedded Fonts Won't Work Here?
I've got a problem with setting embedded fonts for runtime texfields. They work fine with the standard swf. If that swf is loaded from another swf, however they don't seem to be working and so the text is not being displayed. This is the html code:
HTML Code:
<OBJECT CLASSID="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" CODEBASE="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="950" HEIGHT="550" ID="main" ALIGN="middle">
<PARAM NAME="allowScriptAccess" VALUE="sameDomain" />
<PARAM NAME="movie" VALUE="main.swf?theFile=swrdnewlayout.swf" />
<PARAM NAME="loop" VALUE="false" />
<PARAM NAME="menu" VALUE="false" />
<PARAM NAME="quality" VALUE="high" />
<PARAM NAME="bgcolor" VALUE="#ffffff" />
<EMBED SRC="main.swf?theFile=swrdnewlayout.swf" LOOP="false" MENU="false" QUALITY="high" BGCOLOR="#ffffff" WIDTH="950" HEIGHT="555" NAME="main" ALIGN="middle" ALLOWSCRIPTACCESS="sameDomain" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" />
</OBJECT>
So the main.swf is loaded and then the swrdnewlayout.swf . Its swrdnewlayout that is not working properly. Anyone know why this problem is only occurring when the swf is loaded from another swf? Is it a flash bug? Is there a bugs list available?
Scroller Wont Work For Some Reason
okay. on my scene there is a 'bothleftnrightmain' Movie Clip & in that MC there is 'maintextbox' Movie Clip & 'rightImages' movie Clip. in the 'maintextbox' Movie Clip i have a mask over my scrolling text that moves left to right. but for some reason when i test my fla. the text does not appear. i think i did every thing rite...
1. my text is dynamic.
2. the text box instance name is TextField
3. on my up arrow i put...
on(press) {
textField.scroll -= 1;
}
4. on the down arrow i put...
on(press) {
textField.scroll += 1;
}
when i text it every thing appears but the text...? any ideas? really stuck & the deadline is tomorrow morning...plz
Any Reason My Flash Background Will Not Work In IE?
I am using this code for fullscreen flash with horizontally centered content. The code I am using is working pretty well in Firefox (every once in a blue moon the background jpg won't load in firefox3) but my biggest issue is it pretty much never loads in IE. Does anyone see any problems with how I am handling this that it would be having issues in IE? Please let me know as this is pretty much driving me crazy!
Here is a sample of my code:
Code:
stop();
Stage.scaleMode = "noscale";
Stage.align = "TL";
import mx.transitions.Tween;
import mx.transitions.easing.*;
//Center movieClip reusable function
function centerMC(mc:MovieClip):Void {
mc._x = Math.floor((Stage.width - mc._width) / 2);
//mc._y = Math.floor((Stage.height - mc._height) / 2);
}
//Fade in or out reusable function
function fadeMc(mc:MovieClip, newAlpha:Number, duration:Number):Void {
var mcAlpha:Number = mc._alpha;
var fade:Tween = new Tween(mc, "_alpha", Regular.easeOut, mcAlpha, newAlpha, duration, false);
}
//Reposition elements
function reposition():Void {
centerMC(mcholder);
bkgScale();
};
Stage.addListener({onResize:reposition});
//Scale Background
function bkgScale():Void {
// This is the proportion (width/height) of the image
var imageScale:Number = bkgHolder._width/bkgHolder._height;
// This is the proportion (width/height) of the stage
var stageScale:Number = Stage.width/Stage.height;
// If the stage scale is bigger than the image scale the images width resizes to the stage
// width and the image height takes the stage proportion
if (stageScale>=imageScale) {
bkgHolder._width = Stage.width;
bkgHolder._height = Stage.width/imageScale;
// If the stage scale is smaller than the image scale the images height resizes to the stage
// height and the image width takes the stage proportion
} else {
bkgHolder._height = Stage.height;
bkgHolder._width = Stage.height*imageScale;
}
}
/////////////Loader//////////////////////
var loaderListener:Object = new Object();
//When loading starts turn the loaded clip alpha to 0
loaderListener.onLoadStart = function(mc:MovieClip):Void {
mc._alpha = 0;
};
//When the first frame of the loaded clip have been executed
loaderListener.onLoadInit = function(mc:MovieClip):Void {
//if it is the background
//scale background
//and load the external mc with a 1000 miliseconds delay
// so the appearing of the elements seem more smooth
if (mc == bkgHolder) {
bkgScale();
setTimeout(loadMc, 1300);
}
//if it is the external mc
//center it
else if (mc == mcholder) {
centerMC(mc);
}
//Tween the loaded alpha to 100
fadeMc(mc, 100, 28);
};
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(loaderListener);
//Load external MC
function loadMc():Void {
loader.loadClip("sgcore.swf", mcholder);
}
//Load background image
function loadBKG():Void {
loader.loadClip("background.jpg", bkgHolder);
}
//Start Loading
loadBKG();
Scroller Wont Work For Some Reason
okay. on my scene there is a 'bothleftnrightmain' Movie Clip & in that MC there is 'maintextbox' Movie Clip & 'rightImages' movie Clip. in the 'maintextbox' Movie Clip i have a mask over my scrolling text that moves left to right. but for some reason when i test my fla. the text does not appear. i think i did every thing rite...
1. my text is dynamic.
2. the text box instance name is TextField
3. on my up arrow i put...
on(press) {
textField.scroll -= 1;
}
4. on the down arrow i put...
on(press) {
textField.scroll += 1;
}
when i text it every thing appears but the text...? any ideas? really stuck & the deadline is tomorrow morning...plz
Any Reason My Flash Background Will Not Work In IE?
I am using this code for fullscreen flash with horizontally centered content. The code I am using is working pretty well in Firefox (every once in a blue moon the background jpg won't load in firefox3) but my biggest issue is it pretty much never loads in IE (the image is just a standard jpg). Does anyone see any problems with how I am handling this that it would be having issues in IE? Please let me know as this is pretty much driving me crazy!
Here is a sample of my code:
Code:
stop();
Stage.scaleMode = "noscale";
Stage.align = "TL";
import mx.transitions.Tween;
import mx.transitions.easing.*;
//Center movieClip reusable function
function centerMC(mc:MovieClip):Void {
mc._x = Math.floor((Stage.width - mc._width) / 2);
//mc._y = Math.floor((Stage.height - mc._height) / 2);
}
//Fade in or out reusable function
function fadeMc(mc:MovieClip, newAlpha:Number, duration:Number):Void {
var mcAlpha:Number = mc._alpha;
var fade:Tween = new Tween(mc, "_alpha", Regular.easeOut, mcAlpha, newAlpha, duration, false);
}
//Reposition elements
function reposition():Void {
centerMC(mcholder);
bkgScale();
};
Stage.addListener({onResize:reposition});
//Scale Background
function bkgScale():Void {
// This is the proportion (width/height) of the image
var imageScale:Number = bkgHolder._width/bkgHolder._height;
// This is the proportion (width/height) of the stage
var stageScale:Number = Stage.width/Stage.height;
// If the stage scale is bigger than the image scale the images width resizes to the stage
// width and the image height takes the stage proportion
if (stageScale>=imageScale) {
bkgHolder._width = Stage.width;
bkgHolder._height = Stage.width/imageScale;
// If the stage scale is smaller than the image scale the images height resizes to the stage
// height and the image width takes the stage proportion
} else {
bkgHolder._height = Stage.height;
bkgHolder._width = Stage.height*imageScale;
}
}
/////////////Loader//////////////////////
var loaderListener:Object = new Object();
//When loading starts turn the loaded clip alpha to 0
loaderListener.onLoadStart = function(mc:MovieClip):Void {
mc._alpha = 0;
};
//When the first frame of the loaded clip have been executed
loaderListener.onLoadInit = function(mc:MovieClip):Void {
//if it is the background
//scale background
//and load the external mc with a 1000 miliseconds delay
// so the appearing of the elements seem more smooth
if (mc == bkgHolder) {
bkgScale();
setTimeout(loadMc, 1300);
}
//if it is the external mc
//center it
else if (mc == mcholder) {
centerMC(mc);
}
//Tween the loaded alpha to 100
fadeMc(mc, 100, 28);
};
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(loaderListener);
//Load external MC
function loadMc():Void {
loader.loadClip("sgcore.swf", mcholder);
}
//Load background image
function loadBKG():Void {
loader.loadClip("background.jpg", bkgHolder);
}
//Start Loading
loadBKG();
AS2 - Any Reason My Flash Background Will Not Work In IE?
I am using this code for fullscreen flash with horizontally centered content. The code I am using is working pretty well in Firefox (every once in a blue moon the background jpg won't load in firefox3) but my biggest issue is it pretty much never loads in IE. Does anyone see any problems with how I am handling this that it would be having issues in IE? Please let me know as this is pretty much driving me crazy!
Here is a sample of my code:
Code:
stop();
Stage.scaleMode = "noscale";
Stage.align = "TL";
import mx.transitions.Tween;
import mx.transitions.easing.*;
//Center movieClip reusable function
function centerMC(mc:MovieClip):Void {
mc._x = Math.floor((Stage.width - mc._width) / 2);
//mc._y = Math.floor((Stage.height - mc._height) / 2);
}
//Fade in or out reusable function
function fadeMc(mc:MovieClip, newAlpha:Number, duration:Number):Void {
var mcAlpha:Number = mc._alpha;
var fade:Tween = new Tween(mc, "_alpha", Regular.easeOut, mcAlpha, newAlpha, duration, false);
}
//Reposition elements
function reposition():Void {
centerMC(mcholder);
bkgScale();
};
Stage.addListener({onResize:reposition});
//Scale Background
function bkgScale():Void {
// This is the proportion (width/height) of the image
var imageScale:Number = bkgHolder._width/bkgHolder._height;
// This is the proportion (width/height) of the stage
var stageScale:Number = Stage.width/Stage.height;
// If the stage scale is bigger than the image scale the images width resizes to the stage
// width and the image height takes the stage proportion
if (stageScale>=imageScale) {
bkgHolder._width = Stage.width;
bkgHolder._height = Stage.width/imageScale;
// If the stage scale is smaller than the image scale the images height resizes to the stage
// height and the image width takes the stage proportion
} else {
bkgHolder._height = Stage.height;
bkgHolder._width = Stage.height*imageScale;
}
}
/////////////Loader//////////////////////
var loaderListener:Object = new Object();
//When loading starts turn the loaded clip alpha to 0
loaderListener.onLoadStart = function(mc:MovieClip):Void {
mc._alpha = 0;
};
//When the first frame of the loaded clip have been executed
loaderListener.onLoadInit = function(mc:MovieClip):Void {
//if it is the background
//scale background
//and load the external mc with a 1000 miliseconds delay
// so the appearing of the elements seem more smooth
if (mc == bkgHolder) {
bkgScale();
setTimeout(loadMc, 1300);
}
//if it is the external mc
//center it
else if (mc == mcholder) {
centerMC(mc);
}
//Tween the loaded alpha to 100
fadeMc(mc, 100, 28);
};
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(loaderListener);
//Load external MC
function loadMc():Void {
loader.loadClip("sgcore.swf", mcholder);
}
//Load background image
function loadBKG():Void {
loader.loadClip("background.jpg", bkgHolder);
}
//Start Loading
loadBKG();
Linking Buttons Wont Work For Some Reason
hello,
im making my new web site and i got some code for some Mac style buttons which expand when the mouse is over them anyway these web site is laid out like this
scene 1 (with all the pages in the web site)
on each page their is a movie clip called Nav which is the navigation pannel in this movie clip are more movie clips each of which contain a button which expands
ive tried alsorts to make the buttons control the selection of pages i.e _root and this.parent.parent etc etc but nothing seems to work ive tried placing the script on the buttons themselves and also the movie clip which contains the buttons still to no success.
any ideas?
cheers
Matt
i would upload the file but it is about 20kb too big when zipped
p.s im using flash mx 2004
Any Reason A Site Would Work On A Mac In Canada But Not On A Mac In New York ?
Hi,
I'm currently updating a website for a new york artist.
The site is at :
www.cornostudio.com
I'm using xml to load the image gallery.
I updated everything under ARTWORK except prints
Clicking on Faces should load thumbnails and mouse-over on these thumbnails should make the images appear on the left side of the side.
Clicking on thumbnails should load a window with the image blown up a bit with a close button.
I have the latest 15 inch core 2 duo macbok pro model and it works fine and I live in canada.
My client has the same exact computer and it didnt work at her house so she went to the apple store in NY to try it on other machines and it doesnt work there either.
Any reason that would be happening ?
The site is published in flash 7 and I also tried flash 8 to no avail.
Give Me One Good Reason Why My Basic Code Cant Be Bothered To Work, Please.
Ok, so ive got this game im working on, but the idea is that u accerate into thae square and it goes to a frame which playes u doing the jump...
Funnily enough it dosent work, heres the fla file to download.
So in short my problem is my hitTest script isnt working, the red square out side the playarea shuold make it work but it dosent.
please help me thx very much, any help will be appricated. if u even view the thread plz post!
Give Me One Good Reason Why My Basic Code Cant Be Bothered To Work, Please.
Ok, so ive got this game im working on, but the idea is that u accerate into thae square and it goes to a frame which playes u doing the jump...
Funnily enough it dosent work, heres the fla file to download.
So in short my problem is my hitTest script isnt working, the red square out side the playarea shuold make it work but it dosent.
please help me thx very much, any help will be appricated. if u even view the thread plz post!
Swf Doenst Load Propely
Ok so heres my swf file: http://amardeep234.0catch.com/Main%20profile3.swf
When u use the link, its fine. 0catch is my hosting company, ive hosted all my icons, .xml file and .js file.
So it runs fine when i use that link.
But when i use that link and put it into another website it doesnt work.
E.g. i use torncity.com. They have bb-code enabled (and 1 of the tags are using swf files: [flash=widthxheight]swf url[/flash] ... but once i put my flash link in it, it doenst play my file.
The site is www.torncity.com then go to bottom and click preferences/profile signature (http://www.torncity.com/preferences.php?action=psig)/ (then u enter your bb-code)/then save/ (then u click ur name near the top left, and scroll down that is your profile)
But for some reason when i use my flash file into torncity.com it doesnt work competely, can someone please help me, and fix it how to work in there
The " : " Doenst Pass From Flash To ASP
The " : " doenst pass from Flash to ASP!
I send data from a flash form as
----------------------------------------------
loadVariablesNum ("Updatelink.asp?&Title="+ Title+"&type="+type+"&link="+link+"&Body="+ Body, 0, "POST");
----------------------------------------------
If you put "hello" in all fields ... it works but if there is a ":" in a field (for ex. in link!! (http://) )it doesnt work...
In a HTML simple Form it works so this is not an ASP problem
Help!
For Some Reason...
Hey Flash Board! I've used a similar menu drop down to this one here:
(http://www.flashkit.com/tutorials/Ac...-121/index.php)
And in my .swf it won't (on (press)gotoAndStop ("Scene 1", 23);}
On the buttons that "pop out" from the rollover menu. I'm using Flash 5 and I've checked my script and it's really not that complicated to mess-up. I'm beating my head against my desk. Any help would be greatly appreciated. Thanks a bunch.
~geoff
What Could Be The Reason ?
Its really strange ! l add my new swf to my web site in dreamweaver and when l wanted to preview my new flash movie on the web l got a white board instead of the swf movie but when l preview the the page locally it works just fine ! what could be the reason ?
Is There A Reason..
...that when I open the .swf the movies I have a link to that are told to open in _self open in the same window, however, when converted to a projector (.exe), the movies open in a seperate window??!?
How can I combat this?
Thanks,
Matthew
Is There Any F***ing Reason To Cause?
Is there any reason that cause this tutorial won't work...
Because it does NOT work like the others i've tried before... I am sure that i am doing no mistakes, but i am wondered about what the problem is...
http://www.actionscript.org/tutorial...il/index.shtml
And The Reason Is
Can anyone provide the reason for the distortion in the attached .fla. If you publish the file you'll see what I am talking about.
Inductive Reason
i would like to know what principle the menu of this sites operates on:
http://netstudioz.com/english/flash/intro.html
what do you think that is? i tried a number of simple roll over goto scenes and frames and even sliding the clip into place by moving the x y positioning using the with action.
all of those didnt seem right.
i think the menu is launched based on the x y position of the mouse.
could someone tell me how to do this?
thanks.
Looping For No Reason
for some reason the logo animation of the following fla loops twice for no reason... this is animation is very siomple however i have spent about an hour trying to figure out why it wont play once and stop check it out it is really confusing thanks
Looping For Some Reason..?
I'm using the following code to perform a hitTest on a game type thing I've been working on for a while and it just seems to be looping through.
Code:
onEnterFrame = function() {
if (this.hitTest(_root.man)) {
gotoAndPlay(14);
stop();
}
}
It's not just playing the movie from frame 14, it's playing the first frame (with a sound on) and playing it over and over.
Anyone know how to only play once? Is there a "go to and play once then stop" command?
Cheers.
Lagging For No Reason
Hey freinds.
So whats happening, is I have a pretty complex range of items appearing on (for arguments sake) frame 2, from a bunch of arrays.
And this works perfectly fine. Not a scrap of lag.
Ive made a control to delete all the items on the screen and re-load the data/arrays, effectively creating more objects.
My problem is, the second, third... time you do this, it lags to almost half speed. But the frame is completely emptied before it comes back to it.
Is there anything im overlooking? Does flash keep some kind of hidden information somewhere that I can clear up or something?
ill include a example if nessisary
thanks for reading
~waste
Why 550 X 400 ? Is There A Good Reason For It?
the default document size is so small. Aren't most people on bigger res. monitors now? What are the problems with increasing the dimensions? Will different aspect ratios make my flash movie look weird if it isn't the default?
thanks
ml
Canīt Debug This For Some Reason...
Hey everyone. I recently got Flash 8, and Iīm trying to build some games.
PHP Code:
onClipEvent(load)
{
dropdown = false;
speed = 10;
}
onClipEvent(enterFrame)
{
for (var i = 0; i<3; i++)
{
for (var j = 0; j<10; j++){
_root["alien"+i+"_"+j]._x += speed;
if (_root["alien"+i+"_"+j]._x<0){
speed =10;
dropdown = true;
break;}
if (_root["alien"+i+"_"+j]._x> Stage.width){
speed = -10;
dropdown = true;
break;}
}
}
}
if(dropdown){
for (var i = 0; i<3; i++){
for (var j = 0; j<3; j++){
_root["alien"+i+"_"+j]._y +=20;
}
}
}
dropdown = false;
When I try to debug I get the following message.
PHP Code:
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 24: Statement must appear within on/onClipEvent handler
if(dropdown){
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 31: Statement must appear within on/onClipEvent handler
dropdown = false;
Total ActionScript Errors: 2 Reported Errors: 2
It might be because Iīm tired, but I canīt seem to correct the code...what am I doing wrong?
By the way, does anyone know some good and easy tutorials to make simple games like Asteroids, Space Invanders etc? Many of the tutorials I find are way too complicated for a actionscript novice.
Thanks.
PNG Compressing For Some Reason
Hey all, I am having a weird problem and havent found any answers by searching. In any case I use PNG 24 with transpercencey for just about all my site.
The weird thing is that when though I set all the PNG files compression to lossless with no compression on them they still get compressed. Any time I publish my SWF the images are no where as crips as they should be. Am I missing someting?
I got the same problem with GIF files, I also don't like the compression algorithem on these files hence my use of PNG files. Ovbiousley JPG's are out of the question since my images all have transpercenceys.
Thanks for any heads up
For Some Reason Not Working
flash mx AS not working going to mysql database using PHP......
FLASH MX script..
PHP Code:
// create a new loadVars object for the variables to send
varsToSend = new LoadVars();
myData = new Array();
varsToSend.venueName = venueName.text;
varsToSend.state = state.getSelectedItem().label;
varsToSend.city = city.getSelectedItem().label;
varsToSend.areaCode = areaCode.text;
varsToSend.venueType = venueType.getSelectedItem().label;
varsToSend.ageGroup = ageGroup.getSelectedItem().label;
varsToSend.musicType = musicType.getSelectedItem().label;
// include a variable to prevent cacheing - this forces the browser
// to make a new call to the server
varsToSend.clearCache = new Date().getTime();
// assign a variable to send - this will eventually come from the search box
varsToSend.myVar = "new";
// create a new loadVars object for the variables to be received
varsToReceive = new LoadVars();
// set up the onload caller
varsToReceive.onLoad = processData;
// set up the function to be called on onLoad
function processData(success) {
// split the results into arrays using the "|" delimiter - this creates three arrays
//trace("first pipe = " + varsToReceive.venueName);
venueNameArray = varsToReceive.venueName.split("|");
addressArray = varsToReceive.address.split("|");
cityArray = varsToReceive.city.split("|");
zipCodeArray = varsToReceive.zipCode.split("|");
areaCodeArray = varsToReceive.areaCode.split("|");
phoneNumberArray = varsToReceive.phoneNumber.split("|");
stateArray = varsToReceive.state.split("|");
// format the text for the output box
for (i=0; i<venueNameArray.length; i++) {
outputText.text += venueNameArray[i] + " " + addressArray[i] + " " + cityArray[i] + " " + stateArray[i] + " " + zipCodeArray[i] + " " + areaCodeArray[i] + " - " + phoneNumberArray[i] + "
";
//trace(venueNameArray[i] + " " + addressArray[i] + "" + cityArray[i] + " " + zipCodeArray[i]+ " " + areaCodeArray[i] + " - " + phoneNumberArray[i]);
}
// tell the movie to go to the last frame label
_level0.gotoAndStop("results");
}
// do the send and load action - I put 127.0.0.1 (localhost)
// you'll need to put your own domain name in
varsToSend.sendAndLoad("search.php", varsToReceive, "GET");
stop();
XML Keeps Loading For No Reason, Why?
Hi!
I have a simple flash-menu that loads data from an XML-file, and it works great except for the curious message in the status bar that says "Getting data from (my server)".
Really, the script is very simple, all the info seems to have loaded already, and I have a "stop()" in the last frame, so It doesn't load multiple times.
Does anyone here have experience with this? What might be causing this?
Why Does My Text Move For No Reason?
I made some text and done ctrl+B. and put in a tweening
from frame 1-30, My problem is that 1 of the letters
rotates when i have not moved it but why??? please
help
Movie To Heavy For No Reason
My 20 frames movie is very heavy.
Could be because
Doing it and redoing it, I collect a library of
almost 150 different symbols and mc.
Is the "inactive library"(symbols that I do not use)
the cause of such a weight?
There is a way, now that is done, to make it lighter?
MC Stops For Unknown Reason
Hello all,
This is driving me crazy. I have used this script before with no problems but.......
I have an empty movie clip that has this on frame 5:
if (_parent._x < 292) {
difference = 292-_parent._x;
rate = difference/2;
_parent._x = _parent._x+rate;
}
It makes its parent clip move to the right.
The next frame has this:
if (_parent._x < 292) {
gotoAndPlay(5);
}
This should check to make sure it has made it to the spot that it needs to be in. Then it should move on down the line.
My problem is that it doesnt move on. the motion works perfectly but the MC seems to stop here. Anyone ever have this problem? I have been messing with it for the last three hours. Your input would be greatly appreciated.
-Regards
Board Offsets For Some Reason
Hi all, hope you can help because I haven't got a clue
I am developing a roulette type game
I have the betting board inside a MC. All the events that have to do with the board happens inside this MC.
The problem is when the user places a chip (the function and chip placing happens inside the boardMC) the whole board offsets to the left and downward. It has something to do with the placement position of the chip because the offset is dependant on where you place the chip.
The most bizarre thing is that this does not happen on my machine but does happen on the client's machine. I have Win98 and they have Win2000 and WinMX if that means anything.
The chip is placed by calling a function that does a bunch of thins and then placed the chip as follow:
// place the chip in the same place as the betArea button
var xPo = this["betArea_"+butNum]._x+(xOffset);
var yPo = this["betArea_"+butNum]._y+(yOffset);
// level
this.zPo++;
// attach chip to display
if (this.chipType<=3) {
this.attachMovie("chip"+this.chipSets[this.chipType-1][this.EWlastChip], "chip"+this.chipNum, this.zPo);
// set position
this["chip"+this.chipNum]._x = xPo;
this["chip"+this.chipNum]._y = yPo;
//
}
I really hope someone can help
Thanks
P.
Some Reason Its Not Working.. Argh..
www.e54interactive.com/compare.zip
if you have a sec and can take a peek at this in action, maybe im missing s-thing really obvious, id really appreciate.
what im doing is loading the date from a text file, trying to compare with the current date and showing and object based on that result, for some reason its just not workiing.. id relaly appreciate if you could point me in the right direction..
thnaks
Movie Stops For No Reason
Hey all,
I have a character animation movie with 3 scenes. It all plays fine, except on the third scene it stops randomly for no reason. When I play only the third scene is plays through fine, but when I play the entire movie it keeps hanging on the same frame. I've checked all the obvious things, there are no stop actions, etc. Anyone ever heard of something like this?
Thanks
Movie Stops For No Reason, Why?
What would cause a movie to stop on a frame without any action to tell it to stop? I have my script that says gotoAndPlay("frameLabel"); and then it does go to that frame, but upon getting there it stops even though I told it to play. Nothing else tells it to stop. No other actions say stop. What could be causing this?
|