Loading A .jpg Dynamic "I'm Beating My Head Here"
I've done this many times before and suddenly It won't work.
I'm loading a .jpg dynamically during runtime into a MC.
the clip is named "container" the .jpg is in the same directory
here's the code I'm using..
container.loadMovie("logo.jpg");
The movie clip will disapear during runtime as if it was being replaced with the .jpg, but not image appears.....
any idea?
thanks,
FlashKit > Flash Help > Flash MX
Posted on: 12-02-2002, 10:36 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Beating My Head Against A Wall Over Mappings And External Data
Ok, here's what I need to do.
I have a set of options, such as eye color. There are a variety of choices.
The choices are based on a previous variable.
What I would like to do is have an external file contain these choices in a mapping, such as eyecolor = (["blue", "green"])
In flash, I'll have a dynamic text box to display the choices (one at a time), and a left and right arrow to cycle through the various possibilities.
What's driving me crazy is turning those externally defined mappings into something flash can use, probably an array. That way I can have the buttons control a function that cycles through the array's indexes.
Any suggestions are greatly appreciated.
Dynamic Loading Of Jpg's Using CreateEmptyMovieClip...ow My Head
Code:
pic = new Array();//init pic array
blur = new Array();//init blur array
myListener = new Object();//create listener object to use in mc.onLoadComplete function
//FOR loop begins
for (i=0; i==9; i++) {//init FOR loop, start at 0, go to 9, by ones.
pic[i] = ("images/pool"+i+".jpg");//array pic0="images/pool0.jpg" and so on
blur[i] = ("images/pool"+i+"blur.jpg");//array blur[1]="images/pool1blur.jpg" and so on
loadImg("pic_mc"+i,pic[i]);//load the image using loadImg
loadImg("blur_mc"+i,blur[i]);
trace(pic[i]+"/"+blur[i]);
}//FOr loop ends
function loadImg(myClip, imgUrl) {//create new function loadImg and pass var clip and imgUrl
myClip.createEmptyMovieClip(myClip, 0);//create new movie clip with an instance same as name on level1
myClip.loadClip(imgUrl, myClip);//load image into instance of clip created above
//myClip._x=1000//set MC offstage so it's not visible
myListener.onLoadComplete = function(myClip) {//listener for completion of load image
trace(myClip+" is now loaded");//output to debugger
};
}
i know the code is bad, but what i don't understand is why i dont' get ANY output in the trace panel?
Help With Loading External Movie Clip(beating A Dead Horse)
Hello folks, I seem to have run into some problem with a project of mine. I have a Main movie which loads multiple external movies. I am using an empty movie clip called contents to load them into.
one of my external movies has a button in it that launches a centered pop up window(kirupa tutorial). This external movie named site works perfectly by itself, but when loaded into the main movie, the button does not work. I'm using:
on (release) {
_root.contents.loadMovie("site.swf");
}
any input would be greatly appreciated.
Help With Loading External Movie Clip(beating A Dead Horse)
Hello folks, I seem to have run into some problem with a project of mine. I have a Main movie which loads multiple external movies. I am using an empty movie clip called contents to load them into.
one of my external movies has a button in it that launches a centered pop up window(kirupa tutorial). This external movie named site works perfectly by itself, but when loaded into the main movie, the button does not work. I'm using:
on (release) {
_root.contents.loadMovie("site.swf");
}
any input would be greatly appreciated.
Bangin My Head -- Jpgs Not Loading
I purchased a product from imagevue.... the best image viewer i have found on the market...
Any way i am having a ridiculous problem
The image viewer loads an external jpg called load.jpg
the problem is when i change it out with another image called the sam exact thing , same dimensions and file size and put into the same directory IT WILL NOT LOAD into the movie. Then i go and put the old file in and it shows up perfectly.... Whas up with that
I have checked color modes, paths and even the channels to see what is messing up the jpg and everything seems to be in order
Any ideas... i am guessing it is the file itself but dont know what it is.
I even opened up the version that worked and pasted the new image on top but nothing....
Thanks
TM
Beating The Login
I have a flash movie that starts out with a login. It's purpose is just to give the user a username. I want them to be able to use spaces, but I don't want them to just hit the spacebar a bunch of times. How do I make sure they use some combination of letters and numbers and not just a bunch of spaces and making it look like there is no name?
I restricted what they can input by using:
myText_txt.restrict = "A-Z a-z 0-9";
And, I can use the code below, but it won't help if they hit the spacebar.
if (myText_txt != "") {
//login;
}
Any suggestions?
Ok, I've Been Beating Around The Bush But I Can't Figure It Out
I've been trying to get ideas to help me with what I'm trying to do, and everyone HAS helped me a lot... but I still can't figure it out! What I'm trying to do is have a ball always moving right; when it reaches a certain point... say frame 15 or getTimer()+whatever, then it will start over (moving right) but the rotation will be random and it will resume from the position that the last frame was at. So it's constantly moving, after a while it will turn a random direction and go that way, after a while it will turn... you get it. I've tried everything! OY!! If you want me to say what I've tried so that you have a starting point or so that you can see what I was doing wrong, please say so. Thanks
I Know Im Beating A Dead Horse.....
But someone has to have an idea
Here we go
Ok, I have a flash movie, this flash movie is a map with 52 movie clips, they all have an instance name of "section" with a number after it IE: section0 section1 and so on. Ok, In the main coding of my movie I have XML that passes thru ASP that changes the color of the movie clips depending on the variable that is in my database. I use SQL. Here is the coding in my movie
"
/* function sectorArray(){
var msectors, varColor, sid, ftxt
for(i=0;i<=rcrXML.childNodes.length;i++){
if(this.childNodes[i].nodeValue == null && this.childNodes[i].nodeName =="sectors"){
msectors=this.childNodes[i];
}
}
var msector
for (q=0;q<=msectors.childNodes.length;q++){
if(msectors.childNodes[q].nodeName=="sector"){
msector=msectors.childNodes[q];
sid=msector.attributes["id"];
for(j=0;j<=msector.childNodes.length;j++){
if(msector.childNodes[j].nodeName=="color"){
varColor=msector.childNodes[j].firstChild.nodeValue;}
}
changecolors(varColor,sid)
}
}
}
function changecolors(varColor,sid){
ftxt=new Color("section"+sid)
ftxt.setRGB("0x"+varColor)
}
rcrXML = new XML();
rcrXML.ignoreWhite = true;
rcrXML.onLoad = sectorArray;
rcrXML.load("zRcrXml.asp?mdsid=2")
stop ();
||||||
That is the code INSIDE the movie. My actual xml/asp file has this
"
<%option explicit
dim cn, rs, sql
Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
Response.Buffer = true
sql="SELECT * FROM vw_RCR_Mapdata WHERE mdsid = " & request.QueryString("mdsid") & "; "
'Response.Write sql
'Response.End
cn.Open "provider = SQLOLEDB.1;Initial Catalog = OGToolsDb; Data source = Webapps; user id=fsfxsb07; password = "
rs.Open sql,cn
%><?xml version="1.0" encoding="iso-8859-1"?>
<sectors>
<%
do until rs.EOF%>
<sector id="<%=rs("secid")%>">
<rcr>"<%=rs("Rcr_Value")%>"</rcr>
<secname>"<%=rs("Name")%>"</secname>
<%'Check for runway surface conditions for this secid
'Response.Write rs("secid") & ", "
'Response.Write rs("Rcr_Value") & ", "
'Response.Write rs("Takeoff_Landing") & ", "
'Response.Write rs("WaiverThreshold") & ", "
'Response.Write rs("TaxiThreshold") & ", "
if rs("secid") = 0 or rs("secid") = 5 then
'Comparison between takeoff threshold for the runway and rcr
if rs("Rcr_Value") < rs("Takeoff_Landingcaution") then
if rs("Rcr_Value") >= rs("Takeoff_LandingRed") then
'Assign yellow as the color
%><color>ffff00</color><%
else
'Assign red as the color
%><color>ff0000</color><%
end if
else
'Assign green as the color
%><color>00ff00</color><%
end if
else
'Comparison between taxi threshold for the rest of the airfield
if rs("Rcr_Value") < rs("Taxicaution") then
if rs("Rcr_Value") >= rs("TaxiRed") then
'Assign yellow as the color
%><color>ffff00</color><%
else
'Assign red as the color
%><color>ff0000</color><%
end if
else
'Assign green as the color
%><color>00ff00</color><%
end if
end if
rs.Movenext
%></sector><%
loop
%></sectors><%
rs.Close
cn.Close
set cn = nothing
set rs = nothing
*/
||||||||
My question being, there has to be some way possible, to make a code that allows me to mouseover any of the movie clips, and they display the variable in the database that corresponds to their individual section number
Or am I just not going to get it cuz its not possible????
Delay Action Is Beating Me
I have a movie clip that comes to meet the mouse when the mouse hovers over the botom portion of the stage. The clip is scripted to move only along the x axis. When the mouse leaves that bottom area, The movie clip flies off the stage to the left or right, depending on which is closer.
What I want the movie clip to do is wait a few seconds before it flies off the stage when the mouse leaves the bottom area. That way if the mouse wanders from that area for a second or two, the movement of the movie clip won't be annoying. Here is my code:
onClipEvent (enterFrame) {
if (_root._xmouse<795 && _root._xmouse>05 && _root._ymouse>405 && _root._ymouse<445) {
var distance = _root._xmouse-this._x;
if (this._x != _root._xmouse) {
this._x += .15*distance;
}
} else if (this._x<401) {
var homing_distance = -120;
if (this._x != homing_distance) {
this._x += .15*homing_distance;
}
} else if (this._x>400) {
var homing_distance= 820;
if (this._x != homing_distance) {
this._x += .02*homing_distance;
}
}
}
I have been messing with gettimer, but I can only get the delay to work once. I think set interval might be the key. Please help, this is driving me nuts!
Thanks
Beating The Popup Blocker
I have an aspx form that I need to load from a button as a popup but the blocker catches it. We tried to load it with getURL(javascript:window.open()), but the popup blocker(IE and a google popup blocker) caught it. Is there a way to make something popup on a user driven event like this? The thing is is that we could do it with "_blank" just fine but we also need to limit the size of the window scallability menubar and all that other stuff you can do with window.open. What do you guys suggest?
Heart Beating Tween
How can I implement a tween simulting the heart beating.
var myTweenX:Tween=new Tween(myShiningLogo,"scaleX",Bounce.easeOut,1,0.6, 1,true);
var myTweenY:Tween=new Tween(myShiningLogo,"scaleY",Bounce.easeOut,1,0.6, 1,true);
this is almost what I want. But I would like the object to come back to initial dimensions. Should I use other 2 tweens ?
Beating The 16,000 Frame Barrier Without LoadMovie()
Heya folks.
I've been working ona personal Flash project for quite some time now. I was oblivious to the 16,000 frame limit until now. My movie is running at 30 fps and is between 10-12 minutes long, so as it turns out I'll be exceeding this limit by a fair amount. Cutting stuff out of my film or reducing the fps is not an option at this point in development, and this all need to be contained in one SWF. I really want to beat the barrier, and I have an idea, but I wanted to throw it out there to make sure it will work before I go through the trouble of doing it.
I'm assuming 16,000 frames is the limit for the main timeline, but the timelines of movie clips exist outside of this barrier. Could you realistically compile half the movie into an 8000 frame movie clip, put the other half of the movie into another 8000 frame movie clip, and then put these two movie clips on a 2-frame movie? The first movie clip would have actionscript that moved the main timeline to the second frame (and the second half of the movie) when it completed its 8000 frame run.
I've never tried this before. Would this work without defying any of the frame limits? If this idea is even theoretically sound but I'm missing something important, any advice is greatly appreciated. Thanks for your time.
XML Resize Thumbs (hope I'm Not Beating A Dead Horse)
Hello everyone! I've been all through these 60 some pages on this subject and didn't find what totally what I was looking for... of course eye strain might be a problem so if there is a thread to something I ask please tell me. I apologize in advance if I do. This is my first ever thread also.
Here is a zip of all my files so far. http://marazita.com/funstuff/gallery.zip First here is the link to Scotty's thumb resize that I've put into my .fla. V3_with_thumbs zip Mine doesn't work because what I'm trying to do is make the thumbs replace the mc's that I've added (each with an instance name thumb1, thumb2, etc.). As an artist I like to group images that belong in a group. Sometimes a group can have 3 sometimes 4, etc.. This is what's been wrong with what I've found in the threads so far. They've just been lumped into a certain amount to columns and rows. If you look at my files you'll understand better. I was also hoping that the thumbs would load like this zipped file http://marazita.com/funstuff/gallery_preloadthumbs.zip (which is another nice dynamic loaded one that you don't have control over either). Any help will be greatly appreciated and at the end I'll post my finished file to share with everyone since I've gained so much from this site I would like to also give back. This will help a lot of artists out there I'm sure. Thanks to all that help in advance. I have other questions... but lets do baby steps at first.
-Justin-
www.marazita.com
Creating Text File - Or - "Beating A Dead Horse"
Hey Folks,
Please forgive me for revisiting this often-asked question, but...
I just installed Flash MX 2004, and was wondering if there was
any new functionality that allows the developer to create and
write to an external text file.
From what I've read, this is possible using PHP, ASP, etc... Though,
that requires access ta a PHP or ASP web server - something I don't
want to set up at this time. So, I guess I'm asking if there is any
way to create/write a text file without the help of PHP, ASP, or
a web server?
I'm inserting the movie in VB and using FSCommand to communicate
between the two - Flash input, VB create the file. This works, but
is not very elegant, not efficient, can't run it in IE, etc...
Can you do it using XML? Any other suggestions?
Thanks A Lot,
Beating Heart With Variable Heart Rate?
Okay everyone. Put your thinking caps on.
I need to create a beating heart. I need to be able to have control over the heart rate... and therefore, the speed at which the heart beats.
Any clever ideas?
XML Loading, Dynamic Buttons, Dynamic Text Fields...
My last thread kind of died, I guess, so here's another one that I hope will get me some help; it has an updated FLA attached and what I think to be some better descriptions of my problems... I know I'm totally indebted to whomever will help, but this is an emergency and I need some timely advice.
so here's the FLA, XML, and some sample images: kirupaTest2.zip
1. I pretty much have the enlarged pictures loading I guess, which was my major problem before, but it doesn't matter because I can't get the code to "know" which of the dynamic thumbnails has been clicked (by "know", I mean return an index value, say 0 through 7 if there are 8 projects, that I can use to access that particular project in the array of 8 projects in the rest of the code)... So if the third movieclip thumbnail were clicked, I'd like "2" to come up somehow... I've tried this code, which is kind of lame, I know, based off of the idea of each of the thumbnail movieclips' names ending in their index number:
ActionScript Code:
//"this" is the button that was pressed; would return a string ending in//thumberMC_<number of whichever movieclip thumb was clicked>var: testString:String = this; //storing how many characters are in the string above...var: stringNumb:Number = testString.length;//using that value to take off the last string (hopefully the number)var: finalString = testString.charAt(stringNumb);
And that didn't work. (The code above was entered around line 71 in the layer "actions"; it's gone now)
2. An even bigger problem is I have some containers being drawn dynamically from height and width values pulled from an XML file. When I test the code that creates the objects using hard-coded values, it works fine; say if I put 481 in for the width and 375 for the height. But if I try to do it (sort of) dynamically like:
ActionScript Code:
var picHeight:Number = projects[5].bigPics[0].picHeightvar picWidth:Number = projects[5].bigPics[0].picWidth
it gets all screwed up; please try it for yourself in the supplied FLA. It's hard to describe what goes wrong; some things are drawn, and others aren't. I think it's because the objects are trying to draw before they have the data to draw with. This can be seen at lines 129 and 130.
3. Lastly, there's a dynamic textfield I'm trying to create that never shows up for some reason. Again, you could see in the FLA (in the "createDrawer" function around line 424).
If I can clarify, please let me know.
Loading Dynamic Textbox While Dynamically Loading Movie
Hi All,
So, I've got a movie on the stage (but offstage) called: Card. Inside this MC is a dynamic textbox called: CardName. I'm using a for loop to create a column of cards w/ their corresponding textboxes.
Here's the code:
for (var j = 1; j<=6; ++j)
{
var name = "Card_"+j;
var y = (j-1)*game.spacingY + game.originY;
game.path.attachMovie("Card", name, ++game.depth);
game.path[name]._x = x;
game.path[name]._y = y;
game.path[name]._width = game.cardSizeX;
game.path[name]._height = game.cardSizeY;
game.path[name].CardName.text = "card #" + j;
}
The cards and the textboxes inside the card MCs load fine but the actual textboxes don't change from the default text I've hard-coded in. How can I reach the dynamic textbox inside the card Movie Clip to manipulate the text.
Thanks.
Dynamic Loading Text File Not Loading Correctly
I am loading info from a text file (noticeBoard.txt) using the following code;
sourceTXT = "noticeBoard/noticeBoard.txt";
nodeSource = new LoadVars();
nodeSource.onload = gotoAndStop(printText);
nodeSource.load(sourceTXT);
Then writing it into a textfield when the timeline moves to the 'printText' frame.
The swf is working when I load my html page (notice.htm), with all my values being displayed. If I then navigate away from this page to one where I write more info to the text file and then return to notice.htm the latest info in the text file does not show in my swf. Even if I refresh the html page the new info does not appear until I shut my browser window then reopen it.
Does anyone have any suggestions to why this info is not coming in on the fly?
Thanks
Dynamic Image Loading / Images Not Loading?
This is my first try at loading images with action script. I read through the forums, borrowed code, and adapted it.
///////////////////////////works fine
myvars = new LoadVars();
myvars.load("alldoorsdesc.txt");
myvars.onLoad = function (success) {
if (success) {
_root.doorsinsttxt.htmlText = myvars.d1txt+"<BR><BR>To order call us at 505 934 8888";
//I would like to create a for loop here so addidtional
//items can be added, is this possible?
_global.dr1txt = myvars.d1txt;
_global.dr2txt = myvars.d2txt;
_global.dr3txt = myvars.d3txt;
_global.dr4txt = myvars.d4txt;
_global.dr5txt = myvars.d5txt;
}
};
///////////////////////////doesn't trace to loaded door
var doormovie = _root.createEmptyMovieClip("imgmovie",_root);
doormovie._y = 100;
doormovie._x = 300;
doormovie._width = 300;
doormovie._height = 300;
function loadpic(num){
trace("inside loadpic" +num);
doormovie.createEmptyMovieClip("img"+num, num);
doormovie["img"+num].loadMovie("images/door"+num+".png");
//// I'm not sure about this line
doormovie["img"+num].onload = function(){trace("loaded door"+num);};
stop();
}
function unloadpic(num){cont["img"+num].removeMovieClip();}
function unloadAll(){cont.removeMovieClip();}
loadpic(1);// load the inital picture
----------------------------
Are all these functions loaded into the root visible from another movie that is imported with getURL ? Or do I have to copy the functions to that imported movie?
Loading Dynamic Textbox While Dynamically Loading
Hi All,
So, I've got a movie on the stage (but offstage) called: Card. Inside this MC is a dynamic textbox called: CardName. I'm using a for loop to create a column of cards w/ their corresponding textboxes.
Here's the code:
for (var j = 1; j<=6; ++j)
{
var name = "Card_"+j;
var y = (j-1)*game.spacingY + game.originY;
game.path.attachMovie("Card", name, ++game.depth);
game.path[name]._x = x;
game.path[name]._y = y;
game.path[name]._width = game.cardSizeX;
game.path[name]._height = game.cardSizeY;
game.path[name].CardName.text = "card #" + j;
}
The cards and the textboxes inside the card MCs load fine but the actual textboxes don't change from the default text I've hard-coded in. How can I reach the dynamic textbox inside the card Movie Clip to manipulate the text.
Thanks.
In Over My Head Now
Ive been playing with Bryce 4 and have got a nice assortment of 3d models, so I thought I would use them to give me a direction to take my flash learning to.
The question is,
If say I animate a cube(borg-ed up! lol) in bryce, I can make a movie of it at any degree spinning or whatever,
I can then inport this animation as a sequence of images into flash.
But what do I need to do if I wanted the user to be able to use the drag function on the cube so as they could spin it around in any direction so as to view it from all 360 degrees.
Is this going to be a bit of a mission?
Im able to carry out the first stages and know I can grab things with the drag function.
Any and all suggestions will be appreciated.
Thanks in advance
Doing My Head In
what i would like to do is have a graphic or button moving from ond side of the screen to the other. When it hits the other sise it will return back to the starting position. I dont want to use a motion tween, instead i want to use scripting to keep the file size down. This surely must be quite easy???? could someone paste up the code???
I have it working to a dgree except that the damn starting position sets itself instead of where i tell it,
please help if you can
Cheers, C
In Over My Head?
Hi all! just getting into flash and glad I found this forum.
A friend of mine has learned that I'm learning flash and already wants me to do a project that I said I would happily take on.(afterall you can't learn anything unless you've had some practical experience) He's looking for something along the lines of the http://www.californiaclosets.com/ intro page.
I checked it out and thought it looked simple enough to work off of but now I'm feeling a little overwhelemd and am unsure of where to start. I can't seem to come up with anything even close. Granted, I haven't dedicated a lot of time...
I've done the basic tuts that come along with flash5 and read some other tuts from various sources.
How does one approach a project like this and does it look like a lot of work for a novice to pull off?
Any advice would be appreciated. I hope I don't come off sounding like a whine.
Help Me Get My Head Around This
Gday
ARound the edge of stage, i have a boarder. Within it i have 5 buttons.
As you can imagine, i want my buttons to have a 'goto' command when pressed and each button will have a different goto and play 'frame'.
What i want to happen is when any of these buttons are pressed, i want my boarder to collapse upto the top of the stage into a rectangle and have these buttons within it. This animation i want to happen no matter which button is pressed
The problem i have is that i do not know how to tell each button that you must do the animation first then got to your frame with the relevant information on it.
I do not want to duplicate my workload and construct the last frame of my home page on the first frame of each button press.
Please help me.
Thanks
Huggs
Pop Pop Pop Goes My Head~
Hi all,
I'm trying to create a pop window in flash mx running on osx. below is some code that I am using for the button:
[code]on (release) {
// url,_winName,_width,_height,_toolbar,_location,_di rectories,_status,_menubar,_scrollbars,_resizable
openWinCentre("http://www.musicbycab.com", "blank", 800, 600, 0, 0, 0, 0, 0, 0, 1);
}
Can't Get My Head Around This
The following script works fine, no troubles - I'm just trying to work out how to make MC '_root.ewq' just PLAY. No 'gotoAnd'.. just straight out Play();
Sending Movie
Code:
on (release) {
my_frame = 5
talkingAtoB = new LocalConnection();
talkingAtoB.send("simple_lc", "communication", my_frame);
}
Receiving Movie
Code:
stop();
listeningLC = new LocalConnection();
listeningLC.communication = function(my_frame){
_root.ewq.gotoAndPlay(my_frame);
};
listeningLC.connect("simple_lc");
Hope you can help me!
Thanks!
Over My Head...
i really need some help here! (im a real newbee in some areas)
i am creating a projector exe for a distributed cd-rom.
the file size is already 4.5 mb, which i think is ok for cd streaming.
but i need to add a 3dmax animation (4 min long: 4200 targa frames) to be able to play within the flash/projector and have movie control (i already know how to control playback of a movie clip or video)
i have been having problems embedding the animation (too big: it crashes)
can i load the animation from the cd-rom as an swf?
or is there another way to accomplish this simple task.
Over My Head
Hello, I'm currently re-designing our guild's website and I'm having trouble figuring out what's the best way to build my opening and closing doors transition effect from section to section. I've tried several different noob hacks that I thought would work to get the effect I'm after, but my knowledge of AS isn't that great yet.
I've listed below the links to the source file and test site to demonstrate what I'm trying to achieve. If you click on the "Join" button that's exactly how I would like the transition to work for all the sections. Now click on the "Backstory" button, I want the doors to close on the current section being displayed and then when they open to display whatever section the user clicked from the menu.
Test Site
Source File
Could anyone give me some advice on how to build this transition effect for my sections? I'm guessing I would have to make some kind of function with if statements, etc.
Cant Get My Head Around This One...
Ok...I have two swf...a standard view and a "full screen" view...by default the standard view loads and there is a button to switch to full screen...when the standard view loads to begin with...the exhibitor list on the left works fine with the booths in the floorplan....meaning when you click an exhibitor, the corresponding booth lights up...however, when you load the second swf...which loads to _level0 using the following cose loadMovie("standard-0.48.xml", _level0); the exhibitor list does not work quite the same...when I click on an exhibitor now, the color for the whole floorplan changes, and does not change back...and if you click the standard view button, it goes back to the standard view, but again when you click an exhibitor, the color of the whole plan changes...any idea how to fix this?
you can see the results at www.expocadvr.com/temp/default.html
THanks,
Paul
In Over My Head. ?What?
I have an external SWF gallery type web page in the process.
The last part i have to figure out is how to have a vector square resize on button click in my root SWF. The resizing shouldn't relate to anything and is independent of the content in the external swfs. I didn't think it would be that difficult but i have looked at a lot of posts and can't wrap my head around it.
I'm willing to learn and figure it out for myself but i just don't know enough about flash/actionscript to know where to start.
is there a God out there in cyberspace?
send help/S.O.S
thanks
Please Help == In Over My Head
Okay, I'm in a jam. I've been given a project to do that seems simple enough but I am lost. I need to read in a flat text file which includes a bunch of name=value pairs.
Here is an example of what it looks like.
Envent="blah Blah blah"
Time="Blah"
Descript="Blah Blah Blah"
Link="www.blah.com"
Envent="blah Blah blah"
Time="Blah"
Descript="Blah Blah Blah"
Link="www.blah.com"
Envent="blah Blah blah"
Time="Blah"
Descript="Blah Blah Blah"
Link="www.blah.com"
You get the idea.
Anyhow I need to figure out how to loop through the file one row
or record at a time so that I can build a flash movie based on the input.
I figure I could do some like:
while(textfile){
addMovieClip;
addText;
addUrl;
}
And build the whole thing.
But I suck at action script. I'm sort of ColdFusion/PHP guy
and I can't find a good way of doing this.
I've looked over loadVars and loadVariables but that needs a URL encoded string, which I may be able to use. But basic structure of the text file will still be the same.
HELP PLEASE !!!!
Any ideas?
Can I build an array for each record, or an object? how do I do this?
Please!!!!
Over My Head A Bit
A client requested that for an introduction to their site, they would like to have a map of europe come into focus and have a dot land on England then lines shoot from the dot to different countries throughout europe. how would i go about doin that. any help at all would be greatly appreciated.
Oh My God... IT BIT HIS HEAD OFF
...lol
Hey Fellow Tech Geeks ,
Ok some major problems since the last time we talked.
Does neone know alot about mouse trails and random movement.
1. I'm trying to create randomly moving objects that vibrate at the same time. This can be easily done by combining two of kirupa's tutorials together (i.e. Flash MX random movement and Vibration tutorials.)... but how, heh.
2. I need to create a mouse trail layer layer over this. But first i need to create the mouse trail.
Here's the code I have so far:
Code:
onClipEvent (mouseMove) {
i++;
this.duplicateMovieClip("PPointer"+i, i+6);
_root["Pointer"+i]._x = _root._xmouse;
_root["Pointer"+i]._y = _root._ymouse;
}
onClipEvent (enterFrame) {
if (this._name == "PPointer") {
_visible=0;
}else{
this._alpha -= 5;
this._rotation += 2;
this._xscale += 5;
this._yscale += 5;
if (this._alpha <= 5) {
removeMovieClip(this);
}
}
}
But it doesn't seem to be working all to well. I'm sure i'm missing stuff.
3. Also the biggest problem I'm having is combining scenes 1 and 2. And still mantaining the mouse and mouse trail over-layer.
Unforunatly, it is too big to attach here but i'd be happy to e-mail it to neone interested in helping out. I will attach the project that i have done so far, along with what scene 2 should look like (also immediatly after the flash movie ends (not suppose to loop like it does) it is suppose to initiate the main page)...
Again I'm sure i'm just missing alot of actionscript. Thx in advance for nebody who can assist in knocking out some of these minor bugs.
In Over My Head Again
Hi there,
Here is my issue...I created a map that zooms in and out as well as scrolling. My problem is that I have active buttons within the map which lead to separate html pages when hit. My problem is that I don't want the flash to reload when it goes to the next page, I want it to stay at the same zoom and scroll location as the previous page.
Is this even doable? (I know I can do it in frames but don't want to)
Any assistance would be wonderful, I just can't wrap my head around this to do it myself.
Thanks!!!
In Over My Head
I have taken my first "big" website job of creating an online store for a company. They are looking to mimic one of the two websites :www.demostores.com or www.drjays.com.
I have ALOT OF experience with creating websites through Flash, Dreamweaver and ImageReady and I want to figure out how to configure a shopping cart into a create Flash Website. I purchased the Shopping Cart at GoDaddy.com and was hoping to build with that.
Basically, if anyone can give me any advice as to how I should go about starting the process of a shopping cart website, that would be great. I just need a little jump start and can normally trial & error my way through the rest. Thanks.
Cant Get My Head Around This One...
Ok...I have two swf...a standard view and a "full screen" view...by default the standard view loads and there is a button to switch to full screen...when the standard view loads to begin with...the exhibitor list on the left works fine with the booths in the floorplan....meaning when you click an exhibitor, the corresponding booth lights up...however, when you load the second swf...which loads to _level0 using the following cose loadMovie("standard-0.48.xml", _level0); the exhibitor list does not work quite the same...when I click on an exhibitor now, the color for the whole floorplan changes, and does not change back...and if you click the standard view button, it goes back to the standard view, but again when you click an exhibitor, the color of the whole plan changes...any idea how to fix this?
you can see the results at www.expocadvr.com/temp/default.html
THanks,
Paul
Over My Head Presumably
Hi all
I am starting a new private projest and would like to have a 3d rotating cube ...
Wait i know i am likley to get a lot of swift tutorials here and i have looked at them and they all seem to be designed for people who know how to use it ...
I have also heard this can be done in as and have looked at some of the examples here, they would do excatly what i would want but i am unable to figure out how to remove the mouse control because each time i do that it just goes absolutly spasticated !!! and then disspears !!!
I would like to put everything in what i would like to do with the cube but I wish not to give you a headache from just reading the first post in this thread
Here is the code i am using from the example
Code:
// create a scene movieclip to contain all 3D elements
// and center it on the screen.
this.createEmptyMovieClip("theScene", 1);
theScene._x = 150;
theScene._y = 150;
// focal length to determine perspective scaling
focalLength = 300;
// here we set up a function to make an object with
// x, y and z properties to represent a 3D point.
make3DPoint = function(x,y,z){
var point = new Object();
point.x = x;
point.y = y;
point.z = z;
return point;
};
// here we set up a function to make an object with
// x and y properties to represent a 2D point.
make2DPoint = function(x,y){
var point = new Object();
point.x = x;
point.y = y;
return point;
};
// this is a function that will determine whether a triangle
// drawn between the 3 points a, b and c is supposed to be
// visible or not
isVisibleBetween = function(a,b,c){
if (((b.y-a.y)/(b.x-a.x)-(c.y-a.y)/(c.x-a.x)<0)^(a.x<=b.x == a.x>c.x)){
return true;
}else{
return false;
}
};
// here is a function that will draw a side of cube
// based on 4 passed points, first checking if it should
// be drawn using isVisibleBetween on the first 3 points
drawFilledSquare = function(a,b,c,d){
this.clear();
this.lineStyle(2,0,100);
if (isVisibleBetween(a,b,c)){
this.moveTo(a.x, a.y);
this.beginFill(this.col, 100);
this.lineTo(b.x, b.y);
this.lineTo(c.x, c.y);
this.lineTo(d.x, d.y);
this.lineTo(a.x, a.y);
this.endFill();
}
};
// conversion function for changing an array of 3D points to an
// array of 2D points which is to be returned.
Transform3DPointsTo2DPoints = function(points, axisRotations){
// the array to hold transformed 2D points - the 3D points
// from the point array which are here rotated and scaled
// to generate a point as it would appear on the screen
var TransformedPointsArray = [];
// Math calcs for angles - sin and cos for each (trig)
// this will be the only time sin or cos is used for the
// entire portion of calculating all rotations
var sx = Math.sin(axisRotations.x);
var cx = Math.cos(axisRotations.x);
var sy = Math.sin(axisRotations.y);
var cy = Math.cos(axisRotations.y);
var sz = Math.sin(axisRotations.z);
var cz = Math.cos(axisRotations.z);
// a couple of variables to be used in the looping
// of all the points in the transform process
var x,y,z, xy,xz, yx,yz, zx,zy, scaleRatio;
// 3... 2... 1... loop!
// loop through all the points in your object/scene/space
// whatever - those points passed - so each is transformed
var i = points.length;
while (i--){
// apply Math to making transformations
// based on rotations
// assign variables for the current x, y and z
x = points[i].x;
y = points[i].y;
z = points[i].z;
// perform the rotations around each axis
// rotation around x
xy = cx*y - sx*z;
xz = sx*y + cx*z;
// rotation around y
yz = cy*xz - sy*x;
yx = sy*xz + cy*x;
// rotation around z
zx = cz*yx - sz*xy;
zy = sz*yx + cz*xy;
// now determine perspective scaling factor
// yz was the last calculated z value so its the
// final value for z depth
scaleRatio = focalLength/(focalLength + yz);
// assign the new x, y and z
x = zx*scaleRatio;
y = zy*scaleRatio;
// create transformed 2D point with the calculated values
// adding it to the array holding all 2D points
TransformedPointsArray[i] = make2DPoint(x, y);
}
// after looping return the array of points as they
// exist after the rotation and scaling
return TransformedPointsArray;
};
// the points array contains all the points in the 3D
// scene. These 8 make a cube on the screen.
pointsArray = [
make3DPoint(-50,-50,-50),
make3DPoint(50,-50,-50),
make3DPoint(50,-50,50),
make3DPoint(-50,-50,50),
make3DPoint(-50,50,-50),
make3DPoint(50,50,-50),
make3DPoint(50,50,50),
make3DPoint(-50,50,50)
];
// each side will be in its own movieclip
// each movieclip will have button actions which
// will display text and change its color
// drawFilledSquare is also given to the clip so
// it can know how to draw itself. First the functions
// for handling the interaction will be defined, then
// added to each clip as its created.
rollOverFace = function(){
this.col = 0xff0000;
};
pressFace = function(){
display_txt.text = "You just pressed "+this._name;
};
rollOutFace = function(){
this.col = 0xdddddd;
};
for (i=0; i<6; i++){
emptyFace = theScene.createEmptyMovieClip("face"+i,i);
emptyFace.col = 0xdddddd;
emptyFace.onRollOver = emptyFace.onDragOver = rollOverFace;
emptyFace.onRollOut = emptyFace.onDragOut = rollOutFace;
emptyFace.onPress = pressFace;
emptyFace.draw = drawFilledSquare;
}
// an object to represent the 3 angles of rotation
cubeAxisRotations = make3DPoint(0,0,0);
rotateCube = function(){
cubeAxisRotations.y -= this._xmouse/3000;
cubeAxisRotations.x += this._ymouse/3000;
// create a new array to contain the _x and _y positions of the
// points in the pointsArray as they would exist on the screen
var pts2D = Transform3DPointsTo2DPoints(pointsArray, cubeAxisRotations);
// draw each side of the cube
this.face0.draw(pts2D[0], pts2D[3], pts2D[2], pts2D[1]);
this.face1.draw(pts2D[4], pts2D[5], pts2D[6], pts2D[7]);
this.face2.draw(pts2D[0], pts2D[4], pts2D[7], pts2D[3]);
this.face3.draw(pts2D[3], pts2D[7], pts2D[6], pts2D[2]);
this.face4.draw(pts2D[2], pts2D[6], pts2D[5], pts2D[1]);
this.face5.draw(pts2D[1], pts2D[5], pts2D[4], pts2D[0]);
};
// make rotateCube happen every frame for theScene
theScene.onEnterFrame = rotateCube;
the part i changed to stop the mouse control
Code:
rotateCube = function(){
cubeAxisRotations.y -= ".1";
cubeAxisRotations.x += ".1";
// create a new array to contain the _x and _y positions of the
// points in the pointsArray as they would exist on the screen
var pts2D = Transform3DPointsTo2DPoints(pointsArray, cubeAxisRotations);
Thank you
Oh My God... IT BIT HIS HEAD OFF
...lol
Hey Fellow Tech Geeks ,
Ok some major problems since the last time we talked.
Does neone know alot about mouse trails and random movement.
1. I'm trying to create randomly moving objects that vibrate at the same time. This can be easily done by combining two of kirupa's tutorials together (i.e. Flash MX random movement and Vibration tutorials.)... but how, heh.
2. I need to create a mouse trail layer layer over this. But first i need to create the mouse trail.
Here's the code I have so far:
Code:
onClipEvent (mouseMove) {
i++;
this.duplicateMovieClip("PPointer"+i, i+6);
_root["Pointer"+i]._x = _root._xmouse;
_root["Pointer"+i]._y = _root._ymouse;
}
onClipEvent (enterFrame) {
if (this._name == "PPointer") {
_visible=0;
}else{
this._alpha -= 5;
this._rotation += 2;
this._xscale += 5;
this._yscale += 5;
if (this._alpha <= 5) {
removeMovieClip(this);
}
}
}
But it doesn't seem to be working all to well. I'm sure i'm missing stuff.
3. Also the biggest problem I'm having is combining scenes 1 and 2. And still mantaining the mouse and mouse trail over-layer.
Unforunatly, it is too big to attach here but i'd be happy to e-mail it to neone interested in helping out. I will attach the project that i have done so far, along with what scene 2 should look like (also immediatly after the flash movie ends (not suppose to loop like it does) it is suppose to initiate the main page)...
Again I'm sure i'm just missing alot of actionscript. Thx in advance for nebody who can assist in knocking out some of these minor bugs.
In Over My Head Again
Hi there,
Here is my issue...I created a map that zooms in and out as well as scrolling. My problem is that I have active buttons within the map which lead to separate html pages when hit. My problem is that I don't want the flash to reload when it goes to the next page, I want it to stay at the same zoom and scroll location as the previous page.
Is this even doable? (I know I can do it in frames but don't want to)
Any assistance would be wonderful, I just can't wrap my head around this to do it myself.
Thanks!!!
Cant Get My Head Around This One
Im making an e-greetings card, i have an mc with a snowfall in it but i cant get it to work over a few frames, its fine if the movie is only 1 frame but as soon as you put another frame in the snow doesnt fall properly and i cant quite see which bit of script is doing it.
ive uploaded the fla in the hope someone can help me
cheers
Cant Get My Head Around This One...
Ok...I have two swf...a standard view and a "full screen" view...by default the standard view loads and there is a button to switch to full screen...when the standard view loads to begin with...the exhibitor list on the left works fine with the booths in the floorplan....meaning when you click an exhibitor, the corresponding booth lights up...however, when you load the second swf...which loads to _level0 using the following cose loadMovie("standard-0.48.xml", _level0); the exhibitor list does not work quite the same...when I click on an exhibitor now, the color for the whole floorplan changes, and does not change back...and if you click the standard view button, it goes back to the standard view, but again when you click an exhibitor, the color of the whole plan changes...any idea how to fix this?
you can see the results at www.expocadvr.com/temp/default.html
and i have attached a ZIP that contains all the files you would need to reproduce the app locally on your computer...please help...
THanks,
Paul
In WAY Over My Head Help
Im sure this is a bit over my head but I thought i would ask you guys how you might do it before i trash the idea. Im putting up my new flash site soon its almost ready. People will be able to download my dj mixes off the site. what i want to do is force people to sign the guest book BEFORE they can access the music! how do i do this? any ideas? to me it sounds like im gonna have to get into cgi scripts and what not. hopefully I wont and you guys know how to do it in flash!
TIA!
Is It A GlobalToLocal? Or Something Else. Get You Head Around This
As I had NO replies to my last posting let me simplify my problem.
If I had a move call ‘main’ on my main time line and I wanted a user to be able to click on a part on ‘main’ and by doing so ‘main’ would then move the point where the user click to the centre on the stage.
I want ‘main’ to move slowly like a tweeny, and not just jump.
Also this may have the same answer as the above question. But if I had a movie on the main time called ‘mc’. ‘mc’ is longer than the width of the main stage.
I need a button actionscript that will telltarget”mc” to move its _x to move so that the part of the ‘mc’ movie that was hidden off stage will scroll in. I know this sound like it can be done with just a tweenie but I need to be able to move ‘mc’ from position A to B to C to F to B or what ever order the user wish to view.
I hope I have made myself clear.
Thanx
Ste
Newbie Over His Head
i have a few questions .... first i've tried and tried but for some reason i can not make a scroll bar (the type i'm trying to make is like the one on your broser right now >>>)
i've tried everything ..... if you can help me with this it would be greatly apreacted . Oh and this is a really odd question but i was wondering about sound output .... like ummmmm i'm not sure what it is called but you know like windows media player and how it has the videos that change with the music .... well i wanted a simple line that would move with the music but don't know where to start .
If No One Helps Me My Head Is Going To POP
i need to attach one end of a movie clip to the mouse and the other end to thecenter of the stage, i need the movie clip to change lengths and degrees to follow the mouse.
...follow the mouse(point at it).
...change lengths(from center of stage to mouse).
Do I Use Loop Or If... This Is Doing My Head In
Hey helpers...ok I've bought the Actionscript guide book, I've searched through tutorials and given this my best shot but I have to face the fact I'm a designer and not an intuitive programmer damn it!!
ok - I have the following scenario:
- A menu with 5 options.
- When you select an option it pops up an expanding box-shape in the flash file which loads another movie as content when expanded complete. When you select another option, the box remains open and the content is replaced with a new loaded swf. ( I understand load movie, targets, if and else)
the function I need to write is one that says:
if box already open, load new content
else if box closed, open then load new content
Is this too complicated? just look at http://www.egomedia.com to see what I mean...you select an option and it loads into the open box.
HELP MUCHLY APPRECIATED...THANKS
Head Screwing Myself.
Hey All,
I have a problem with a Tween.
I have forward and rewind buttons.
These buttons are rollovers, which control the tween to go forward or rewind in a loop.This works fine.
The Problem is when i roll off the buttons i cant get it to stop the tween.
Here is the FLA.which came from FK. If you do have some spare time to examine it. (100k)
http://www.intellectgraphix.com/PlayReversed.fla
Any help would be greatly appreciated as this is important.
Thanks Heaps
Shaun
IfFrameLoaded From Within MC - Doing My Head In
Done the old ifFrameLoaded from on the main timeline (load loop...etc), but for the life of me can't work out the correct syntaxt for use within a movie clip, checkng if a frame on the main timeline has loaded, and then telling the main timeline to play (that's the easy bit).
I know it'll be simple but just doing my head in at the moment....
|