Can This Code Be Written Better Than I Have
hi everybody.
once in a while I try to stop and see if I can learn anything from what I have made. today I've made this simple picture gallery; http://www.campjohn.dk/wp/?p=583
now I'd like to know if my actionscript can be made better / can be optimized. so if you have time and feel for it, you can download the .fla here: http://campjohn.dk/test/galleri.fla
if anything can be made better, or you have anything worth mentioning, please post it
thanks
ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 11-13-2008, 02:09 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Is This Code Written Wrong?
onClipEvent (enterFrame)
{
var time = new Date();
var month = time.getMonth()+1;
var day = time.getDate();
var hours = time.getHours();
var minutes = time.getMinutes();
var seconds = time.getSeconds();
var milliseconds = time.getMilliseconds();
this.hour._rotation = 30 * hours + minutes / 2;
this.min._rotation = 6 * minutes;
this.sec._rotation= 6 * seconds;
this.mil._rotation= .36 * milliseconds;
this.month._rotation= 30 * month;
this.day._rotation= 360/31 * date;
}
For some reason, all the hands work except the month and the day. How come?
ActionScript 3.0: Can This Code Be Written Better Than I Have?
hi everybody.
once in a while I try to stop and see if I can learn anything from what I have made.
today I've made this simple picture gallery;
http://www.campjohn.dk/wp/?p=583
now I'd like to know if my actionscript can be made better / can be optimized.
so if you have the time and feel for it, you can download the .fla here:
<a href="http://campjohn.dk/test/galleri.fla">http://campjohn.dk/test/galleri.fla</a>
if anything can be made better, or you have anything worth mentioning, please post it
thanks
ActionScript 3.0: Can This Code Be Written Better Than I Hav
hi everybody.
once in a while I try to stop and see if I can learn anything from what I have made.
today I've made this simple picture gallery;
http://www.campjohn.dk/wp/?p=583
now I'd like to know if my actionscript can be made better / can be optimized.
so if you have time and feel for it, you can download the .fla here:
http://campjohn.dk/test/galleri.fla
if anything can be made better, or you have anything worth mentioning, please post it
thanks
Code Hints For Own Written Classes?
I was wondering if there is someway to get code-hints from your own classes. For example MyClass:
Code:
class MyClass
var id:Number;
var word:String;
function MyClass(thisId:Number, thisWord:String):Void{
id = thisId;
word = thisWord;
}
function setWord(thisWord:String):Void{
word = thisWord();
}
}
When working in any AS edit window I would much like to have code hints for this class. Like this:
Code:
foo = new MyClass(1,"name");
foo.[codehint here]
Does anyone know if this is possible? I know it is possible to edit the codehint XML, but that is not quite what i'm looking for...
Code Hints For Own Written Classes?
I was wondering if there is someway to get code-hints from your own classes. For example MyClass:
Code:
class MyClass
var id:Number;
var word:String;
function MyClass(thisId:Number, thisWord:String):Void{
id = thisId;
word = thisWord;
}
function setWord(thisWord:String):Void{
word = thisWord();
}
}
When working in any AS edit window I would much like to have code hints for this class. Like this:
Code:
foo = new MyClass(1,"name");
foo.[codehint here]
Does anyone know if this is possible? I know it is possible to edit the codehint XML, but that is not quite what i'm looking for...
[help] How Do Is It Written
How do u write getBounds properly i cant find any thing on here or google that can explain it and how to use it properly.
Were is good tutorial on it, or a thread that disscusses how it works??
Can This Be Re-written?
Hi,
I was wondering if you knew if this can be re-written?
I use XML which is:
PHP Code:
var x:XML = new XML();
x.ignoreWhite = true;
var urls:Array = new Array();
var captions:Array = new Array();
var whoIsOn:Number = 0;
x.onLoad = function(success) {
var number:Array = this.firstChild.childNodes;
for(i=0;i<number.length;i++) {
urls.push(number[i].attributes.url);
captions.push(number[i].attributes.caption);
trace(urls[i]);
trace(captions[i]);
mc = this.createEmptyMovieClip("mc_"+i, i);
}
whoIsOn = 0;
Download_On_Itunes.caption.text = captions[0];
// mc.attachMovie("my_mc"+((i%12)+1),"urls"+([i]+1),1);
}
But this is what I want to re-write. I'm having problems getting the images which are pushed here
PHP Code:
urls.push(number[i].attributes.url);
To get inside my my_mc.
PHP Code:
mc.attachMovie("my_mc"+((i%12)+1),"urls"+([i]+1),1);
Can anyone tell me what I can do?
Thanks
.js Written To Text
I have this code that autmaically updates teh titles to the corresponding links:
<a
href="http://headlines.agapepress.org/users/rapionet/rapionet3.asp" target="main">
<script
src="http://headlines.agapepress.org/headlines/headline3.js"></script></
a>
Could someone help make this so it will write the headlines automatically eachday into a text file flash can read. I have no idea where or how to do something like this.
Thanks,
Tony
Could This Be Written More Efficiently?
hi there all you scripting masters! ok so I've got this piece of AS that I'm sure can be much simpler than what I've got. Firstly I'll explain what it does:
I have a number of thumbnails that are movie clips named "afpthumb, dtsthumb, etc etc etc" - then some more movieclips that are the highlights for these thumbs. So when you mouse over the thumbs, the highlights turn on (named afphigh, dtshigh etc etc etc). Then if a user clicks on a thumbnail another movieclip appears, named, afpblog, dtsblog. Does that make sense??? Also, if a thumbnail is click, its highlight stays on until another thumb is clicked.
Code:
activetvc = none
afpthumb.onRelease = function () {
if (activetvc != afpblog) {
activetvc.gotoAndPlay(13)
afpblog.gotoAndPlay(2)
activehigh._alpha = 0
activetvc = afpblog
activehigh = afphigh
}
}
dtsthumb.onRelease = function () {
if (activetvc != dtsblog) {
activetvc.gotoAndPlay(13)
dtsblog.gotoAndPlay(2);
activehigh._alpha = 0
activetvc = dtsblog
activehigh = dtshigh
}
}
afpthumb.onRollOver = function () {
afphigh._alpha = 100
}
afpthumb.onRollOut = function () {
if (activetvc != afpblog) {
afphigh._alpha = 0
}
}
dtsthumb.onRollOver = function () {
dtshigh._alpha = 100
}
dtsthumb.onRollOut = function () {
if (activetvc != dtsblog) {
dtshigh._alpha = 0
}
}
this way is working for me, but there are many more thumbnails to apply it to.
if you go to www.bearcage.com.au/test/ and then go to the TVC section you can see what I'm trying to do.
Thanks!
HELP How Do I Get Text To Look Like It's Being Written?
OK, so i'm a real n00b.
Doing a project for some uni work at the moment, and i'm trying to get something to look like it's being written on the stage - i've tried rubbing bits out and all sorts, nothing looks good.
ANY help would be MASSIVELY appreciated
thanks
For Anyone Who Has Written A Form :
HELLO
so i have got the old Email form from the grand tutorial set forth on this site and, yes you guessed it, my question is this :
to those who followed the tutorial, what did you do about data validation ? is there a "Part II" i dont know about somewhere ? i guess a lot of people have been down this road already huh ?
any histories much appreciated.
when i get it sorted i would like to make a footnote to that esteemed tutorial so others can follow after me. no good having a form with no validation is there ?
I Need A Forum, Which Is Written In Flash/PHP
Hi guys
I'm looking for a Forum which is written in PHP and the *.fla should be downloadable.
If you know such forums plz tell me.
This is my favorit:
http://www.onlinewebservice.de/board...424&badword1=&
but I can't use this forum , because my homepage is only in flash written. And thís URL is html. So my forum should be an integral part of my flash homepage.
cheers
campus
How Is A Proper Actionlink Written?
Hello.
I have a button that I am wondering about.
When I click on it, I want it to direct me to the first frame in scene 3.
Is this the correct way to write it?
on (release) { gotoAndPlay("1","3"); }
Thankyou for a quick response
Please, Help Me With The Weirdest Script I've Ever Written
Please, help me with the weirdest script I've ever written!!!
The goal:
I have a grid, with 7 positions at X and Y. This make 49 positions total, right?
So, I want to place 49 instances of someMC, one in each position. Of course, I cant repeat them....
Some considerations:
X = new Array(7);//the number of positions for X and Y
Y = new Array(7);
occupied = new Array(X.length*Y.length); //the amount of positions for occupied
X[0] = 40; //the initial X and Y positions, has to be like this
Y[0] = 40;
for (i=1; i<=6; i++) { //the others are plus 80:
X[i] = X[i-1]+80;
Y[i] = Y[i-1]+80;
}
for (i=0; i<=6; i++) { //store the pairs like: 40e40, 40e120,40e200 etc, total 49 iterations
for (z=0; z<=6; z++) {
occupied.push(X[i]+"e"+Y[z]);
}
}
The scrIPtcH:
for (i=0; i<=49; i++) {
attachMovie("someMC", i, i);
entraX = X[random(X.length)];//X[0] is 40, remember?
entraY = Y[random(Y.length)];
for (z=0; z<=occupied.length; z++) { //test for all the occupieds
if (entraX+"e"+entraY == occupied[z]) {
setProperty(i, _x, entraX);
setProperty(i, _y, entraY);
occupied.splice(z, 1); //if they are equal, I take this value of occupied
}
}
}
Of course this is not working....
Composing A Written Text
hello to everybody,
How can J compose a written text (for example a logotipe "mat"), by using flash????
AIR Problems With Written As3 Calendar
Hi there,
i am currently writing an event calendar in AIR, completely done in As3. Included in this program is a As3 Calendar which is basically a enhanced version of this one here: http://www.kirupa.com/forum/showthread.php?t=281250
i have changed some things but not too much...
Now the calendar with all his functions shows up pretty nice when i Test the Movie directly in Flash, but when i export the whole thing to AIR and install it, the calendar is gone... below is the script which loads the calendar.
Is there anything in AIR to look at or to write different?! Maybe AIR cant handle the date() thing?
The funny thing is that everything works perfect in Flash but ONLY the Calendar is missing in AIR...
Anybody has a solution?!
Code:
var monthsOfYear:Array = new Array("Jaenner", "Februar", "Maerz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember");
var daysOfWeek:Array = new Array("MO", "DI", "MI", "DO", "FR", "SA","SO");
var daysOfMonths:Array = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var currentDate:Date = new Date();
var nextDate:Date = new Date();
var lastDate:Date = new Date();
var aktDate:Date = new Date();
var nowDate:Date = new Date();
var myDate:Date = new Date();
var month_mc:MovieClip = new MovieClip();
var days_mc:MovieClip = new MovieClip();
var daysNo:Number;
var startDay:Number;
var i:Number;
var xmlLoader2:URLLoader;
lastMonth_btn.buttonMode = true;
lastMonth_btn.mouseChildren = false;
nextMonth_btn.buttonMode = true;
nextMonth_btn.mouseChildren = false;
today_btn.buttonMode = true;
today_btn.mouseChildren = false;
xmlLoader2 = new URLLoader();
xmlLoader2.load(new URLRequest("content.xml"));
xmlLoader2.addEventListener(Event.COMPLETE, initCal);
function initCal(event:Event):void {
//Add current Month to Textfield
this.txt_month.text = monthsOfYear[currentDate.getMonth()];
this.txt_year.text = currentDate.getFullYear().toString();
myDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1);
daysNo = (currentDate.getFullYear()%4 == 0 && currentDate.getMonth() == 1 ? 29 : daysOfMonths[currentDate.getMonth()]);
startDay = myDate.getDay();
var row:Number = 0;
days_mc = new MovieClip();
for (i = 1; i < daysNo+1; i++) {
//Day MC
var newDay:day_mc = new day_mc();
newDay.x = (startDay * 24);
newDay.y = (row+1) * 22;
days_mc.addChild(newDay);
//Add to Textfields
var dayLabel:String = i.toString();
newDay.txt_day.text = dayLabel;
startDay++;
if (startDay >= 7) {
startDay = 0;
row++;
}
//Set a Compare Day (Date)
var compareDate:Date = new Date(nowDate.getFullYear(), nowDate.getMonth(), i);
//If the same, color it with different mouseEvents!
if (dateCompare(currentDate, compareDate) == 0) {
//ReColoring the Day on MouseOut
var target_cur = newDay.mc_day_bg;
var color_transR:ColorTransform = target_cur.transform.colorTransform;
color_transR.color = 0x910D0D;
target_cur.transform.colorTransform = color_transR;
newDay.addEventListener(MouseEvent.MOUSE_OVER, day_over_cur);
newDay.addEventListener(MouseEvent.MOUSE_OUT, day_out_cur);
} else {
newDay.addEventListener(MouseEvent.MOUSE_OVER, day_over);
newDay.addEventListener(MouseEvent.MOUSE_OUT, day_out);
}
newDay.buttonMode = true;
newDay.mouseChildren = false;
function dateCompare(date1:Date, date2:Date):int {
// First compare years
if (date1.getFullYear() > date2.getFullYear()) {return 1;} else if (date1.getFullYear() < date2.getFullYear()) {return -1;
} else {
// Years are equal, try comparing months
if (date1.getMonth() > date2.getMonth()) {return 1;} else if (date1.getMonth() < date2.getMonth()) {return -1;
} else {
// Months are equal, try comparing days
if (date1.getDate() > date2.getDate()) {return 1;} else if (date1.getDate() < date2.getDate()) {return -1;
} else {
// The two dates are the same in Year, Month, and Day
return 0;
}
}
}
}
function day_over(event:MouseEvent):void
{
//Coloring the Day on MouseOver
var target_color = event.target.mc_day_bg;
var color_trans:ColorTransform = target_color.transform.colorTransform;
color_trans.color = 0x910D0D;
target_color.transform.colorTransform = color_trans;
}
function day_out(event:MouseEvent):void
{
//ReColoring the Day on MouseOut
var target_color = event.target.mc_day_bg;
var color_trans:ColorTransform = target_color.transform.colorTransform;
color_trans.color = 0x8D9981;
target_color.transform.colorTransform = color_trans;
}
function day_over_cur(event:MouseEvent):void
{
//Coloring the current Day on MouseOver
var target_color = event.target.mc_day_bg;
var color_trans:ColorTransform = target_color.transform.colorTransform;
color_trans.color = 0xE72828;
target_color.transform.colorTransform = color_trans;
}
function day_out_cur(event:MouseEvent):void
{
//ReColoring the current Day on MouseOut
var target_color = event.target.mc_day_bg;
var color_trans:ColorTransform = target_color.transform.colorTransform;
color_trans.color = 0x910D0D;
target_color.transform.colorTransform = color_trans;
}
}
nextDate.setMonth(currentDate.month + 1);
lastDate.setMonth(currentDate.month - 1);
aktDate.setMonth(currentDate.month);
nextMonth_btn.addEventListener(MouseEvent.CLICK, nextMonth);
lastMonth_btn.addEventListener(MouseEvent.CLICK, lastMonth);
today_btn.addEventListener(MouseEvent.CLICK, currentMonth);
days_mc.x = 5;
days_mc.y = 26;
this.addChild(days_mc);
}
//Nächstes Monat
function nextMonth(event:MouseEvent):void {
this.removeChild(days_mc);
nextMonth_btn.removeEventListener(MouseEvent.CLICK, nextMonth);
if (nextDate.month > 11) {
nextDate.month = 0;
nextDate.setFullYear(currentDate.fullYear ++);
}
lastDate.setFullYear(nextDate.fullYear);
currentDate.setMonth(nextDate.month);
currentDate.setFullYear(nextDate.fullYear);
initCal(event);
}
//Letztes Monat
function lastMonth(event:MouseEvent):void {
this.removeChild(days_mc);
lastMonth_btn.removeEventListener(MouseEvent.CLICK, lastMonth);
if (nextDate.month < 0) {
lastDate.month = 11;
lastDate.setFullYear(currentDate.fullYear --);
}
nextDate.setFullYear(lastDate.fullYear);
currentDate.setMonth(lastDate.month);
currentDate.setFullYear(lastDate.fullYear);
initCal(event);
}
//Aktuelles Monat
function currentMonth(event:MouseEvent):void {
this.removeChild(days_mc);
today_btn.removeEventListener(MouseEvent.CLICK, currentMonth);
currentDate = new Date();
nextDate.setFullYear(currentDate.fullYear);
lastDate.setFullYear(currentDate.fullYear);
initCal(event);
}
Good MP3 XML Player Written In AS3
Hi guys,
are there any cool MP3 written in AS3 players available? I spend some time searching google but did not find anything cool except the cartoon stuff which is more of a tuturial.
Do you guys know any cool highquality AS3 MP3 Players? Its a real pitty that all of the cool AS2 players have not been adapted yet.
A would also be interested in some tutorials concerning this topic.
I would be really happy about some tipps
Ras
Form Written By Thomas Watson
I use form written by Thomas Watson in a new designed website. I encountered an error which I am not able to solve even few hours effort has been thrown. The effort, however, is in vain.
If the swf form is individually used in an pop up html, i don't have any problem in sending it.
http://www.baptain.com/appointmentcgi1.html
However, if I'm using it through load movie on level 1, the error box showing 'a text field is not filled' will kept popped up, even all the text field has been filled. Below is the url
http://www.baptain.com --> ENTER --> appointment
would appreciate if any of the expert around can help me solving this problem. Thanks a million
www.baptain.com/appointmentcgi1.html http://www.baptain.com [url]
Latest Player Is Over-written (for The 3rd Time)
Anyone have any theories why my latest Flash player install is getting over-written, deleted, replaced (take your pick), by a now quite old v5 version player.
I'm lost, as to why this would be happening. Thoughts, ideas, v. welcome.
Written In An External File With No Php And No Sharedobject
Hi,
I need too use persistant variables to store user's preferences.
The swf is basically an advanced slide show for photographers to show their work to their clients.
The variables have to be received and posted from the same swf on a local disc.
Then, when user has set up his preferences on local, he copy the swf file on a cd.
First I used a txt file to store the variables.
Problems:
- do not know how to write or change the txt file from the swf.
- txt file is visible and external people can modify the swf behavior by changing the txt file.
Then I used the sharedobject wich solved those two problems but came out a new problem :
- When I copy the swf to the cd, sharedobject does not "follow" because it's not the same domain...
Arghhh... to make it short :
Considering those, how to use persistant variables on local and then copy evrything to a cd and make it work too?
Thanks
Make A Tagline Look Like It's Being Written On Screen
Hi,
I'm hoping for some expert help here because I'm sure this is really tough! I need to put a tagline on a site that looks like it's being written...no pen or anything like that...just looking like it appears.
Here is a prime example in the flash piece of what I want to do with the text:
http://www.buzancentres.com/EN/index.html
Except, I have no idea how to do this and have been trying all day!
Does anyone have any examples they'd be willing to send me so that I can try to make it work for me? I don't know how to go about it so if anyone has a file that will help me or anything like that I'd be greatful!
Thanks!
Drag And Drop To Ftp Written In Flash?
I have heard of drag and drop ftp prog written in flash. Has anyone else heard of this ??. I want to be able to drag files from my desktop into a flash window which will then transfer those files to a ftp account.
Can any1 point me in the right direction??
Clear Pre-written Text In Input
I have a couple input textboxes in flash and I would like to type out what the user should input in the textbox, and when they click it, I want it to clear out so they can put in there name and email address. Is there anyway to do this? I can explain further if needed
John
AttachMovie Over Written Current Mc Content
Not sure were i am going wrong. Hopfully someone can help.
I am using Flash 8 new upload feature(works fine)
The problem starts when i load the image back into flash.
Here is the function that i am using to load the image back in.
code:
function downloadImage (event:Object):Void {
//Generate random number so no 2 instances have the same name.
randNum = random (100);
trace ("random number=" + randNum);
imgHolder.attachMovie ("shootsHolder", "sHolder" + randNum, imgHolder.getNextHighestDepth (), {_x:0, _y:imgHolder._height + 1});
imgHolder["sHolder" + randNum].imagePane.loadMovie ( imageFile.name);
addMore._visible = 1;
upper.loadBar._xscale = 0;
upper.statusArea.text = "";
upper._visible = 0;
}
The first download of the image works but when i upload another image the first image that was downloaded into "imgHolder" is cleared. i hope that makes sense.
Anyone.
Thanks
Paul
Need An Audio Recorder Written In Flash
Need an audio recorder written in flash.
Format isn't an issue, just as long as I can re-play it in a flash player.
Features include:
-Record button (to start recording)
-Stop button (to stop and save your recording to a file in a specified repository on the server).
Please let me know if you have any answers & thanks for looking...
AttachMovie Over Written Current Mc Content
Not sure were i am going wrong. Hopfully someone can help.
I am using Flash 8 new upload feature(works fine)
The problem starts when i load the image back into flash.
Here is the function that i am using to load the image back in.
ActionScript Code:
function downloadImage (event:Object):Void {
//Generate random number so no 2 instances have the same name.
randNum = random (100);
trace ("random number=" + randNum);
imgHolder.attachMovie ("shootsHolder", "sHolder" + randNum, imgHolder.getNextHighestDepth (), {_x:0, _y:imgHolder._height + 1});
imgHolder["sHolder" + randNum].imagePane.loadMovie ( imageFile.name);
addMore._visible = 1;
upper.loadBar._xscale = 0;
upper.statusArea.text = "";
upper._visible = 0;
}
The first download of the image works but when i upload another image the first image that was downloaded into "imgHolder" is cleared. i hope that makes sense.
Anyone.
Thanks
Paul
Make Text Looks Like Its Being Written On The Screen?
Im not even sure what this is called! but ive visited sites where the text seems to be actually written on the screen in front of me (ya know going from left to right like you would on paper) If anybody can help plz do so. thanks in advance guys ....and girls
MX04 Actionscript Written PopupFULLLSCREEN
Code:
// -------------------------
// Open a centered popup
// window with passed
// features (FLASH MX)
// -------------------------
MovieClip.prototype.centerPopup = function( theUrl,title, w, h, features)
{
var sysW = System.capabilities.screenResolutionX;
var sysH = System.capabilities.screenResolutionY;
var centerx = Math.round((sysW/2)-( w/2));
var centery = Math.round((sysH/2)-( h/2));
getURL("javascript:void(window.open('" + theUrl
+ "','" + title + "','width="+w+", height="+h+", left="
+centerx+", top="+centery+",screenX="+centerx+", screenY="
+centery+"," + features + "'));");
NewWindow.focus();void(0);
if(w.indexOf("%")!=-1){
w = sysW*parseInt(w);
}
if(h.indexOf("%")!=-1){
h = sysW*parseInt(h);
}
}
on bttn:
Code:
on (release)
{
centerPopup("http://www.html.it","html","menubar=no");
}
This works great in the Firefox browser.
In IE it will give me a popup, LEFT TOP 400*400
somehow..
Someone with a solution to make the same what FF does?
Thnx in advanced.
Greetz://
Hand Written Word Animation
hi. i need some help.
i need to make an animation where a word seems to be written, i don't know if i make my self clear. like when you write on a paper, but without a pencil, only the word appearing in a progressive way.
thanks for any help you can give me.
Well Written Tutorials Kirupa... Hooray...
i've just completed the 'add thumbnails' tutorial. and i have to say, it is one the best tutorials i have come across in my feverish exploration of the net to find what i needed...
i'm building the gallery into a portfolio....
my plan was to reload the xml actionscript into each new frame on the main timeline to create new galleries.
but i'm finding that the old actionscript doesn't clear despite changing the name of the xml file loaded.
have tried renaming etc. how would i clear previous frames to allow the new actionscript to work on each new page?
i realise this is probably an incredibly easy thing to do... i feel a bit like the village idiot...
can anyone help me?
Make Text Looks Like Its Being Written On The Screen?
Im not even sure what this is called! but ive visited sites where the text seems to be actually written on the screen in front of me (ya know going from left to right like you would on paper) If anybody can help plz do so. thanks in advance guys ....and girls
MX04 Actionscript Written PopupFULLLSCREEN
Code:
// -------------------------
// Open a centered popup
// window with passed
// features (FLASH MX)
// -------------------------
MovieClip.prototype.centerPopup = function( theUrl,title, w, h, features)
{
var sysW = System.capabilities.screenResolutionX;
var sysH = System.capabilities.screenResolutionY;
var centerx = Math.round((sysW/2)-( w/2));
var centery = Math.round((sysH/2)-( h/2));
getURL("javascript:void(window.open('" + theUrl
+ "','" + title + "','width="+w+", height="+h+", left="
+centerx+", top="+centery+",screenX="+centerx+", screenY="
+centery+"," + features + "'));");
NewWindow.focus();void(0);
if(w.indexOf("%")!=-1){
w = sysW*parseInt(w);
}
if(h.indexOf("%")!=-1){
h = sysW*parseInt(h);
}
}
on bttn:
Code:
on (release)
{
centerPopup("http://www.html.it","html","menubar=no");
}
This works great in the Firefox browser.
In IE it will give me a popup, LEFT TOP 400*400
somehow..
Someone with a solution to make the same what FF does?
Thnx in advanced.
Greetz://
How To Control Movie With Script Written In MC
Last edited by kamesh22 : 2003-07-23 at 21:31.
Hi,
I am using buttons placed in a MC. The problem is when I place on the MC on the main scene the button does respond to the actions in the MC. I want to control the scence with the code wriiten in the MC. But it doesnt work it only works to control the MC.I tried using this code in the MC but it doesnt work.
on (release) {
gotoAndPlay("Scene 2", 273);
}
Is there any way I can Control the scene with the script written inside the Button. Thanks.
AttachMovie Over Written Current Mc Content
Not sure were i am going wrong. Hopfully someone can help.
I am using Flash 8 new upload feature(works fine)
The problem starts when i load the image back into flash.
Here is the function that i am using to load the image back in.
ActionScript Code:
function downloadImage (event:Object):Void {
//Generate random number so no 2 instances have the same name.
randNum = random (100);
trace ("random number=" + randNum);
imgHolder.attachMovie ("shootsHolder", "sHolder" + randNum, imgHolder.getNextHighestDepth (), {_x:0, _y:imgHolder._height + 1});
imgHolder["sHolder" + randNum].imagePane.loadMovie ( imageFile.name);
addMore._visible = 1;
upper.loadBar._xscale = 0;
upper.statusArea.text = "";
upper._visible = 0;
}
The first download of the image works but when i upload another image the first image that was downloaded into "imgHolder" is cleared. i hope that makes sense.
Anyone.
Thanks
Paul
IE Installs Components On Javascript Written Object Tag
I am linking via html to new window in a frameset with no scrollbars and with zero and 100 percent columns so I can put the swf right to the page edge in fullscreen.
The swf page then uses javascript to read the screen res and scale the swf accordingly so it goes full size at 1024 by 768 or 800 by 600 or whatever. It works okay but it takes a few seconds for the swf to appear fullscreen because the browser (IE6) says it is 'installing the components' that is, the flash player in the status bar. Why is this? It can't be my browser coz' it loads fine in the normal object/embed tag. Here is the javascript code that writes the problematic object tag. Any one any ideas?
<SCRIPT LANGUAGE="JavaScript">
// the variables
flName = "scale.swf";
flHeight = '"'+ screen.Height +'"';
flWidth = '"'+ screen.Width + '"';
document.write(
"<OBJECT"
+ "CLASSID=clsid27CDB6E-AE6D-11cf-96B8-444553540000"
+ "WIDTH="+flWidth
+ "HEIGHT="+flHeight
+ "CODEBASE='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'>"
+ "<PARAM NAME=MOVIE VALUE=" + flName + ">"
+ "<PARAM NAME=PLAY VALUE=true>"
+ "<PARAM NAME=LOOP VALUE=false>"
+ "<PARAM NAME=QUALITY VALUE=high>"
+ "<PARAM NAME=MENU VALUE=false>"
+ "<EMBED"
+ " SRC=" +flName
+ " WIDTH="+flWidth
+ " HEIGHT="+flHeight
+ " PLAY=true"
+ " LOOP=false"
+ " QUALITY=high"
+ " MENU=false"
+ " TYPE=application/x-shockwave-flash"
+ "PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'>"
+ "</EMBED>"
+ "</OBJECT>"
);
</SCRIPT>
flumoxed? I am
blipstation
Input Fields Written To Txt File (Shout Box)
I'll try to make this as least wordy as possible...
I have three input fields in a Flash movie: Name, Email, and Comment. The user fills in all three fields, and clicks a "submit" button. I want to have all of that information written to a txt file in the following format:
Code:
<b><a href="mailto:<email_field>"><name_field></a></b><br><comment_field><br><br>
If another visitor fills in the information and submits it, I would like the same format above to be added to the TOP of txt file, making it like this:
Code:
<b><a href="mailto:<email_field_newest>"><name_field_newest></a></b><br><comment_field_newest><br><br>
...
<b><a href="mailto:<email_field_oldest>"><name_field_oldest></a></b><br><comment_field_oldest><br><br>
So the newest entry is on top and it goes down to the oldest at the bottom.
Whew, now, how in the world would I accomplish this? Would it be through an external PHP script or something? I know nothing about that... I'd really appreciate some help. Thanks in advance!
5 Sec Timer Then Go To Next Frame, Script Written But Needs A Fix. Help Wanted
Hey guys,
I am hoping someone will help me with the script below. I would like it when the timer reaches 0 then it would go to my next frame. I have 6 frames in total which all 6 would have this code but different loadmovienum.
Can you please help me fix the script below.
Thanks for any help.
Code:
loadMovieNum( "/swf/exposure_magazine.swf", 1)
_root.timer = 5;
clearInterval(id);
id = setInterval(function () {
_root.timer–;
}, 1000);
if (_root.timer==0) {
nextFrame();
}
So Close Yet No Data Being Written To One Field In Database
I have 5 text fields & 1 list box component. I have found lots of examples of databases passing data to Flash but not vice versa.
I realized that unlike the text inputs I had to set a variable for the list box I call OnlineAdTypes. I feel like I am very close because I do now see undefined rather than a blank field
Here is my AS
Code:
on(press){
function doSubmit()
{
userData = new LoadVars();
var myListbox = OnlineAdTypes;
userData.Name = Name;
userData.Advertiser = Advertiser;
userData.TypeAd = TypeAd;
userData.When = When;
userData.NonAdCustomOnline = NonAdCustomOnline;
userData.OnlineAdTypes = OnlineAdTypes.getSelectedItems();
userData.send
("processForm.asp",0,"post");
gotoAndStop(5);
}
my script processForm.asp
Code:
<%@language = "VBScript" %>
<%
strName = Request.Form("Name")
strAdvertiser = Request.Form("Advertiser")
strTypeAd = Request.Form("TypeAd")
strWhen = Request.Form("When")
strOnlineAdTypes = Request.Form("OnlineAdTypes")
strNonAdCustomOnline = Request.Form("NonAdCustomOnline")
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"DBQ=\contentmain_datasharedDBonlineAdCounter.mdb;"
SQL = "INSERT INTO contacts (Name, Advertiser, TypeAd, When, OnlineAdTypes, NonAdCustomOnline) VALUES ('"&strName&"','"&strAdvertiser&"','"&strTypeAd&"','"&strWhen&"','"&strOnlineAdTypes&"','"&strNonAdCustomOnline&"' )"
conn.Execute SQL, recaffected
Response.Write(strName) & "<br>"
Response.Write(strAdvertiser) & "<br>"
Response.Write(strTypeAd) & "<br>"
Response.Write(strWhen) & "<br>"
Response.Write(strOnlineAdTypes) & "<br>"
Response.Write(strNonAdCustomOnline) & "<BR/><br/>"
Response.Write(recAffected)
%>
the FLA
http://cincinnati.com/test/artistForm5.fla
Hows This Actionscript Written In Flash MX And MX2004?
Im trying to add this actionscript to button1
on.release.with._root.button2.enabled = false
I want the button on release will make button2 inactive
Can someone tell me how this is meant to be written in both flash mx and flash mx2004 that way I can learn how the structure is done.
Thanks
Info Written To Text File For Printing Or Emailing
hi
I need a way to log mouse clicks/choices from on screen (Flash 5 pls!)to a text file of some description.
The aim is to produce a list of choices from a pictorial gallery (ie click on a picture, the name of which gets sent to a txt file accrued in a list format.)
This will then be avaialble for printing direct to printer or alternatively hitting another button will email this list direct to the client.
I will be accessing this text file (or whatever) from various swf files so that should be considered also pls.
This sounds like it is two processes at least and I can't think of a way to do this. Any ideas would be greatfully recieved.
If anyone has ordered shopping on line from tescos will know what I mean when I say email a list of choices made.(I just want a printout facillity too!)
thank you
Shaf
email: cangil@utku.com
shafcangil@hotmail.com
External Text In Flash AS2 But Written In Other Languages (Greek_Chinese- Etc)
Hi...i cant make this work... even though there must be a simple explanation to this...
This code works fine
myData = new LoadVars();
myData.onLoad = function(){
myText_txt.text = this.content;
};
myData.load("Tips.txt");
stop();
It loads from a Tips.txt file...but it works only when the content insight is written in English... i tried other languages like Greek for example.. and it wont load the text.. Any ideas how to fix this?
i tried saving the .txt in UTF-8 and also ANSI but still nothing... do i have to change something on the FLA or in my txt file?
Thank you Good People
Interactive Image Panning - Question Re: Tutorial Written By Kirupa, By Krilnon
I'm not sure if this is in the right forum, sorry first time here.
I've been looking at the tutorial provided by Krilnon on 02 July 2006 named Interactive image panning. A very neat little tute, but I'd like to develop the actionscript to suit a project I'm currently working on. Unfortunately my understanding of Actionscript is poor...
In the original tutorial Krilnon uses Stage.width to keep the scrolling image within the boundries of the stage.
I would like to use an image which is the same width as the stage and get it to scroll only marginally. The image is behind a mask which it must scroll within the boundries of.
To make things a little bit more complicated, I actually have 3 images behind a mask which I'd like to scroll at different speeds.
I've uploded a swf which illustrates the idea, but uses different actionscript and (as you can see) the images move whereever the mouse goes with no constraint.
http://img214.imageshack.us/my.php?i...itytestfe4.swf
I think what I need to do is replace the Stage.width in Krilnon's code with the dimensions of the mask, but I don't know how to do this.
Can anyone help???
|