Hi everyone,
I am starting to dabble with using flash as an interface for php and mysql and, while I could do what I want to do in AJAX, it wouldn't be as pretty. So I grabbed some code and started hacking. What a surprise that it's not working! I know, I know, but everything is functioning except for one thing.
I can retrieve the data with no problem using LoadVars via PHP and MySql, but my problem has to do with assigning a label of some sorts to each jpeg, namely the name of the jpeg itself.
I can do that, but the label/textfield is only there for an instant, until the next label/textfield is generated. It appears exactly where it is suppose to appear underneath the jpeg for which it represents.
The variable being passed "someXCoorComin g" is actually the pic._x
Here's the code: -
function onLoadInit(pic:MovieClip) {
-
pic._width = 150;
-
pic._height = 100;
-
pic._x = 8 + 166*ipic;
-
pic._y = 10;
-
pic._alpha = 100;
-
pic.filters = [picShadow];
-
if (++ipic < pics.length) loadPic(pic._x);
-
}
-
-
function loadPic(someXCoorComing) {
-
holder.createEmptyMovieClip("p"+ipic,ipic);
-
holder["p"+ipic]._alpha = 0;
-
mcl.loadClip("http://www.mydomain.com/registration/images/" + pics[ipic], holder["p"+ipic]);
-
myLabelFunc(someXCoorComing);
-
}
-
-
-
function myLabelFunc(someXCoorComing)
-
{
-
//var txtFormat:TextFormat = new TextFormat();
-
obj = _root.createTextField("mctext",0,someXCoorComing,200,1000,100);
-
mctext.multiline = true;
-
mctext.wordWrap = true;
-
mctext.border = false;
-
-
mcformat = new TextFormat();
-
mcformat.color = 0x5AF416;
-
mcformat.bullet = false;
-
mcformat.underline = true;
-
-
mctext.text = pics[ipic];
-
mctext.setTextFormat(mcformat);
-
-
return obj;
-
}
-
Thanks in advance,
Tarik
3 4174
Your textfield/label is over writing the previous one because you're not inctrementally naming themm.
_root.createTex tField("textFie ldName"+i etc...
Hope this helps.
Your textfield/label is over writing the previous one because you're not inctrementally naming themm.
_root.createTex tField("textFie ldName"+i etc...
Hope this helps.
Yeah, I actually thought of that, but then what do I do for setting the ".text = pics[ipic]" -
-
var myTempVar = "mctext"+ipic;
-
var obj:TextField = _root.createTextField("mctext"+ipic,0,someXCoorComing,180,100,20);
-
-
mcformat = new TextFormat();
-
mcformat.color = 0x000000;
-
- eval(myTempVar).text = pics[ipic];
-
eval(myTempVar).setTextFormat(mcformat);
-
return obj;
-
-
Yeah, I actually thought of that, but then what do I do for setting the ".text = pics[ipic]" -
-
var myTempVar = "mctext"+ipic;
-
var obj:TextField = _root.createTextField("mctext"+ipic,0,someXCoorComing,180,100,20);
-
-
mcformat = new TextFormat();
-
mcformat.color = 0x000000;
-
- eval(myTempVar).text = pics[ipic];
-
eval(myTempVar).setTextFormat(mcformat);
-
return obj;
-
-
You use; - _root["mctext"+ipic].text = pics[ipic];
I often wish .NET was this easy.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Chris Lieb |
last post by:
I am trying to add an event listener to the keyup event for some text
inputs that I am creating dynamically. I have no problems getting it
to work in Firefox, but IE just ignores them. I have created a few
functions to aid in making this process work semi-cross-browser. (I
develop in FF, but everyone who uses it will be using IE6.)
function attachEvent(_obj, _evt, _fnc) {
_evt = _evt.toLowerCase();
if (_obj.attachEvent) {
|
by: Sebarry |
last post by:
Hi,
I have a actionscript script that retrieves data from the database and creates a movie clip with a text field to store the data. I have next and previous buttons to navigate to show the next or previous ten database records.
When previous or next are clicked I want to remove the movie clips previously created using
titleMC = _root.sub_nav_mc.createEmptyMovieClip("articleTitleMC" + i,
...
|
by: shaqa |
last post by:
I try to do this but i cannot.
i creat two layers with actionscript seperated as slideshow need to be,,and i try to put in one rectangle all of my images but cannot put in work,it doesnt load when i go to my choosen page.
Below is the script,please any one tell me how to put all of my images to one rectangle which later i can resize it,and load the image slideshow when i open choosen page.
script:
layer proto:
MovieClip.prototype.alpha =...
|
by: creative1 |
last post by:
I have designed a gallery using XML FILE. File uploads the thumbnails and displays the big image on click of the image. I wan to open a site on click of the bigger image. Can someone help me how I can do that?
here is code:
Choped:
......
function callFullImage(myNumber) { // call full image once the thumb is clicked
myURL = myImages.attributes.full_url; // name of the image to be opned
myTitle = myImages.attributes.title; // name...
|
by: chromis |
last post by:
Hi,
I've been trying to create a carousel class which takes an array of phrases and then creates a textfield for each one positioning it vertically based on the order it was added. The next stage would be for it to make the phrases move down the _y axis until they reach the limit of the container. The phrases need to then swap onto a container behind or drop depths so they are behind the other phrases and then make their way back up. The...
| |
by: nomad |
last post by:
Hello Everyone.
I founded an Flash and xml photo gallery. It works but I took it to another step
What I want is to have six different galleries in one Flash file. I figure out how to do that but
when I click on the the galleries I can see the pervious gallery files.
The gallery works like this:
When you open the gallery there are links on top of the page where you can go to other gallery; with gallery one which has small thumbnails on...
|
by: onyris |
last post by:
Hi guys ,
I have got lost a bit with this flash i am doing at moment , i will try to explain the best i can and i'll post the code as well so u can see what i've done .
I am using Action script 2, i have an XML with photos , at the moment are 7 photos in there. The code i have at the moment just simply reads from the xml all the photos adn display them in a movie clip .
This is the code so far :
step_sel_img.onRelease=function(){...
|
by: anfetienne |
last post by:
is it possible to add php array to vars in the swfobject code?
|
by: anfetienne |
last post by:
i have this code below that i made....it loads vars from txt file splits it then puts it into an array....once in an array it the brings the pics in from the array to create thumbnails and a larger image. my problem is i have captions to go with it and when i try to load the captions nothing happens or can be seen to be happening.
i dont know where i am going wrong as i have no output or compiled errors
var locVar = new Array();...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |